#25086 [Opn->Asn]: DB:: postgres driver does not support EXPLAIN

From: Date: Thu, 14 Aug 2003 08:07:55 +0000
Subject: #25086 [Opn->Asn]: DB:: postgres driver does not support EXPLAIN
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19711@lists.php.net to get a copy of this message
ID: 25086 Updated by: arnaud@php.net Reported By: alan at akbkhome dot com -Status: Open +Status: Assigned Bug Type: PEAR related Operating System: na PHP Version: Irrelevant -Assigned To: +Assigned To: cox Previous Comments: ------------------------------------------------------------------------ [2003-08-13 22:36:00] alan at akbkhome dot com Description: ------------ not that the information is that helpfull :) --- Projects/pear/pearcvs/DB/DB/pgsql.php 2003-07-19 17:38:35.000000000 +0800 +++ /usr/share/pear/DB/pgsql.php 2003-08-14 11:24:34.000000000 +0800 @@ -170,8 +170,9 @@ if ($ismanip) { $this->affected = @pg_cmdtuples($result); return DB_OK; - } elseif (preg_match('/^\s*\(?\s*SELECT\s+/si', $query) && - !preg_match('/^\s*\(?\s*SELECT\s+INTO\s/si', $query)) { + } elseif ((preg_match('/^\s*\(?\s*SELECT\s+/si', $query) && + !preg_match('/^\s*\(?\s*SELECT\s+INTO\s/si', $query)) || + preg_match('/^\s*EXPLAIN/si',$query )) { /* PostgreSQL commands: ABORT, ALTER, BEGIN, CLOSE, CLUSTER, COMMIT, COPY, CREATE, DECLARE, DELETE, DROP TABLE, EXPLAIN, FETCH, Reproduce code: --------------- $db->getAll('EXPLAIN SELECT * FROM anytable'); will barf with selecton on non-object. ** DB_Common::getAll() should also check the return value for query is not an integer... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25086&edit=1

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