Skip to content

Commit d03133d

Browse files
author
Martin Hansson
committed
Post-push fix to disable a subset of the test case for Bug#47762.
This has been back-ported from 6.0 as the problems proved to afflict 5.1 as well. The fix exposed two new bugs. They were reported as follows. Bug no 52174: Sometimes wrong plan when reading a MAX value from non-NULL index Bug no 52173: Reading NULL value from non-NULL index gives wrong result in embedded server Both bugs taken together affect a much smaller class of queries than #47762, so the fix stays for now.
1 parent 879b705 commit d03133d

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

mysql-test/include/min_null_cond.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ EXPLAIN
1818
SELECT MIN( a ) FROM t1 WHERE a < NULL;
1919
SELECT MIN( a ) FROM t1 WHERE a < NULL;
2020

21+
if (!$skip_null_safe_test)
22+
{
2123
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
2224
EXPLAIN
2325
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2426
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
25-
27+
}
2628
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
2729
EXPLAIN
2830
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;

mysql-test/r/group_min_max.result

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,6 +2691,17 @@ DROP TABLE t1;
26912691
## Test for NOT NULLs
26922692
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY);
26932693
INSERT INTO t1 VALUES (1), (2), (3);
2694+
#
2695+
# NULL-safe operator test disabled for non-NULL indexed columns.
2696+
#
2697+
# See bugs
2698+
#
2699+
# - Bug#52173: Reading NULL value from non-NULL index gives
2700+
# wrong result in embedded server
2701+
#
2702+
# - Bug#52174: Sometimes wrong plan when reading a MAX value from
2703+
# non-NULL index
2704+
#
26942705
EXPLAIN
26952706
SELECT MIN( a ) FROM t1 WHERE a = NULL;
26962707
id select_type table type possible_keys key key_len ref rows Extra
@@ -2720,13 +2731,6 @@ SELECT MIN( a ) FROM t1 WHERE a < NULL;
27202731
MIN( a )
27212732
NULL
27222733
EXPLAIN
2723-
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2724-
id select_type table type possible_keys key key_len ref rows Extra
2725-
x x x x x x x x x No matching min/max row
2726-
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
2727-
MIN( a )
2728-
NULL
2729-
EXPLAIN
27302734
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
27312735
id select_type table type possible_keys key key_len ref rows Extra
27322736
x x x x x x x x x Impossible WHERE noticed after reading const tables

mysql-test/t/group_min_max.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,18 @@ DROP TABLE t1;
10701070
--echo ## Test for NOT NULLs
10711071
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY);
10721072
INSERT INTO t1 VALUES (1), (2), (3);
1073+
--echo #
1074+
--echo # NULL-safe operator test disabled for non-NULL indexed columns.
1075+
--echo #
1076+
--echo # See bugs
1077+
--echo #
1078+
--echo # - Bug#52173: Reading NULL value from non-NULL index gives
1079+
--echo # wrong result in embedded server
1080+
--echo #
1081+
--echo # - Bug#52174: Sometimes wrong plan when reading a MAX value from
1082+
--echo # non-NULL index
1083+
--echo #
1084+
--let $skip_null_safe_test= 1
10731085
--source include/min_null_cond.inc
10741086
DROP TABLE t1;
10751087

0 commit comments

Comments
 (0)