diff options
Diffstat (limited to 'mysql-test/r/null.result')
-rw-r--r-- | mysql-test/r/null.result | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 4d90aac0e68..daedfa50b80 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -88,7 +88,7 @@ b ifnull(t2.b,"this is null") NULL this is null NULL this is null drop table t1; -CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL); +CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; Warnings: Warning 1265 Data truncated for column 'd' at row 1 @@ -97,39 +97,39 @@ Warnings: Warning 1265 Data truncated for column 'd' at row 1 UPDATE t1 SET d=NULL; Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 1 INSERT INTO t1 (a) values (null); ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (1/null); ERROR 23000: Column 'a' cannot be null INSERT INTO t1 (a) values (null),(null); Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 2 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 1 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'a' at row 2 INSERT INTO t1 (b) values (null); ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (1/null); ERROR 23000: Column 'b' cannot be null INSERT INTO t1 (b) values (null),(null); Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 1 -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'b' at row 2 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'b' at row 1 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'b' at row 2 INSERT INTO t1 (c) values (null); ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (1/null); ERROR 23000: Column 'c' cannot be null INSERT INTO t1 (c) values (null),(null); Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 1 -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'c' at row 2 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 1 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'c' at row 2 INSERT INTO t1 (d) values (null); ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (1/null); ERROR 23000: Column 'd' cannot be null INSERT INTO t1 (d) values (null),(null); Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 1 -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'd' at row 2 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 1 +Warning 1263 Column was set to data type implicit default; NULL supplied for NOT NULL column 'd' at row 2 select * from t1; a b c d 0 0000-00-00 00:00:00 0 @@ -167,13 +167,22 @@ insert into t1 select i*2 from t1; insert into t1 select i*2 from t1; insert into t1 select i*2 from t1; insert into t1 select i*2 from t1; +insert into t1 values(null); explain select * from t1 where i=2 or i is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref_or_null i i 5 const 10 Using where; Using index +1 SIMPLE t1 ref_or_null i i 5 const 9 Using where; Using index +select count(*) from t1 where i=2 or i is null; +count(*) +10 alter table t1 change i i int not null; +Warnings: +Warning 1265 Data truncated for column 'i' at row 513 explain select * from t1 where i=2 or i is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 7 Using where; Using index +1 SIMPLE t1 ref i i 4 const 7 Using index +select count(*) from t1 where i=2 or i is null; +count(*) +9 drop table t1; set names latin2; create table t1 select @@ -227,10 +236,10 @@ t1 CREATE TABLE `t1` ( `c06` varchar(6) character set latin2 default NULL, `c07` varchar(6) character set latin2 default NULL, `c08` varchar(6) character set latin2 default NULL, - `c09` varchar(6) character set latin2 NOT NULL default '', - `c10` varchar(6) character set latin2 NOT NULL default '', - `c11` varchar(6) character set latin2 NOT NULL default '', - `c12` varchar(6) character set latin2 NOT NULL default '', + `c09` varchar(6) character set latin2 default NULL, + `c10` varchar(6) character set latin2 default NULL, + `c11` varchar(6) character set latin2 default NULL, + `c12` varchar(6) character set latin2 default NULL, `c13` varchar(6) character set latin2 default NULL, `c14` char(0) character set latin2 default NULL, `c15` char(0) character set latin2 default NULL, @@ -246,14 +255,14 @@ t1 CREATE TABLE `t1` ( `c25` varchar(12) character set latin2 default NULL, `c26` varchar(7) character set latin2 default NULL, `c27` varchar(7) character set latin2 default NULL, - `c29` longtext character set latin2, - `c30` longtext character set latin2, + `c29` varchar(381) character set latin2 default NULL, + `c30` varchar(317) character set latin2 default NULL, `c31` varchar(192) character set latin2 default NULL, `c32` char(0) character set latin2 default NULL, - `c33` char(3) character set latin2 default NULL, - `c34` char(3) character set latin2 default NULL, - `c35` char(3) character set latin2 default NULL, - `c36` char(3) character set latin2 default NULL, + `c33` varchar(3) character set latin2 default NULL, + `c34` varchar(3) character set latin2 default NULL, + `c35` varchar(3) character set latin2 default NULL, + `c36` varchar(3) character set latin2 default NULL, `c37` varchar(10) character set latin2 default NULL, `c38` varchar(10) character set latin2 default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |