mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
a76b8f9a1d
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.
51 lines
1.6 KiB
SQL
51 lines
1.6 KiB
SQL
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a = NULL;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a <> NULL;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a > NULL;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a < NULL;
|
|
|
|
if (!$skip_null_safe_test)
|
|
{
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a <=> NULL;
|
|
}
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND 10;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN NULL AND NULL;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a BETWEEN 10 AND NULL;
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
|
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
|
|
|
|
--replace_column 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x
|
|
EXPLAIN
|
|
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|
|
SELECT MIN( a ) FROM t1 WHERE a IS NULL;
|