Bug #373 'Unknown error' with UPDATE and LIMIT
Submitted: 5 May 2003 15:17 Modified: 13 May 2003 9:58
Reporter: jocelyn fournier (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:4.0.13 OS:
Assigned to: CPU Architecture:Any

[5 May 2003 15:17] jocelyn fournier
Description:
When performing an UPDATE matching rows using LIMIT, MySQL displays an 'unknown error'.

How to repeat:
CREATE TABLE `options` (
   `id_param` smallint(3) unsigned NOT NULL default '0',
   `nom_option` char(40) NOT NULL default '',
   `valid` tinyint(1) NOT NULL default '0',
   KEY `id_param` (`id_param`,`nom_option`)
 ) TYPE=MyISAM;

INSERT INTO options (id_param,nom_option,valid) VALUES (185,'600x1200',1);

UPDATE options SET nom_option='test' WHERE id_param=185 AND nom_option='600x1200' AND valid=1 LIMIT 1;
ERROR 1105: Unknown error

However :

UPDATE options SET nom_option='test' WHERE id_param=185 AND nom_option='600x1200' AND valid=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
[13 May 2003 9:58] Michael Widenius
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html