aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_mysql.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-12-16 13:53:24 +0000
committerplegall <plg@piwigo.org>2011-12-16 13:53:24 +0000
commitd827eacab4a44017349590683ee92026eb06bb60 (patch)
tree63229822348a7b60d30007874cb61d9a0d0f171d /include/dblayer/functions_mysql.inc.php
parentc92140a9ff3f9c558255c0f20bd579fbaa4c90f3 (diff)
merge r12747 from branch 2.3 to trunk
bug 2534 fixed: clean (as clean as possible with MySQL+MyISAM) handle of concurrency on user cache refresh. No more error when regenerating several thumbnails at once. git-svn-id: http://piwigo.org/svn/trunk@12748 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/dblayer/functions_mysql.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php
index dbc66d503..785e588e0 100644
--- a/include/dblayer/functions_mysql.inc.php
+++ b/include/dblayer/functions_mysql.inc.php
@@ -416,8 +416,14 @@ UPDATE '.$tablename.'
* @param array inserts
* @return void
*/
-function mass_inserts($table_name, $dbfields, $datas)
+function mass_inserts($table_name, $dbfields, $datas, $options=array())
{
+ $ignore = '';
+ if (isset($options['ignore']) and $options['ignore'])
+ {
+ $ignore = 'IGNORE';
+ }
+
if (count($datas) != 0)
{
$first = true;
@@ -438,7 +444,7 @@ function mass_inserts($table_name, $dbfields, $datas)
if ($first)
{
$query = '
-INSERT INTO '.$table_name.'
+INSERT '.$ignore.' INTO '.$table_name.'
('.implode(',', $dbfields).')
VALUES';
$first = false;