Bug #38466 maria: range query returns no data
Submitted: 30 Jul 2008 16:51 Modified: 9 Jan 2009 14:57
Reporter: Alexey Stroganov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Maria storage engine Severity:S2 (Serious)
Version:6.0.6-alpha, 6.0.7pre OS:Any
Assigned to: Sergei Golubchik CPU Architecture:Any

[30 Jul 2008 16:51] Alexey Stroganov
Description:
Following range queries returns no data:

mysql> select count(dummy1) from bench1 where id>=85600;
+---------------+
| count(dummy1) |
+---------------+
|             0 |
+---------------+
1 row in set (0.00 sec)

mysql> select count(dummy1) from bench1 where id>=85600 and id <= 86000;
+---------------+
| count(dummy1) |
+---------------+
|             0 |
+---------------+
1 row in set (0.00 sec)

but:
mysql> select count(dummy1) from bench1 where id=85600;
+---------------+
| count(dummy1) |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

mysql> select count(dummy1) from bench1 where id=85610;
+---------------+
| count(dummy1) |
+---------------+
|             1 |
+---------------+
1 row in set (0.00 sec)

How to repeat:
1. start server 
2. run attached test case
perl bug-maria-range.pl  --db-socket=/tmp/mysql.sock --db-engine=maria

It will populate db and expose a problem.

Later you can use --skip-insert option to run select queries only
[30 Jul 2008 16:52] Alexey Stroganov
Test case for the issue

Attachment: bug-maria-range.pl (application/octet-stream, text), 1.83 KiB.

[14 Sep 2008 0:13] Bugs System
Pushed into 6.0.6-alpha  (revid:serg@mysql.com-20080816094928-3sfsbf2bhpzk6d91) (version source revid:lars-erik.bjork@sun.com-20080717135217-z3zlwwy465hmc20e) (pib:3)
[9 Jan 2009 14:57] MC Brown
A note has been added to the 6.0.6 changelog: 

Range queries on a Maria table could fail to return the correct rows.