cvs: php4 /pear/DB mssql.php
| From: | Thomas V.V.Cox | Date: | Wed, 15 Aug 2001 19:20:03 +0000 |
| Subject: | cvs: php4 /pear/DB mssql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-534@lists.php.net to get a copy of this message | ||
cox Wed Aug 15 15:20:03 2001 EDT
Modified files:
/php4/pear/DB mssql.php
Log:
use push/pop in nextID to don't disturb the sequence work
Index: php4/pear/DB/mssql.php
diff -u php4/pear/DB/mssql.php:1.25 php4/pear/DB/mssql.php:1.26
--- php4/pear/DB/mssql.php:1.25 Wed Aug 15 14:48:05 2001
+++ php4/pear/DB/mssql.php Wed Aug 15 15:20:02 2001
@@ -16,7 +16,7 @@
// | Authors: Sterling Hughes <sterling@php.net> |
// +----------------------------------------------------------------------+
//
-// $Id: mssql.php,v 1.25 2001/08/15 18:48:05 cox Exp $
+// $Id: mssql.php,v 1.26 2001/08/15 19:20:02 cox Exp $
//
// Database independent query interface definition for PHP's Microsoft SQL Server
// extension.
@@ -267,7 +267,9 @@
$sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name);
$repeat = 0;
do {
+ $this->pushErrorHandling(PEAR_ERROR_RETURN);
$result = $this->query("INSERT INTO ${sqn}_seq (vapor) VALUES (0)");
+ $this->popErrorHandling();
if ($ondemand && DB::isError($result) &&
($result->getCode() == DB_ERROR || $result->getCode() ==
DB_ERROR_NOSUCHTABLE))
{
@@ -282,9 +284,9 @@
}
} while ($repeat);
if (DB::isError($result)) {
- return $result;
+ return $this->raiseError($result);
}
- $result = $result->fetchRow();
+ $result = $result->fetchRow(DB_FETCHMODE_ORDERED);
return $result[0];
}