cvs: php4 /pear/DB mysql.php
| From: | Thomas V.V.Cox | Date: | Sun, 22 Jul 2001 14:18:42 +0000 |
| Subject: | cvs: php4 /pear/DB mysql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-321@lists.php.net to get a copy of this message | ||
cox Sun Jul 22 10:18:42 2001 EDT
Modified files:
/php4/pear/DB mysql.php
Log:
commit the new version of the patch from Oleg
Index: php4/pear/DB/mysql.php
diff -u php4/pear/DB/mysql.php:1.64 php4/pear/DB/mysql.php:1.65
--- php4/pear/DB/mysql.php:1.64 Sat Jul 21 20:14:53 2001
+++ php4/pear/DB/mysql.php Sun Jul 22 10:18:42 2001
@@ -386,12 +386,11 @@
if (DB::isError($result)) {
return $result;
}
- } else if (DB::isError($result) &&
- $result->getCode() == DB_ERROR_ALREADY_EXISTS) {
+ } elseif (DB::isError($result) &&
+ $result->getCode() == DB_ERROR_ALREADY_EXISTS) {
// Must be using old sequence emulation implementation,
// clean up the dupes
- $highest_id = $this->getOne("SELECT id FROM ${sqn}_seq ".
- 'ORDER BY id DESC LIMIT 1');
+ $highest_id = $this->getOne("SELECT MAX(id) FROM ${sqn}_seq");
if (DB::isError($highest_id)) {
return $highest_id;
}
@@ -422,8 +421,7 @@
{
$sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name);
$res = $this->query("CREATE TABLE ${sqn}_seq ".
- '(id INTEGER UNSIGNED AUTO_INCREMENT NOT
-NULL,'.
+ '(id INTEGER UNSIGNED AUTO_INCREMENT NOT NULL,'.
' PRIMARY KEY(id))');
if (DB::isError($res)) {
return $res;