Home » Database » DB » Bug #1086
DB::isError($res) triggers warning when $res is the result of a DELETE query
Details
| Submitted | 2004-03-28 11:52 UTC |
|---|---|
| From | kauschovar at sdk dot ath dot cx |
| Assigned | danielc |
| Status | Bogus |
| Package | DB |
| PHP Version | 4.3.4 |
| OS | Gentoo Linux - 2.6.3 kernel |
| Roadmaps | (Not assigned) |
Comments
[2004-03-28 11:52 UTC] kauschovar at sdk dot ath dot cx
Description:
------------
Nothing unique or specific to my setup that I can think of. I'm using PEAR::DB 1.6.1. The only change I made to php.ini is the include_path.
include_path='.:/usr/lib/php:/var/www/localhost/htdocs/_include'
And the PEAR packages are installed in /usr/lib/php.
Here's my ./configure line taken from phpinfo():
'./configure' '--prefix=/usr' '--host=i686-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--with-apxs2=/usr/sbin/apxs2' '--without-db3' '--without-db4' '--without-db2' '--without-ndbm' '--with-mcrypt=/usr' '--with-mhash=/usr' '--without-interbase' '--with-ming=/usr' '--with-swf=/usr' '--without-sybase' '--without-gdbm' '--without-fdftk' '--without-java' '--without-mcal' '--without-unixODBC' '--with-pgsql=/usr' '--with-snmp=/usr' '--enable-ucd-snmp-hack' '--with-pdflib=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-png=/usr' '--with-png-dir=/usr' '--with-jpeg=/usr' '--with-jpeg-dir=/usr' '--enable-exif' '--with-tiff=/usr' '--with-tiff-dir=/usr' '--with-mysql=/usr' '--with-mysql-sock=/var/run/mysqld/mysqld.sock' '--with-freetype-dir=/usr' '--with-ttf=/usr' '--with-t1lib=/usr' '--without-gettext' '--without-qtdom' '--without-pspell' '--with-openssl=/usr' '--with-imap=/usr' '--without-ldap' '--with-dom=/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--without-kerberos' '--with-pam' '--disable-memory-limit' '--enable-ipv6' '--without-yaz' '--with-curlwrappers' '--with-curl=/usr' '--enable-dbx' '--with-imap-ssl' '--with-zlib=/usr' '--with-zlib-dir=/usr' '--with-sablot=/usr' '--enable-xslt' '--with-xslt-sablot' '--with-xmlrpc' '--enable-wddx' '--with-xml' '--enable-mbstring=all' '--enable-mbregex' '--with-bz2=/usr' '--with-crack=/usr' '--with-cdb' '--enable-pcntl' '--enable-bcmath' '--enable-calendar' '--enable-dbase' '--enable-filepro' '--enable-ftp' '--with-mime-magic=/usr/share/misc/file/magic.mime' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvipc' '--with-iconv' '--enable-shmop' '--enable-dio' '--enable-yp' '--without-ncurses' '--without-readline' '--enable-inline-optimization' '--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--with-config-file-path=/etc/php/apache2-php4'
Reproduce code:
---------------
// $id = 1161 when the warning was triggered
// database being used is MySQL 4.0.18
/* 187: */ $newsId = $db->quoteSmart(($id > 0 ? $id : $this->m_id));
/* 188: */ $sql = "DELETE FROM News WHERE NewsID=$newsId";
/* 189: */ $res =& $db->query($sql);
/* 190: */
/* 191: */ if (DB::isError($res))
/* 192: */ // ....
Expected result:
----------------
just a silent deletion
Actual result:
--------------
deletion still ocurred, but this was output in the browser:
Warning: Problem with method call - please report this bug in /var/www/localhost/htdocs/_include/news.php on line 191
[2004-03-28 23:03 UTC] kauschovar at sdk dot ath dot cx
It was about 4am when I posted the bug report. I looked into it more today, and a print_r($res) printed a 1 (i.e., DB_OK).