This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".
The branch, master has been updated
via 34d969d788abdb48389719ee367bd4844225c27b (commit)
from c20b806f92c45f3bfb5a80a550d79e4fed1df013 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=34d969d788abdb48389719ee367bd4844225c27b
commit 34d969d788abdb48389719ee367bd4844225c27b
Author: mirabilos <[email protected]>
Date: Thu Mar 16 19:28:50 2017 +0100
use a slightly better db_insertid()…
… but see
https://github.com/tarent/hello-php-world/commit/606335b9194560ccd1249b2a064658c6acf32758
for why this is still broken and some better functions (which do
require refactoring the code using it, though)
diff --git a/src/common/include/database-pgsql.php
b/src/common/include/database-pgsql.php
index 95b9c31..d914613 100644
--- a/src/common/include/database-pgsql.php
+++ b/src/common/include/database-pgsql.php
@@ -634,12 +634,12 @@ function db_fetch_array_by_row($qhandle, $row) {
* @param resource $qhandle Query result set handle.
* @param string $table_name Name of the table you
inserted into.
* @param string $pkey_field_name Field name of the
primary key.
- * @param resource $dbserver Server to which
original query was made
+ * @param resource $dbserver Server to which
original query was made
* @return int id of the primary key or 0 on failure.
*/
function db_insertid($qhandle, $table_name, $pkey_field_name, $dbserver =
NULL) {
- $sql = "SELECT max($pkey_field_name) AS id FROM $table_name";
- $res = db_query_params($sql, array(), -1, 0, $dbserver);
+ $sql = 'SELECT currval(pg_get_serial_sequence($1, $2)) AS id';
+ $res = db_query_params($sql, array($table_name, $pkey_field_name), -1,
0, $dbserver);
if (db_numrows($res) > 0) {
return db_result($res, 0, 'id');
} else {
-----------------------------------------------------------------------
Summary of changes:
src/common/include/database-pgsql.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
hooks/post-receive
--
FusionForge
_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits