mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
944030aef7
away. Additional fix for bug#22331. Now Item_field prints its value in the case of the const field. mysql-test/r/varbinary.result: Corrected test case after fix for bug#22331. mysql-test/r/union.result: Corrected test case after fix for bug#22331. mysql-test/r/subselect.result: Corrected test case after fix for bug#22331. mysql-test/r/func_test.result: Corrected test case after fix for bug#22331. mysql-test/r/having.result: Corrected test case after fix for bug#22331. mysql-test/r/func_regexp.result: Corrected test case after fix for bug#22331. mysql-test/r/func_str.result: Corrected test case after fix for bug#22331. mysql-test/r/func_default.result: Corrected test case after fix for bug#22331. mysql-test/r/explain.result: Corrected test case after fix for bug#22331. sql/sql_union.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Cleanup of the SELECT_LEX::order_list list. sql/item.h: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class. sql/item.cc: Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away. Added the print() member function to the Item_field class.
23 lines
1.2 KiB
Text
23 lines
1.2 KiB
Text
drop table if exists t1,t2;
|
|
create table t1(str varchar(10) default 'def',strnull varchar(10),intg int default '10',rel double default '3.14');
|
|
insert into t1 values ('','',0,0.0);
|
|
select default(str), default(strnull), default(intg), default(rel) from t1;
|
|
default(str) default(strnull) default(intg) default(rel)
|
|
def NULL 10 3.14
|
|
explain extended select default(str), default(strnull), default(intg), default(rel) from t1;
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
|
Warnings:
|
|
Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1`
|
|
select * from t1 where str <> default(str);
|
|
str strnull intg rel
|
|
0 0
|
|
explain select * from t1 where str <> default(str);
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
|
1 SIMPLE t1 system NULL NULL NULL NULL 1
|
|
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;
|