[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql-bugs
Subject: Bug in 'duplicates' with INSERT DELAYED IGNORE in MySQL 4.0.2 ?
From: Michael Widenius <monty () mysql ! com>
Date: 2002-06-04 8:45:58
[Download RAW message or body]
Hi!
>>>>> "Jocelyn" == Jocelyn Fournier <joc@presence-pc.com> writes:
Jocelyn> Hi,
Jocelyn> I think I hit a small bug with INSERT DELAYED IGNORE syntax.
Jocelyn> How-to-repeat :
Jocelyn> CREATE TABLE `searchmainhardwarefr7` (
Jocelyn> `mot` char(30) NOT NULL default '',
Jocelyn> `numreponse` int(10) unsigned NOT NULL default '0',
Jocelyn> PRIMARY KEY (`mot`,`numreponse`),
Jocelyn> KEY `numreponse` (`numreponse`)
Jocelyn> ) TYPE=MyISAM ROW_FORMAT=FIXED
mysql> INSERT DELAYED IGNORE INTO searchmainhardwarefr7 (mot, numreponse)
Jocelyn> VALUES ('ceci',3825004),('est',3825004),('un',3825004),('test',3825004);
Jocelyn> Query OK, 4 rows affected (0.02 sec)
Jocelyn> Records: 0 Duplicates: -4 Warnings: 0
Jocelyn> I assume the Duplicates: -4 is a bug ?
Jocelyn> (although IGNORE is not needed as DELAYED doesn't check duplicated entry)
Here is a patch for this (will be in 3.23.52 and 4.0.2):
===== sql/sql_insert.cc 1.46 vs edited =====
*** /tmp/sql_insert.cc-1.46-4006 Tue Nov 27 02:50:20 2001
--- edited/sql/sql_insert.cc Tue Jun 4 09:05:56 2002
***************
*** 299,305 ****
{
char buff[160];
if (duplic == DUP_IGNORE)
! sprintf(buff,ER(ER_INSERT_INFO),info.records,info.records-info.copied,
thd->cuted_fields);
else
sprintf(buff,ER(ER_INSERT_INFO),info.records,info.deleted,
--- 299,307 ----
{
char buff[160];
if (duplic == DUP_IGNORE)
! sprintf(buff,ER(ER_INSERT_INFO),info.records,
! (lock_type == TL_WRITE_DELAYED) ? 0 :
! info.records-info.copied,
thd->cuted_fields);
else
sprintf(buff,ER(ER_INSERT_INFO),info.records,info.deleted,
Regards,
Monty
--
For technical support contracts, goto https://order.mysql.com/
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Michael Widenius <monty@mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, CTO
/_/ /_/\_, /___/\___\_\___/ Helsinki, Finland
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail bugs-thread12075@lists.mysql.com
To unsubscribe, e-mail <bugs-unsubscribe@lists.mysql.com>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic