projects
/
fusionforge
/
fusionforge.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
project home
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5e8a0e9
)
Log SQL errors in the error to ease debugging.
author
Alain Peyrat
<aljeux@free.fr>
Mon, 15 Mar 2010 21:26:46 +0000
(21:26 +0000)
committer
Alain Peyrat
<aljeux@free.fr>
Mon, 15 Mar 2010 21:26:46 +0000
(21:26 +0000)
gforge/common/include/database-pgsql.php
patch
|
blob
|
history
diff --git
a/gforge/common/include/database-pgsql.php
b/gforge/common/include/database-pgsql.php
index f890006c4c3fe2c5ad156ecec4fa9ee228a499a6..440924ce85f197f81b6ce491ebfe6a0e6ceb04d9 100644
(file)
--- a/
gforge/common/include/database-pgsql.php
+++ b/
gforge/common/include/database-pgsql.php
@@
-129,6
+129,10
@@
function db_query($qstring,$limit='-1',$offset=0,$dbserver=SYS_DB_PRIMARY) {
//$GLOBALS['G_DEBUGQUERY'] .= $qstring .' |<font size="-2">'.$dbserver.'</font>'. "<p>\n";
$res = @pg_query($dbserver,$qstring);
//$GLOBALS['G_DEBUGQUERY'] .= $qstring .' |<font size="-2">'.$dbserver.'</font>'. "<p>\n";
$res = @pg_query($dbserver,$qstring);
+ if (!$res) {
+ error_log('SQL: '. preg_replace('/\n\t+/', ' ',$qstring));
+ error_log('SQL> '.db_error());
+ }
//echo "\n<br />|*| [$qstring]: ".db_error();
return $res;
}
//echo "\n<br />|*| [$qstring]: ".db_error();
return $res;
}
@@
-161,6
+165,10
@@
function db_query_params($qstring,$params,$limit='-1',$offset=0,$dbserver=SYS_DB
}
$res = @pg_query_params($dbserver,$qstring,$params);
}
$res = @pg_query_params($dbserver,$qstring,$params);
+ if (!$res) {
+ error_log('SQL: '. preg_replace('/\n\t+/', ' ',$qstring));
+ error_log('SQL> '.db_error());
+ }
return $res;
}
return $res;
}