From: corinl at gmx dot de
Operating system: debian 686
PHP version: 5.2.2
PHP Bug Type: MySQLi related
Bug description: affected_rows wrong
Description:
------------
executing the following code using direct php (with mysqli) or using
phpmyadmin using the mysqli extension returns 2 affected rows. running it
with php or phpmyadmin using mysql extension, returns 0 affected rows
(which is correct!).
using mysql 5.0.41 server and 5.0.38 client libraries.
Reproduce code:
---------------
CREATE TABLE `user_infos` (
`user_id` int(10) unsigned NOT NULL,
`mails` tinyint(4) NOT NULL,
`mails_trigger` enum('0','1') collate latin1_german1_ci NOT NULL,
`book` enum('0','1') collate latin1_german1_ci NOT NULL,
`gtag` tinyint(4) NOT NULL,
`foto_comment` enum('0','1') collate latin1_german1_ci NOT NULL,
`buchung` enum('0','1') collate latin1_german1_ci NOT NULL,
`blog_comment` enum('0','1') collate latin1_german1_ci NOT NULL,
`i_mail` tinyint(4) NOT NULL,
`i_buddy` tinyint(4) NOT NULL,
`i_tele` tinyint(3) unsigned NOT NULL,
`i_lchat` tinyint(3) unsigned NOT NULL,
`i_close` enum('0','1') collate latin1_german1_ci NOT NULL,
`max_fotoalben` tinyint(3) unsigned NOT NULL,
`max_fotoalben_fotos` int(10) unsigned NOT NULL,
`events` enum('0','1') collate latin1_german1_ci NOT NULL,
`contacts_look` enum('text','images') collate latin1_german1_ci NOT
NULL default 'images',
PRIMARY KEY (`user_id`),
KEY `trigger_mails` (`mails_trigger`,`mails`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci;
INSERT IGNORE INTO user_infos SET
user_id=1,mails=1,book='1',gtag=1,foto_comment='0',blog_comment='1',buchung='1',i_mail=4,i_buddy=11,i_tele=5,i_lchat=10,i_close='0',events='1';
Expected result:
----------------
affected_rows = 1 (first insert)
0 in the following inserts
Actual result:
--------------
always 2
--
Edit bug report at http://bugs.php.net/?id=41400&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41400&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41400&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41400&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41400&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41400&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41400&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41400&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41400&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41400&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41400&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41400&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41400&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41400&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41400&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41400&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41400&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41400&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41400&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41400&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41400&r=mysqlcfg