summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition_order.result
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-07-15 03:38:34 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-07-15 03:38:34 -0400
commitdd7290571674e26cdd5f1be5304d15291517d6fa (patch)
treeede5cd0e0f036a508ee80dc255e3d3b8c7518a0c /mysql-test/r/partition_order.result
parent16c54768ba01d9138043ffa8b426b5d3bd14931b (diff)
downloadmariadb-git-dd7290571674e26cdd5f1be5304d15291517d6fa.tar.gz
BUG#20389: Crash when using index scan in reverse order
mysql-test/r/partition_order.result: Changed a test case to handle ordered index scan reverse order as well mysql-test/t/partition_order.test: Changed a test case to handle ordered index scan reverse order as well sql/ha_myisam.cc: More debug info sql/ha_partition.cc: Introduced partition_index_read_last to ensure we use index_read_last in those cases towards underlying handler. Ensured that index_read with HA_READ_PREFIX_LAST, HA_READ_PREFIX_LAST_OR_PREV and HA_READ_BEFORE_KEY uses ordered index scan in reverse order. sql/ha_partition.h: Introduced partition_index_read_last to ensure we use index_read_last in those cases towards underlying handler. Ensured that index_read with HA_READ_PREFIX_LAST, HA_READ_PREFIX_LAST_OR_PREV and HA_READ_BEFORE_KEY uses ordered index scan in reverse order.
Diffstat (limited to 'mysql-test/r/partition_order.result')
-rw-r--r--mysql-test/r/partition_order.result56
1 files changed, 54 insertions, 2 deletions
diff --git a/mysql-test/r/partition_order.result b/mysql-test/r/partition_order.result
index 7a1ab1d6dc8..78ff7cd3121 100644
--- a/mysql-test/r/partition_order.result
+++ b/mysql-test/r/partition_order.result
@@ -718,7 +718,11 @@ partitions 2
partition x2 values less than (100));
INSERT into t1 values (1, 1);
INSERT into t1 values (5, NULL);
-INSERT into t1 values (2, 5);
+INSERT into t1 values (2, 4);
+INSERT into t1 values (3, 3);
+INSERT into t1 values (4, 5);
+INSERT into t1 values (7, 1);
+INSERT into t1 values (6, 6);
INSERT into t1 values (30, 4);
INSERT into t1 values (35, 2);
INSERT into t1 values (40, NULL);
@@ -727,7 +731,55 @@ a b
5 NULL
40 NULL
1 1
+7 1
35 2
+3 3
+2 4
30 4
-2 5
+4 5
+6 6
+select * from t1 force index (b) where b < 10 ORDER BY b;
+a b
+1 1
+7 1
+35 2
+3 3
+2 4
+30 4
+4 5
+6 6
+select * from t1 force index (b) where b < 10 ORDER BY b DESC;
+a b
+6 6
+4 5
+2 4
+30 4
+3 3
+35 2
+7 1
+1 1
+drop table t1;
+create table t1 (a int not null, b int, c varchar(20), key (a,b,c))
+partition by range (b)
+(partition p0 values less than (5),
+partition p1 values less than (10));
+INSERT into t1 values (1,1,'1'),(2,2,'2'),(1,3,'3'),(2,4,'4'),(1,5,'5');
+INSERT into t1 values (2,6,'6'),(1,7,'7'),(2,8,'8'),(1,9,'9');
+INSERT into t1 values (1, NULL, NULL), (2, NULL, '10');
+select * from t1 where a = 1 order by a desc, b desc;
+a b c
+1 9 9
+1 7 7
+1 5 5
+1 3 3
+1 1 1
+1 NULL NULL
+select * from t1 where a = 1 order by b desc;
+a b c
+1 9 9
+1 7 7
+1 5 5
+1 3 3
+1 1 1
+1 NULL NULL
drop table t1;