Bug #13081 NDB gets incorrect result in test-ATIS
Submitted: 9 Sep 2005 7:36 Modified: 5 Oct 2005 23:53
Reporter: Stewart Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:5.0.13 OS:
Assigned to: Sergey Petrunya

[9 Sep 2005 7:36] Stewart Smith
Description:
stewart@willster:~/Documents/MySQL/mysql-bench$ perl test-ATIS --create-options="engine=ndb" --socket=/home/stewart/Documents/MySQL/5.0/main/mysql-test/var/tmp/master.sock
Testing server 'MySQL 5.0.13 beta debug log/' at 2005-09-09 17:14:26

ATIS table test

Creating tables
Time for create_table (28): 19.268 wallclock secs ( 0.01 usr  0.00 sys +  0.00 cusr  0.00 csys =  0.01 CPU)

Inserting data
Time to insert (9768): 6.859 wallclock secs ( 0.32 usr  0.09 sys +  0.00 cusr  0.00 csys =  0.41 CPU)

Retrieving data
Time for select_simple_join (5000): 60.102 wallclock secs ( 3.35 usr  0.58 sys +  0.00 cusr  0.00 csys =  3.93 CPU)
Time for select_join (1000): 85.846 wallclock secs ( 2.66 usr  0.49 sys +  0.00 cusr  0.00 csys =  3.15 CPU)
Note: Query took longer then time-limit: 600
Estimating end time based on:
937 queries in 937 loops of 1000 loops took 600.544606208801 seconds
Estimated time for select_key_prefix_join (1000): 640.923 wallclock secs (23.48 usr  4.23 sys +  0.00 cusr  0.00 csys = 27.71 CPU)
Time for select_distinct (8000): 294.074 wallclock secs ( 9.27 usr  1.28 sys + 0.00 cusr  0.00 csys = 10.55 CPU)
Warning: Query 'SELECT from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days FROM compound_class,fare WHERE compound_class.fare_class=fare.fare_class AND one_way_cost <= 825 AND one_way_cost >= 280 AND from_airport='SFO' AND to_airport='DFW' GROUP BY from_airport,to_airport,fare.fare_class,night,one_way_cost,rnd_trip_cost,class_days ORDER BY one_way_cost' returned 2 rows when it should have returned 10 rows

How to repeat:
run test-ATIS on 5.0+ (have not tested 4.1).

Suggested fix:
make it behave like myisam and return the right number of rows.
[28 Sep 2005 21:45] Martin Skold
Ran the tests on 4.1.15, no problems found. Now checking latest 5.0 build.
[29 Sep 2005 7:29] Martin Skold
Verified problem on 5.0.14.
Either ndbcluster storage engine has changed or test
[30 Sep 2005 6:20] 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/internals/30538
[30 Sep 2005 9:14] Sergey Petrunya
Approved by Pekka and Sergei
[30 Sep 2005 10:17] 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/internals/30554
[30 Sep 2005 10:25] Sergey Petrunya
Fix pushed into 5.0.14 tree 
Bug description: Queries on NDB tables that are executed using index_merge/union  or index_merge/intersection could produce wrong results.
[5 Oct 2005 23:53] Paul Dubois
Note in 5.0.14 changelog.