cvs: php4 /pear/DB oci8.php

From: Date: Fri, 15 Dec 2000 01:20:23 +0000
Subject: cvs: php4 /pear/DB oci8.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3171@lists.php.net to get a copy of this message
ssb Thu Dec 14 17:20:23 2000 EDT Modified files: /php4/pear/DB oci8.php Log: * DB_oci8: rewrite "SELECT 1+2" to "SELECT 1+2 FROM dual" Index: php4/pear/DB/oci8.php diff -u php4/pear/DB/oci8.php:1.13 php4/pear/DB/oci8.php:1.14 --- php4/pear/DB/oci8.php:1.13 Sat Dec 9 19:18:56 2000 +++ php4/pear/DB/oci8.php Thu Dec 14 17:20:22 2000 @@ -437,6 +437,19 @@ } // }}} + // {{{ modifyQuery() + + function modifyQuery($query) + { + // "SELECT 2+2" must be "SELECT 2+2 FROM dual" in Oracle + if (preg_match('/^\s*SELECT/i', $query) && + !preg_match('/\sFROM\s/i', $query)) { + $query .= " FROM dual"; + } + return $query; + } + + // }}} }

« previous php.cvs (#3171) next »