aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_pgsql.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-09 20:25:03 +0000
committernikrou <nikrou@piwigo.org>2010-06-09 20:25:03 +0000
commit175e9a110d89f452f39210d4536622afeddebe44 (patch)
tree22e072e325647f06733aa9125924fc3320df2c34 /include/dblayer/functions_pgsql.inc.php
parent80f2c704c9bd467dfc1670e43d883a67d531d955 (diff)
Fix bug 1722 : PosgtreSQL wants all fields in select to be in Group by clause
or agregate function Fix issue for lambda function (incorrect number of params) git-svn-id: http://piwigo.org/svn/trunk@6510 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/dblayer/functions_pgsql.inc.php')
-rw-r--r--include/dblayer/functions_pgsql.inc.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/dblayer/functions_pgsql.inc.php b/include/dblayer/functions_pgsql.inc.php
index 38fcc2ed9..6492e82ef 100644
--- a/include/dblayer/functions_pgsql.inc.php
+++ b/include/dblayer/functions_pgsql.inc.php
@@ -314,7 +314,7 @@ UPDATE '.$tablename.'
pwg_query($query);
}
} // foreach update
- } // if mysql_ver or count<X
+ }
else
{
$all_fields = array_merge($dbfields['primary'], $dbfields['update']);
@@ -326,7 +326,7 @@ CREATE TABLE '.$temporary_tablename.'
pwg_query($query);
mass_inserts($temporary_tablename, $all_fields, $datas);
if ( $flags & MASS_UPDATES_SKIP_EMPTY )
- $func_set = create_function('$s, $t', 'return "$s = IFNULL(t2.$s, '.$tablename.'.$s)";');
+ $func_set = create_function('$s', 'return "$s = NULLIF(t2.$s, '.$tablename.'.$s)";');
else
$func_set = create_function('$s', 'return "$s = t2.$s";');
@@ -343,7 +343,7 @@ FROM '.$temporary_tablename.' AS t2
implode(
"\n AND ",
array_map(
- create_function('$s, $t', 'return "'.$tablename.'.$s = t2.$s";'),
+ create_function('$s', 'return "'.$tablename.'.$s = t2.$s";'),
$dbfields['primary']
)
);
@@ -585,7 +585,7 @@ function pwg_db_get_weekday($date)
}
// my_error returns (or send to standard output) the message concerning the
-// error occured for the last mysql query.
+// error occured for the last pgsql query.
function my_error($header, $die)
{
$error = '[pgsql error]'.pg_last_error()."\n";