summaryrefslogtreecommitdiff
path: root/mysql-test/t/order_by.test
diff options
context:
space:
mode:
authorunknown <timour@mysql.com>2005-01-06 10:49:26 +0200
committerunknown <timour@mysql.com>2005-01-06 10:49:26 +0200
commitd96b59f5e08e54275079e70e9b4d09e5029981a0 (patch)
treef4d39c8ba71ef4ea329006b635a4f77910cd67e4 /mysql-test/t/order_by.test
parenta2d253d676300559bdd582fddda6c3a41ff21eba (diff)
downloadmariadb-git-d96b59f5e08e54275079e70e9b4d09e5029981a0.tar.gz
Fix for BUG#7331.
The problem was that when a QUICK_SELECT access method is chosen, test_if_skip_sort_order() discovered that the index being used by the quick select will not deliver tuples in sorted order. In this case test_if_skip_sort_order() tried to change the index used by the quick select, but it didn't properly set the other members of the quick select, and especially the range flags of the ranges in QUICK_SELECT::ranges. The fix re-invokes the function SQL_SELECT::test_quick_select to correctly create a valid QUICK_SELECT object. mysql-test/r/order_by.result: Added test results. mysql-test/t/order_by.test: Added test for BUG#7331. sql/sql_select.cc: Fix for BUG#7331.
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r--mysql-test/t/order_by.test34
1 files changed, 34 insertions, 0 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 988c106bf21..ab5e93603e4 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -500,3 +500,37 @@ insert into t1 set a = concat(repeat('x', 19), 'aa');
set max_sort_length=20;
select a from t1 order by a;
drop table t1;
+
+#
+# Bug #7331
+#
+
+create table t1 (
+ `sid` decimal(8,0) default null,
+ `wnid` varchar(11) not null default '',
+ key `wnid14` (`wnid`(4)),
+ key `wnid` (`wnid`)
+) engine=myisam default charset=latin1;
+
+insert into t1 (`sid`, `wnid`) values
+('10100','01019000000'),('37986','01019000000'),('37987','01019010000'),
+('39560','01019090000'),('37989','01019000000'),('37990','01019011000'),
+('37991','01019011000'),('37992','01019019000'),('37993','01019030000'),
+('37994','01019090000'),('475','02070000000'),('25253','02071100000'),
+('25255','02071100000'),('25256','02071110000'),('25258','02071130000'),
+('25259','02071190000'),('25260','02071200000'),('25261','02071210000'),
+('25262','02071290000'),('25263','02071300000'),('25264','02071310000'),
+('25265','02071310000'),('25266','02071320000'),('25267','02071320000'),
+('25269','02071330000'),('25270','02071340000'),('25271','02071350000'),
+('25272','02071360000'),('25273','02071370000'),('25281','02071391000'),
+('25282','02071391000'),('25283','02071399000'),('25284','02071400000'),
+('25285','02071410000'),('25286','02071410000'),('25287','02071420000'),
+('25288','02071420000'),('25291','02071430000'),('25290','02071440000'),
+('25292','02071450000'),('25293','02071460000'),('25294','02071470000'),
+('25295','02071491000'),('25296','02071491000'),('25297','02071499000');
+
+explain select * from t1 where wnid like '0101%' order by wnid;
+
+select * from t1 where wnid like '0101%' order by wnid;
+
+drop table t1;