Re: Bug in DB::isManip with 'lock/unlock'

From: Date: Wed, 11 Jul 2001 16:10:29 +0000
Subject: Re: Bug in DB::isManip with 'lock/unlock'
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-635@lists.php.net to get a copy of this message
At 10:41 AM +0200 7/10/01, Erik Hjortsberg wrote:
Shouldn't 'lock' and 'unlock' be included in DB::isManip as manipulative queries? Line 300 in DB.php:
        if (preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|ALTER|GRANT|REVOKE)\s+/i', $query)) {
should be:
        if (preg_match('/^\s*"?(INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $query)) {
Am I right? /erik hjortsberg
Maybe it should be defined as !preg_match('/^\s*"?SELECT\s+/i', $query) and overridden as necessary (e.g., for MySQL, SELECT, SHOW, EXPLAIN, and DESCRIBE all return rows and are not manipulative). This would seem to allow a shorter test. -- Paul DuBois, paul@snake.net

« previous php.pear.dev (#635) next »