mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
new test
This commit is contained in:
18
mysql-test/r/func_default.result
Normal file
18
mysql-test/r/func_default.result
Normal file
@ -0,0 +1,18 @@
|
||||
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 high_priority default(test.t1.str) AS `default(str)`,default(test.t1.strnull) AS `default(strnull)`,default(test.t1.intg) AS `default(intg)`,default(test.t1.rel) 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;
|
19
mysql-test/t/func_default.test
Normal file
19
mysql-test/t/func_default.test
Normal file
@ -0,0 +1,19 @@
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
--enable_warnings
|
||||
|
||||
|
||||
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;
|
||||
explain extended select default(str), default(strnull), default(intg), default(rel) from t1;
|
||||
select * from t1 where str <> default(str);
|
||||
explain select * from t1 where str <> default(str);
|
||||
|
||||
#TODO: uncomment when bug will be fixed
|
||||
#create table t2 select default(str), default(strnull), default(intg), default(rel) from t1;
|
||||
#show create table from t1;
|
||||
#insert into t2 select select default(str), default(strnull), default(intg), default(rel) from t1;
|
||||
|
||||
drop table t1;
|
Reference in New Issue
Block a user