fixed bug in db async call if the query had an error, the error was not
cought and not reported back
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<?
|
<?
|
||||||
// $Id: class_test.php 4831 2014-01-20 03:27:10Z gullevek $
|
// $Id: class_test.php 4835 2014-01-23 03:03:55Z gullevek $
|
||||||
$DEBUG_ALL = 1;
|
$DEBUG_ALL = 1;
|
||||||
$PRINT_ALL = 1;
|
$PRINT_ALL = 1;
|
||||||
$DB_DEBUG = 1;
|
$DB_DEBUG = 1;
|
||||||
@@ -126,6 +126,18 @@
|
|||||||
print "DB Version bigger than $to_db_version: ".$basic->db_compare_version('>='.$to_db_version)."<br>";
|
print "DB Version bigger than $to_db_version: ".$basic->db_compare_version('>='.$to_db_version)."<br>";
|
||||||
print "DB Version bigger $to_db_version: ".$basic->db_compare_version('>'.$to_db_version)."<br>";
|
print "DB Version bigger $to_db_version: ".$basic->db_compare_version('>'.$to_db_version)."<br>";
|
||||||
|
|
||||||
|
$q = "SELECT FOO FRO BAR";
|
||||||
|
// $q = "Select * from foo";
|
||||||
|
$foo = $basic->db_exec_async($q);
|
||||||
|
print "[ERR] Query: ".$q."<br>";
|
||||||
|
print "[ERR] RESOURCE: $foo<br>";
|
||||||
|
while (($ret = $basic->db_check_async()) === true)
|
||||||
|
{
|
||||||
|
print "[ERR]: $ret<br>";
|
||||||
|
sleep(5);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// search path check
|
// search path check
|
||||||
$q = "SHOW search_path";
|
$q = "SHOW search_path";
|
||||||
$cursor = $basic->db_exec($q);
|
$cursor = $basic->db_exec($q);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* $HeadURL: svn://svn/development/core_data/php/www/libs/db_pgsql.inc $
|
* $HeadURL: svn://svn/development/core_data/php/www/libs/db_pgsql.inc $
|
||||||
* $LastChangedBy: gullevek $
|
* $LastChangedBy: gullevek $
|
||||||
* $LastChangedDate: 2014-01-20 12:27:10 +0900 (Mon, 20 Jan 2014) $
|
* $LastChangedDate: 2014-01-23 12:03:55 +0900 (Thu, 23 Jan 2014) $
|
||||||
* $LastChangedRevision: 4831 $
|
* $LastChangedRevision: 4835 $
|
||||||
*********************************************************************
|
*********************************************************************
|
||||||
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
|
* AUTHOR: Clemens "Gullevek" Schwaighofer (www.gullevek.org)
|
||||||
* CREATED: 2003/04/09
|
* CREATED: 2003/04/09
|
||||||
@@ -93,10 +93,11 @@
|
|||||||
// DESC : wrapper for pg_get_result
|
// DESC : wrapper for pg_get_result
|
||||||
public function _db_get_result()
|
public function _db_get_result()
|
||||||
{
|
{
|
||||||
$this->last_error_query = '';
|
|
||||||
$result = pg_get_result($this->dbh);
|
$result = pg_get_result($this->dbh);
|
||||||
if (pg_result_error($result))
|
if ($error = pg_result_error($result))
|
||||||
$this->last_error_query = $query;
|
{
|
||||||
|
$this->last_error_query = $error;
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -389,5 +390,5 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// $Id: db_pgsql.inc 4831 2014-01-20 03:27:10Z gullevek $
|
// $Id: db_pgsql.inc 4835 2014-01-23 03:03:55Z gullevek $
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user