Bug #53651 [Asn->Csd]: Under mysqlnd, mysqli_affected_rows() returns 0
| From: | marc at phpmyadmin dot net | Date: | Wed, 05 Jan 2011 12:59:51 +0000 |
| Subject: | Bug #53651 [Asn->Csd]: Under mysqlnd, mysqli_affected_rows() returns 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157611@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53651&edit=1
ID: 53651
User updated by: marc at phpmyadmin dot net
Reported by: marc at phpmyadmin dot net
Summary: Under mysqlnd, mysqli_affected_rows() returns 0
-Status: Assigned
+Status: Closed
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 5.3.4
Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
Sorry for the disturbance.
Previous Comments:
------------------------------------------------------------------------
[2011-01-05 13:34:49] uw@php.net
No, neither adding PDO nor the moon phase can impact it.
------------------------------------------------------------------------
[2011-01-05 12:28:57] marc at phpmyadmin dot net
Andrey,
I had a permission problem at MySQL level that produced the "0" output.
Now I can no longer reproduce the problem with the test script, but I
still have this problem in phpMyAdmin. I'll try to come up with a new
test script.
------------------------------------------------------------------------
[2011-01-05 12:08:52] andrey@php.net
Can you post output from the script with freshly created table and
freshly inserted row. Please, run the script twice. Thanks!
------------------------------------------------------------------------
[2011-01-05 12:00:16] marc at phpmyadmin dot net
Hi Andrey,
here is my configuration, maybe the presence of PDO has an impact?
./configure --with-apxs2=/usr/local/apache2/bin/apxs \
--with-libdir=lib64 \
--disable-debug \
--enable-calendar \
--with-gd=shared \
--with-freetype-dir \
--with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-regex=php \
--with-png-dir=/usr/lib \
--with-zlib=shared \
--with-iconv=shared \
--enable-ftp \
--with-mcrypt=shared \
--with-bz2=shared \
--enable-zip \
--with-jpeg-dir=/usr/lib \
--enable-mbstring \
--without-sqlite \
--enable-dom \
--enable-json \
--enable-pdo=shared \
--with-pdo-mysql=shared,mysqlnd \
--without-pdo-sqlite \
--with-pear \
--enable-spl \
--enable-bcmath \
--with-curl=shared \
--with-ldap=shared,/usr \
--with-gettext=shared \
--with-snmp=shared \
--enable-sockets
------------------------------------------------------------------------
[2011-01-05 10:31:08] andrey@php.net
I can't reproduce it. Maybe it's bogus due to something else. Here are
my results :
myslqnd + MySQL 5.5.8 (executed twice in a row)
andrey@poohie:/work/vanilla/php/php-src/branches/PHP_5_3$ ./php b.php
Affected rows (UPDATE): 1
andrey@poohie:/work/vanilla/php/php-src/branches/PHP_5_3$ ./php b.php
Affected rows (UPDATE): 0
myslqnd + MySQL 5.1-dev (executed twice in a row)
andrey@poohie:/work/vanilla/php/php-src/branches/PHP_5_3$ ./php b.php
Affected rows (UPDATE): 1
andrey@poohie:/work/vanilla/php/php-src/branches/PHP_5_3$ ./php b.php
Affected rows (UPDATE): 0
As you see, the second time the result is 0. Why? It is a feature or
gotcha of MySQL. If the row doesn't change affected_rows is 0. And the
row doesn't change from toto to toto there is no change, thus the row is
left intact.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=53651
--
Edit this bug report at http://bugs.php.net/bug.php?id=53651&edit=1