diff options
author | Mattias Jonsson <mattias.jonsson@sun.com> | 2008-11-05 15:53:28 +0100 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@sun.com> | 2008-11-05 15:53:28 +0100 |
commit | bcd88c9f9e617c4a9c426cbd0902f93a486e6b81 (patch) | |
tree | 61c7646440805b1cc1792e0257e611e61c371156 /mysql-test/r | |
parent | c780c2a24ce4077c6fdf12c1af14d825fefa8a51 (diff) | |
download | mariadb-git-bcd88c9f9e617c4a9c426cbd0902f93a486e6b81.tar.gz |
Bug#40494: MYSQL server crashes on range access with partitioning and
order by
Problem was that the first index read was unordered,
and the next was ordered, resulting in use of
uninitialized data.
Solution was to use the correct variable to see if
the 'next' call should be ordered or not.
mysql-test/r/partition.result:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Added test case for the bug.
mysql-test/t/partition.test:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Added test case for the bug.
sql/ha_partition.cc:
Bug#40494: MYSQL server crashes on range access with
partitioning and order by
Used the wrong variable to decide to continue with
ordered or unordered scan.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/partition.result | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index e76c874324e..289a24685ff 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,4 +1,78 @@ drop table if exists t1, t2; +CREATE TABLE t1 (a INT NOT NULL, KEY(a)) +PARTITION BY RANGE(a) +(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE); +INSERT INTO t1 VALUES (2), (40), (40), (70), (60), (90), (199); +SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a ASC; +a +60 +70 +90 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 95; +a +60 +70 +90 +INSERT INTO t1 VALUES (200), (250), (210); +SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a ASC; +a +60 +70 +90 +199 +200 +210 +SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a ASC; +a +200 +210 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 95 ORDER BY a DESC; +a +90 +70 +60 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 220 ORDER BY a DESC; +a +210 +200 +199 +90 +70 +60 +SELECT a FROM t1 WHERE a BETWEEN 200 AND 220 ORDER BY a DESC; +a +210 +200 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 220; +a +199 +200 +210 +60 +70 +90 +SELECT a FROM t1 WHERE a BETWEEN 200 AND 220; +a +200 +210 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 95; +a +60 +70 +90 +SELECT a FROM t1 WHERE a BETWEEN 60 AND 220; +a +199 +200 +210 +60 +70 +90 +SELECT a FROM t1 WHERE a BETWEEN 200 AND 220; +a +200 +210 +DROP TABLE t1; CREATE TABLE t1 ( a INT NOT NULL, b MEDIUMINT NOT NULL, |