summaryrefslogtreecommitdiff
path: root/mysql-test/t/order_by.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-11-10 10:58:43 +0200
committerGeorgi Kodinov <joro@sun.com>2009-11-10 10:58:43 +0200
commit0daad8022816c86f88e61e45b9f2f7da39fe3281 (patch)
tree08c5edee40eec0896e54d296f923d394e90dd774 /mysql-test/t/order_by.test
parent8369f619d446dcf6a4e94ce98ff8e85792491ea2 (diff)
parentddd90017e75cf1241da12cdc3fd55b44da0c4a9d (diff)
downloadmariadb-git-0daad8022816c86f88e61e45b9f2f7da39fe3281.tar.gz
merge
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r--mysql-test/t/order_by.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index ac2bbaaeeac..0b42caa8703 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -867,6 +867,31 @@ SELECT
DROP TABLE t1, t2, t3;
+--echo #
+--echo # Bug #42760: Select doesn't return desired results when we have null
+--echo # values
+--echo #
+
+CREATE TABLE t1 (
+ a INT,
+ c INT,
+ UNIQUE KEY a_c (a,c),
+ KEY (a));
+
+INSERT INTO t1 VALUES (1, 10), (2, NULL);
+
+--echo # Must use ref-or-null on the a_c index
+EXPLAIN
+SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
+--echo # Must return 1 row
+SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
+
+DROP TABLE t1;
+
+
+--echo End of 5.0 tests
+
+
#
# Bug #35206: select query result different if the key is indexed or not
#