Bug #23962 Wrong results with > search
Submitted: 3 Nov 2006 20:42 Modified: 8 Nov 2006 8:51
Reporter: Kevin Lewis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Falcon storage engine Severity:S2 (Serious)
Version:5.2 OS:Any
Assigned to: Kevin Lewis CPU Architecture:Any

[3 Nov 2006 20:42] Kevin Lewis
Description:
Falcon returns the wrong results for char and varchar fields when the search string is a substring of what is in the column.

How to repeat:
CREATE TABLE t1 (c1 char(5));
ALTER TABLE t1 ADD INDEX(c1);
INSERT into t1 values ('a'),('aa'),('aaa'),('abc'),('bbb');
SELECT * FROM t1 WHERE c1 > 'aa';
+------+
| c1   |
+------+
| bbb  |
+------+
[3 Nov 2006 20:47] Kevin Lewis
Actually, the test results are like this;
mysql> select * from t2 where c1 > 'aa';
+------+
| c1   |
+------+
| abc  |
| bbb  |
+------+
2 rows in set (0.00 sec)
mysql> select * from t2 where c1 > 'a';
+------+
| c1   |
+------+
| bbb  |
+------+
1 row in set (0.00 sec)
Both querys are missing results.
[5 Nov 2006 16:43] Hakan Küçükyılmaz
Verified on Linux 32-bit, change set 1.2347.1.19, 2006-11-04.

Added test case falcon_bug_23962.test.

Regards, Hakan
[8 Nov 2006 5:15] Kevin Lewis
Changes pushed that allow searches "> 'aa'" to return 'aaa' without messing up "like 'aa%'".
[8 Nov 2006 8:51] Hakan Küçükyılmaz
Works now on Linux 32-bit and Linux 64-bit, change set 1.2367, 2006-11-07.

Test(s) which will be run though they are marked as disabled:
  falcon_bug_23962     : Bug#23962 2006-11-05 hakank Currently failing

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

falcon_bug_23962               [ pass ]            470
-------------------------------------------------------
Stopping All Servers
Shutting-down Instance Manager
All 1 tests were successful.
The servers were restarted 0 times
Spent 0.47 seconds actually executing testcases

Regards, Hakan
[20 Feb 2009 12:14] 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/67023

3031 lars-erik.bjork@sun.com	2009-02-20
      Follow-up commit to the patch for bug#23962 including the test files for the patch
[2 Mar 2009 14:13] Bugs System
Pushed into 6.0.11-alpha (revid:alik@sun.com-20090302140208-lfdejjbcyezlhhjt) (version source revid:vvaintroub@mysql.com-20090223172157-jllfd81jwvak4n5j) (merge vers: 6.0.11-alpha) (pib:6)