summaryrefslogtreecommitdiff
path: root/mysql-test/r/explain.result
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-26 17:40:01 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-02-26 17:40:01 +0400
commitca6691533a7e2a454bbb614583a0058bf7acd2d2 (patch)
treef0ae736e5674de5566766cbec76784fcfad888f9 /mysql-test/r/explain.result
parentfe229e33f7fdde3c5afe1c78522626562fcb4941 (diff)
downloadmariadb-git-ca6691533a7e2a454bbb614583a0058bf7acd2d2.tar.gz
Bug#47669 Query showed by EXPLAIN EXTENDED gives different result from original query
Item_field::print method does not take into account fields whose values may be null. The fix is to print 'NULL' if field value is null. mysql-test/r/explain.result: test case mysql-test/r/func_str.result: result fix mysql-test/r/having.result: result fix mysql-test/r/select.result: result fix mysql-test/r/subselect.result: result fix mysql-test/r/union.result: result fix mysql-test/t/explain.test: test case sql/item.cc: print 'NULL' if field value is null.
Diffstat (limited to 'mysql-test/r/explain.result')
-rw-r--r--mysql-test/r/explain.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 5a1bf1a1290..2bf85e35139 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -210,4 +210,19 @@ Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP colum
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
+#
+# Bug#47669: Query showed by EXPLAIN EXTENDED gives different result from original query
+#
+CREATE TABLE t1 (c int);
+INSERT INTO t1 VALUES (NULL);
+CREATE TABLE t2 (d int);
+INSERT INTO t2 VALUES (NULL), (0);
+EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) FROM t1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
+Note 1003 select (select 1 AS `1` from `test`.`t2` where (`test`.`t2`.`d` = NULL)) AS `(SELECT 1 FROM t2 WHERE d = c)` from `test`.`t1`
+DROP TABLE t1, t2;
End of 5.1 tests.