Re: Re: cvs: pear /MDB2 MDB2.php
| From: | Lukas Kahwe Smith | Date: | Sun, 16 Oct 2005 21:14:57 +0000 |
| Subject: | Re: Re: cvs: pear /MDB2 MDB2.php | ||
| References: | 1 2 3 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-35615@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
Lorenzo Alberton wrote:Hmm does interbase support quoted sequence names? Looking here at least seems to indicate you dont quoteIdentifiers in createSequence:Lukas Smith wrote:Ok .. I had a bad gut feeling when I made the change, but lazyness took over .. So where do we want to quote? Do we want to quote in nextID() ?why? The method is called "getSequenceName", not "getQuotedSequenceName"... I'm gonna revert this one, please quote the seq name outside this method and only when needed.lsmith Fri Oct 14 18:39:03 2005 EDTModified files: /pear/MDB2 MDB2.php Log:- quote sequence name http://cvs.php.net/diff.php/pear/MDB2/MDB2.php?r1=1.128&r2=1.129&ty=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.128 pear/MDB2/MDB2.php:1.129--- pear/MDB2/MDB2.php:1.128 Fri Oct 14 17:21:48 2005 +++ pear/MDB2/MDB2.php Fri Oct 14 18:39:02 2005@@ -43,7 +43,7 @@ // | Author: Lukas Smith<smith@pooteeweet.org> | // +----------------------------------------------------------------------+// -// $Id: MDB2.php,v 1.128 2005/10/14 21:21:48 quipo Exp $ +// $Id: MDB2.php,v 1.129 2005/10/14 22:39:02 lsmith Exp $ // /** @@ -2388,8 +2388,8 @@*/ function getSequenceName($sqn) { - return sprintf($this->options['seqname_format'], - preg_replace('/[^a-z0-9_]/i', '_', $sqn)); + return $this->quoteIdentifier(sprintf($this->options['seqname_format'], + preg_replace('/[^a-z0-9_]/i', '_', $sqn))); } // }}}
function createSequence($seq_name, $start = 1)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
return $db;
}
$sequence_name = strtoupper($db->getSequenceName($seq_name));
if (PEAR::isError($result = $db->query('CREATE GENERATOR '.$sequence_name))) {
return $result;
}
if (PEAR::isError($result = $db->query('SET GENERATOR '.$sequence_name.' TO '.($start-1)))) {
if (PEAR::isError($err = $db->dropSequence($seq_name))) {
return $db->raiseError(MDB2_ERROR, null, null,
'createSequence: Could not setup sequence start value and then it was not possible to drop it: '.
$err->getMessage().' - ' .$err->getUserInfo());
}
}
return $result;
}
regards,
Lukas