cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver ibase.php mysql.php mysqli.php oci8.php pgsql.php
| From: | Lukas Smith | Date: | Tue, 24 Oct 2006 11:38:41 +0000 |
| Subject: | cvs: pear /MDB2 MDB2.php /MDB2/MDB2/Driver ibase.php mysql.php mysqli.php oci8.php pgsql.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-42781@lists.php.net to get a copy of this message | ||
lsmith Tue Oct 24 11:38:41 2006 UTC
Modified files:
/pear/MDB2 MDB2.php
/pear/MDB2/MDB2/Driver ibase.php mysql.php mysqli.php oci8.php
pgsql.php
Log:
- handle end of query like a new line when ignore ends with a newline char
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2.php?r1=1.269&r2=1.270&diff_format=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.269 pear/MDB2/MDB2.php:1.270 --- pear/MDB2/MDB2.php:1.269 Sun Oct 22 19:16:55 2006 +++ pear/MDB2/MDB2.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.269 2006/10/22 19:16:55 lsmith Exp $ +// $Id: MDB2.php,v 1.270 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -1408,7 +1408,7 @@ $code = $code->getCode(); } elseif (isset($this->connection)) { if (!empty($this->last_query)) { - $userinfo.= "[Last query: {$this->last_query}]\n"; + $userinfo.= "[Last executed query: {$this->last_query}]\n"; } $native_errno = $native_msg = null; list($code, $native_errno, $native_msg) = $this->errorInfo($code); @@ -2878,9 +2878,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.198&r2=1.199&diff_format=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.198 pear/MDB2/MDB2/Driver/ibase.php:1.199 --- pear/MDB2/MDB2/Driver/ibase.php:1.198 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/ibase.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.198 2006/10/22 18:51:19 lsmith Exp $ +// $Id: ibase.php,v 1.199 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -817,9 +817,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.167&r2=1.168&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.167 pear/MDB2/MDB2/Driver/mysql.php:1.168 --- pear/MDB2/MDB2/Driver/mysql.php:1.167 Sun Oct 22 19:17:25 2006 +++ pear/MDB2/MDB2/Driver/mysql.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.167 2006/10/22 19:17:25 lsmith Exp $ +// $Id: mysql.php,v 1.168 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -817,9 +817,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.146&r2=1.147&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.146 pear/MDB2/MDB2/Driver/mysqli.php:1.147 --- pear/MDB2/MDB2/Driver/mysqli.php:1.146 Sun Oct 22 19:17:25 2006 +++ pear/MDB2/MDB2/Driver/mysqli.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.146 2006/10/22 19:17:25 lsmith Exp $ +// $Id: mysqli.php,v 1.147 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -827,9 +827,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/oci8.php?r1=1.184&r2=1.185&diff_format=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.184 pear/MDB2/MDB2/Driver/oci8.php:1.185 --- pear/MDB2/MDB2/Driver/oci8.php:1.184 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/oci8.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.184 2006/10/22 18:51:19 lsmith Exp $ +// $Id: oci8.php,v 1.185 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 OCI8 driver @@ -791,9 +791,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.166&r2=1.167&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.166 pear/MDB2/MDB2/Driver/pgsql.php:1.167 --- pear/MDB2/MDB2/Driver/pgsql.php:1.166 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/pgsql.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.166 2006/10/22 18:51:19 lsmith Exp $ +// $Id: pgsql.php,v 1.167 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -843,9 +843,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1;
http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2.php?r1=1.269&r2=1.270&diff_format=u Index: pear/MDB2/MDB2.php diff -u pear/MDB2/MDB2.php:1.269 pear/MDB2/MDB2.php:1.270 --- pear/MDB2/MDB2.php:1.269 Sun Oct 22 19:16:55 2006 +++ pear/MDB2/MDB2.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: MDB2.php,v 1.269 2006/10/22 19:16:55 lsmith Exp $ +// $Id: MDB2.php,v 1.270 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -1408,7 +1408,7 @@ $code = $code->getCode(); } elseif (isset($this->connection)) { if (!empty($this->last_query)) { - $userinfo.= "[Last query: {$this->last_query}]\n"; + $userinfo.= "[Last executed query: {$this->last_query}]\n"; } $native_errno = $native_msg = null; list($code, $native_errno, $native_msg) = $this->errorInfo($code); @@ -2878,9 +2878,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/ibase.php?r1=1.198&r2=1.199&diff_format=u Index: pear/MDB2/MDB2/Driver/ibase.php diff -u pear/MDB2/MDB2/Driver/ibase.php:1.198 pear/MDB2/MDB2/Driver/ibase.php:1.199 --- pear/MDB2/MDB2/Driver/ibase.php:1.198 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/ibase.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lorenzo Alberton <l.alberton@quipo.it> | // +----------------------------------------------------------------------+ // -// $Id: ibase.php,v 1.198 2006/10/22 18:51:19 lsmith Exp $ +// $Id: ibase.php,v 1.199 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 FireBird/InterBase driver @@ -817,9 +817,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysql.php?r1=1.167&r2=1.168&diff_format=u Index: pear/MDB2/MDB2/Driver/mysql.php diff -u pear/MDB2/MDB2/Driver/mysql.php:1.167 pear/MDB2/MDB2/Driver/mysql.php:1.168 --- pear/MDB2/MDB2/Driver/mysql.php:1.167 Sun Oct 22 19:17:25 2006 +++ pear/MDB2/MDB2/Driver/mysql.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysql.php,v 1.167 2006/10/22 19:17:25 lsmith Exp $ +// $Id: mysql.php,v 1.168 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -817,9 +817,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/mysqli.php?r1=1.146&r2=1.147&diff_format=u Index: pear/MDB2/MDB2/Driver/mysqli.php diff -u pear/MDB2/MDB2/Driver/mysqli.php:1.146 pear/MDB2/MDB2/Driver/mysqli.php:1.147 --- pear/MDB2/MDB2/Driver/mysqli.php:1.146 Sun Oct 22 19:17:25 2006 +++ pear/MDB2/MDB2/Driver/mysqli.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ // -// $Id: mysqli.php,v 1.146 2006/10/22 19:17:25 lsmith Exp $ +// $Id: mysqli.php,v 1.147 2006/10/24 11:38:41 lsmith Exp $ // /** @@ -827,9 +827,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/oci8.php?r1=1.184&r2=1.185&diff_format=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.184 pear/MDB2/MDB2/Driver/oci8.php:1.185 --- pear/MDB2/MDB2/Driver/oci8.php:1.184 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/oci8.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@pooteeweet.org> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.184 2006/10/22 18:51:19 lsmith Exp $ +// $Id: oci8.php,v 1.185 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 OCI8 driver @@ -791,9 +791,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1; http://cvs.php.net/viewvc.cgi/pear/MDB2/MDB2/Driver/pgsql.php?r1=1.166&r2=1.167&diff_format=u Index: pear/MDB2/MDB2/Driver/pgsql.php diff -u pear/MDB2/MDB2/Driver/pgsql.php:1.166 pear/MDB2/MDB2/Driver/pgsql.php:1.167 --- pear/MDB2/MDB2/Driver/pgsql.php:1.166 Sun Oct 22 18:51:19 2006 +++ pear/MDB2/MDB2/Driver/pgsql.php Tue Oct 24 11:38:41 2006 @@ -43,7 +43,7 @@ // | Author: Paul Cooper <pgc@ucecom.com> | // +----------------------------------------------------------------------+ // -// $Id: pgsql.php,v 1.166 2006/10/22 18:51:19 lsmith Exp $ +// $Id: pgsql.php,v 1.167 2006/10/24 11:38:41 lsmith Exp $ /** * MDB2 PostGreSQL driver @@ -843,9 +843,13 @@ $end_quote = $start_quote; do { if (!is_int($end_quote = strpos($query, $ignore['end'], $end_quote + 1))) { - $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, - 'query with an unterminated text string specified', __FUNCTION__); - return $err; + if ($ignore['end'] === "\n") { + $end_quote = strlen($query) - 1; + } else { + $err =& $this->raiseError(MDB2_ERROR_SYNTAX, null, null, + 'query with an unterminated text string specified', __FUNCTION__); + return $err; + } } } while ($ignore['escape'] && $query[($end_quote - 1)] == $ignore['escape']); $position = $end_quote + 1;