Commit 0dce6464 authored by hf@deer.(none)'s avatar hf@deer.(none)

Addition to fix for bug #11314 (test case wasn't complete)

parent e4ba9388
...@@ -16,3 +16,8 @@ explain select * from t1 where str <> default(str); ...@@ -16,3 +16,8 @@ explain select * from t1 where str <> default(str);
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 1 SIMPLE t1 system NULL NULL NULL NULL 1
drop table t1; drop table t1;
CREATE TABLE t1 (id int(11), s varchar(20));
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
ERROR HY000: Field 'mi' doesn't have a default value
DROP TABLE t1;
...@@ -21,8 +21,9 @@ drop table t1; ...@@ -21,8 +21,9 @@ drop table t1;
# #
# Bug #11314 (HAVING DEFAULT() hangs) # Bug #11314 (HAVING DEFAULT() hangs)
# #
CREATE TABLE t1 (s varchar(20), id int(11)); CREATE TABLE t1 (id int(11), s varchar(20));
INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three'); INSERT INTO t1 VALUES (1, 'one'), (2, 'two'), (3, 'three');
--error 1364
SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL; SELECT s, 32 AS mi FROM t1 GROUP BY s HAVING DEFAULT(mi) IS NULL;
DROP TABLE t1; DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment