Bug #24342 | Incorrect results with query over MERGE table | ||
---|---|---|---|
Submitted: | 15 Nov 2006 18:32 | Modified: | 1 May 2007 17:58 |
Reporter: | Razvan Surdulescu | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.27, 5.1 | OS: | Linux (Linux RedHat) |
Assigned to: | Sergey Vojtovich | CPU Architecture: | Any |
Tags: | regression |
[15 Nov 2006 18:32]
Razvan Surdulescu
[15 Nov 2006 18:36]
Razvan Surdulescu
This appears to be a related bug: http://bugs.mysql.com/bug.php?id=9112
[16 Nov 2006 17:10]
Dean Ellis
Verified against 5.0 and 5.1 (current dev trees). I could not repeat it against 4.0 or 4.1. I simplified your test case, but thank you for submitting a very thorough case. FLUSH TABLES; DROP TABLE IF EXISTS t1, t2, t3, t4; CREATE TABLE t1 ( a VARCHAR(255), b INT, INDEX (a,b) ) ENGINE=MyISAM; CREATE TABLE t2 LIKE t1; CREATE TABLE t3 LIKE t2; CREATE TABLE t4 ( a VARCHAR(255), b INT, INDEX (a,b) ) ENGINE=MERGE UNION=(t1,t2,t3); INSERT INTO t1 VALUES ('abcd ',1); INSERT INTO t1 VALUES ('abcd',1); INSERT INTO t2 VALUES ('abcd ',2); INSERT INTO t2 VALUES ('abcd',2); INSERT INTO t2 SELECT * FROM t2; INSERT INTO t3 VALUES ('abcd ',3); INSERT INTO t3 VALUES ('abcd',3); INSERT INTO t3 SELECT * FROM t3; -- 2, correct SELECT COUNT(*) x FROM t1 WHERE a = 'abcd' AND b = 1; -- 2, correct SELECT COUNT(*) x FROM t4 WHERE a = 'abcd' AND b = 1; -- 4, correct SELECT COUNT(*) x FROM t2 WHERE a = 'abcd' AND b = 2; -- 1, incorrect SELECT COUNT(*) x FROM t4 WHERE a = 'abcd' AND b = 2; -- 4, correct SELECT COUNT(*) x FROM t3 WHERE a = 'abcd' AND b = 3; -- 1, incorrect SELECT COUNT(*) x FROM t4 WHERE a = 'abcd' AND b = 3; -- 2, incorrect SELECT COUNT(*) FROM t4 WHERE a = 'abcd' AND b > 1;
[11 Dec 2006 23:28]
Razvan Surdulescu
Hello, I noticed there hasn't been any activity on this bug report for about a month. This bug is causing us a lot of headaches, is there a plan to release a fix for it in an upcoming release? Thanks, Razvan.
[5 Jan 2007 22:50]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/17687 ChangeSet@1.2358, 2007-01-05 14:50:19-08:00, acurtis@xiphis.org +3 -0 Bug#24342 "Incorrect results with query over MERGE table" mi_rnext_same uses wrong value when checking keys
[10 Apr 2007 16:45]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/24196 ChangeSet@1.2630, 2007-04-11 01:40:35+05:00, svoj@mysql.com +5 -0 BUG#24342 - Incorrect results with query over MERGE table MERGE engine may return incorrect values when several representations of equal keys are present in the index. For example "groß" and "gross" or "gross" and "gross " (trailing space), which are considered equal, but have different lengths. The problem was that key length was not recalculated after key lookup. Only MERGE engine is affected.
[27 Apr 2007 9:21]
Bugs System
Pushed into 5.1.18-beta
[27 Apr 2007 9:23]
Bugs System
Pushed into 5.0.42
[27 Apr 2007 9:25]
Bugs System
Pushed into 4.1.23
[1 May 2007 17:58]
Paul DuBois
Noted in 4.1.23, 5.0.42, 5.1.18 changelogs.