mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912) ALTER TABLE now fails in STRICT mode if it generates warnings. Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
This commit is contained in:
@@ -44,21 +44,26 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using filesort
|
||||
Warnings:
|
||||
Note 1003 select if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where (`test`.`t1`.`st` like _latin1'%a%') order by if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary))
|
||||
select nullif(u=0, 'test') from t1;
|
||||
nullif(u=0, 'test')
|
||||
select nullif(u, 1) from t1;
|
||||
nullif(u, 1)
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
1
|
||||
1
|
||||
explain extended select nullif(u=0, 'test') from t1;
|
||||
0
|
||||
0
|
||||
explain extended select nullif(u, 1) from t1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7
|
||||
Warnings:
|
||||
Note 1003 select nullif((`test`.`t1`.`u` = 0),_latin1'test') AS `nullif(u=0, 'test')` from `test`.`t1`
|
||||
Note 1003 select nullif(`test`.`t1`.`u`,1) AS `nullif(u, 1)` from `test`.`t1`
|
||||
drop table t1;
|
||||
select nullif(1,'test');
|
||||
nullif(1,'test')
|
||||
1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'test'
|
||||
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
|
||||
NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
|
||||
NULL NULL NULL NULL
|
||||
|
Reference in New Issue
Block a user