Changeset 12748 for trunk/include
- Timestamp:
- Dec 16, 2011, 2:53:24 PM (12 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/dblayer/functions_mysql.inc.php
r12010 r12748 417 417 * @return void 418 418 */ 419 function mass_inserts($table_name, $dbfields, $datas) 420 { 419 function mass_inserts($table_name, $dbfields, $datas, $options=array()) 420 { 421 $ignore = ''; 422 if (isset($options['ignore']) and $options['ignore']) 423 { 424 $ignore = 'IGNORE'; 425 } 426 421 427 if (count($datas) != 0) 422 428 { … … 439 445 { 440 446 $query = ' 441 INSERT INTO '.$table_name.'447 INSERT '.$ignore.' INTO '.$table_name.' 442 448 ('.implode(',', $dbfields).') 443 449 VALUES'; -
trunk/include/functions_user.inc.php
r12670 r12748 447 447 pwg_query($query); 448 448 449 // Due to concurrency issues, we ask MySQL to ignore errors on 450 // insert. This may happen when cache needs refresh and that Piwigo is 451 // called "very simultaneously". 449 452 mass_inserts 450 453 ( … … 455 458 'date_last', 'max_date_last', 'nb_images', 'count_images', 'count_categories' 456 459 ), 457 $user_cache_cats 460 $user_cache_cats, 461 array('ignore' => true) 458 462 ); 459 463 … … 465 469 pwg_query($query); 466 470 471 // for the same reason as user_cache_categories, we ignore error on 472 // this insert 467 473 $query = ' 468 INSERT I NTO '.USER_CACHE_TABLE.'474 INSERT IGNORE INTO '.USER_CACHE_TABLE.' 469 475 (user_id, need_update, cache_update_time, forbidden_categories, nb_total_images, 470 476 image_access_type, image_access_list)
Note: See TracChangeset
for help on using the changeset viewer.