|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-09-12 04:51 UTC] thies@php.net
[2002-09-12 08:35 UTC] walovaton at yahoo dot com dot mx
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Feb 10 05:00:02 2026 UTC |
Hello, This bug seems to be happening in any 4.2.x series, in my case 4.2.3... but not in 4.1.x series When I executed a query that returns an empty recordset (0 records), the value returned by OCIFetch() (or may be OCIResult()) is random garbage. Some times strange characters, sometimes filed names of the SELECT statement. :-S The sql query is all right, if I print the $sql and copy/paste it in sqlplus... it returns the well known message "no rows selected". Let's see a little example: $conn = OCILogon("user", "pass", "dbstring"); // the id '200' doesn't exists $sql = "select name from customers where id = '200'"; $stmt = OCIParse($conn, $sql); OCIExecute($stmt); OCIFetch($stmt); // $name should be empty, but it contains garbage $name = OCIResult($stmt, "name"); So, like in PHP 4.1.x, I was expecting a null value or something that represents an empty value... not garbage or even important information like a fragment of the SELECT statement. I tried this in both ways: (a) compiling OCI8 as a shared module and (b) compiling OCI8 as part of the php shared object, I got the same result. This is my configure string for php 4.2.3: the (b) way ./configure --with-apxs --disable-static --disable-debug --enable-inline-optimization --prefix=/usr/local/php-4.2.3 --with-config-file-path=/usr/local/php-4.2.3/etc --enable-magic-quotes --with-pear --enable-safe-mode --with-zlib=shared --with-mysql=shared,/usr --with-oci8=/opt/OraHome81 --with-pgsql=shared,/usr --with-gettext=shared --with-regex=system --enable-sysvsem --enable-sysvshm --with-mod_charset --enable-trans-sid --enable-ftp=shared and this is my configure string for php 4.1.2: (works fine) ./configure --with-apxs --disable-static --disable-debug --enable-pic --enable-inline-optimization --prefix=/usr/local --with-zlib --with-config-file-path=/usr/local/etc --enable-magic-quotes --enable-track-vars --enable-safe-mode --with-exec-dir=/usr/bin --with-regex=system --enable-sysvsem --enable-sysvshm --with-mod_charset --enable-force-cgi-redirect --enable-trans-sid --enable-ftp --with-gettext --with-freetype-dir --with-oci8=/opt/OraHome81 --with-mysql=/usr --with-pgsql=/usr I'm using gcc 3.2 (should I use gcc 2.95.X???) I was expecting to make the upgrade to php 4.2.x soon but this strange bug makes me think it twice. I hope this bug report helps you to fix the problem. If you need more information, just ask for it and I'll give you what you need. William.