svn commit: r327 - trunk/mapbender/http/php/database-pgsql.php
uli at osgeo.org
uli at osgeo.org
Mon May 22 04:31:49 EDT 2006
Author: uli
Date: 2006-05-22 08:31:48+0000
New Revision: 327
Modified:
trunk/mapbender/http/php/database-pgsql.php
Log:
throw exception if rollback is performed
Modified: trunk/mapbender/http/php/database-pgsql.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/database-pgsql.php?view=diff&rev=327&p1=trunk/mapbender/http/php/database-pgsql.php&p2=trunk/mapbender/http/php/database-pgsql.php&r1=326&r2=327
==============================================================================
--- trunk/mapbender/http/php/database-pgsql.php (original)
+++ trunk/mapbender/http/php/database-pgsql.php 2006-05-22 08:31:48+0000
@@ -163,11 +163,11 @@
}
else{
$t = md5(microtime());
- $result = pg_prepare($t, $qstring);
+ $result = pg_prepare("", $qstring);
if(!$result){
$e = new mb_exception("Error while preparing statement in ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$qstring.", Error: ".db_error());
}
- $r = pg_execute($t, $params);
+ $r = pg_execute("", $params);
if(!$r){
$e = new mb_exception("Error while executing prepared statement in ".$_SERVER['SCRIPT_FILENAME'].": Sql: ".$qstring.", Error: ".db_error());
}
@@ -201,7 +201,9 @@
* may cause unexpected behavior in databases that don't
*/
function db_rollback() {
- return db_query("ROLLBACK");
+ $str = db_error();
+ db_query("ROLLBACK");
+ die('sql error: ' . $str . " ROLLBACK performed....");
}
/**
@@ -383,7 +385,7 @@
* Returns the last error from the database
*/
function db_error() {
- return @pg_result_error();
+ return @pg_last_error();
}
/**
More information about the Mapbender_commits
mailing list