diff options
-rw-r--r-- | mysql-test/r/auto_increment.result | 2 | ||||
-rw-r--r-- | mysql-test/r/create.result | 2 | ||||
-rw-r--r-- | mysql-test/r/group_by.result | 58 | ||||
-rw-r--r-- | mysql-test/r/heap.result | 6 | ||||
-rw-r--r-- | mysql-test/r/heap_btree.result | 6 | ||||
-rw-r--r-- | mysql-test/r/heap_hash.result | 6 | ||||
-rw-r--r-- | mysql-test/r/isam.result | 8 | ||||
-rw-r--r-- | mysql-test/r/key.result | 12 | ||||
-rw-r--r-- | mysql-test/r/myisam.result | 28 | ||||
-rw-r--r-- | mysql-test/r/null.result | 16 | ||||
-rw-r--r-- | mysql-test/r/null_key.result | 2 | ||||
-rw-r--r-- | mysql-test/r/order_by.result | 5 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 6 | ||||
-rw-r--r-- | mysql-test/r/type_decimal.result | 78 | ||||
-rw-r--r-- | mysql-test/r/type_float.result | 3 | ||||
-rw-r--r-- | mysql-test/r/type_ranges.result | 37 | ||||
-rw-r--r-- | mysql-test/r/type_time.result | 4 | ||||
-rw-r--r-- | mysql-test/r/type_uint.result | 2 | ||||
-rw-r--r-- | mysql-test/r/warnings.result | 90 | ||||
-rw-r--r-- | mysql-test/t/ctype_many.test | 3 | ||||
-rw-r--r-- | mysql-test/t/warnings.test | 37 |
21 files changed, 392 insertions, 19 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index 2facb504294..c993a47198a 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -124,6 +124,8 @@ select last_insert_id(); last_insert_id() 255 insert into t1 set i = null; +Warnings: +Warning 1262 Data truncated, out of range for column 'i' at row 1 select last_insert_id(); last_insert_id() 255 diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index f6f917b44b0..0b31d31e955 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -9,6 +9,8 @@ drop table if exists t1; create table t1 (b char(0) not null); create table if not exists t1 (b char(0) not null); insert into t1 values (""),(null); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 select * from t1; b diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 337d5639056..3b8a8850cc9 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -144,34 +144,92 @@ KEY qa_contact (qa_contact), KEY votes (votes) ); INSERT INTO t1 VALUES (1,0,0,'','normal','','2000-02-10 09:25:12',20000321114747,'','','Linux','P1','TestProduct','PC',3,'other','TestComponent','','M1',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (9,0,0,'','enhancement','','2000-03-10 11:49:36',20000321114747,'','','All','P5','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (10,0,0,'','enhancement','','2000-03-10 18:10:16',20000321114747,'','','All','P4','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - conversion','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (7,0,0,'','critical','','2000-03-09 10:50:21',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (6,0,0,'','normal','','2000-03-09 10:42:44',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (8,0,0,'','major','','2000-03-09 11:32:14',20000321114747,'','','All','P3','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (5,0,0,'','enhancement','','2000-03-09 10:38:59',20000321114747,'','','All','P5','CCC/CCCCCC','PC',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (4,0,0,'','normal','','2000-03-08 18:32:14',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent2','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (3,0,0,'','normal','','2000-03-08 18:30:52',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (2,0,0,'','enhancement','','2000-03-08 18:24:51',20000321114747,'','','All','P2','TestProduct','Other',4,'other','TestComponent2','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (11,0,0,'','blocker','','2000-03-13 09:43:41',20000321114747,'','','All','P2','CCC/CCCCCC','PC',5,'7.00','DDDDDDDDD','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (12,0,0,'','normal','','2000-03-13 16:14:31',20000321114747,'','','All','P2','AAAAA','PC',3,'2.00 CD - Pre','kkkkkkkkkkk lllllllllll','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (13,0,0,'','normal','','2000-03-15 16:20:44',20000321114747,'','','other','P2','TestProduct','Other',3,'other','TestComponent','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (14,0,0,'','blocker','','2000-03-15 18:13:47',20000321114747,'','','All','P1','AAAAA','PC',3,'2.00 CD - Pre','BBBBBBBBBBBBB - generic','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (15,0,0,'','minor','','2000-03-16 18:03:28',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (16,0,0,'','normal','','2000-03-16 18:33:41',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (17,0,0,'','normal','','2000-03-16 18:34:18',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (18,0,0,'','normal','','2000-03-16 18:34:56',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (19,0,0,'','enhancement','','2000-03-16 18:35:34',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (20,0,0,'','enhancement','','2000-03-16 18:36:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (21,0,0,'','enhancement','','2000-03-16 18:37:23',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (22,0,0,'','enhancement','','2000-03-16 18:38:16',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','Administration','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (23,0,0,'','normal','','2000-03-16 18:58:12',20000321114747,'','','All','P2','CCC/CCCCCC','Other',5,'7.00','DDDDDDDDD','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (24,0,0,'','normal','','2000-03-17 11:08:10',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (25,0,0,'','normal','','2000-03-17 11:10:45',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (26,0,0,'','normal','','2000-03-17 11:15:47',20000321114747,'','','All','P2','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (27,0,0,'','normal','','2000-03-17 17:45:41',20000321114747,'','','All','P2','CCC/CCCCCC','PC',5,'7.00','DDDDDDDDD','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (28,0,0,'','normal','','2000-03-20 09:51:45',20000321114747,'','','Windows NT','P2','TestProduct','PC',8,'other','TestComponent','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 INSERT INTO t1 VALUES (29,0,0,'','normal','','2000-03-20 11:15:09',20000321114747,'','','All','P5','AAAAAAAA-AAA','PC',3,'2.8','Web Interface','','',0,'',0); +Warnings: +Warning 1263 Data truncated for column 'bug_status' at row 1 CREATE TABLE t2 ( value tinytext, program varchar(64), diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 76022b66100..ab5870357f9 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -164,6 +164,12 @@ select * from t1 where btn like "q%"; btn alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn; update t1 set new_col=btn; +Warnings: +Warning 1263 Data truncated for column 'new_col' at row 1 +Warning 1263 Data truncated for column 'new_col' at row 2 +Warning 1263 Data truncated for column 'new_col' at row 3 +Warning 1263 Data truncated for column 'new_col' at row 4 +Warning 1263 Data truncated for column 'new_col' at row 5 explain select * from t1 where btn="a"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index bf24f78321f..7f6c9f8e591 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -180,6 +180,12 @@ select * from t1 where btn like "q%"; btn alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn; update t1 set new_col=btn; +Warnings: +Warning 1263 Data truncated for column 'new_col' at row 1 +Warning 1263 Data truncated for column 'new_col' at row 2 +Warning 1263 Data truncated for column 'new_col' at row 3 +Warning 1263 Data truncated for column 'new_col' at row 4 +Warning 1263 Data truncated for column 'new_col' at row 5 explain select * from t1 where btn="a"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref btn btn 10 const 1 Using where diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 3c2baa645f7..9554990aa34 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -164,6 +164,12 @@ select * from t1 where btn like "q%"; btn alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key btn; update t1 set new_col=btn; +Warnings: +Warning 1263 Data truncated for column 'new_col' at row 1 +Warning 1263 Data truncated for column 'new_col' at row 2 +Warning 1263 Data truncated for column 'new_col' at row 3 +Warning 1263 Data truncated for column 'new_col' at row 4 +Warning 1263 Data truncated for column 'new_col' at row 5 explain select * from t1 where btn="a"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where diff --git a/mysql-test/r/isam.result b/mysql-test/r/isam.result index 7871e899773..7032e506b91 100644 --- a/mysql-test/r/isam.result +++ b/mysql-test/r/isam.result @@ -1,5 +1,13 @@ drop table if exists t1,t2; create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam; +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 delete from t1 where (a & 1); select sum(length(b)) from t1; sum(length(b)) diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index 9e1f743d132..168bc276c30 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -32,6 +32,11 @@ KEY price (price,area,type,transityes,shopsyes,schoolsyes,petsyes) INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','',''); +Warnings: +Warning 1263 Data truncated for column 'transityes' at row 1 +Warning 1263 Data truncated for column 'shopsyes' at row 1 +Warning 1263 Data truncated for column 'schoolsyes' at row 1 +Warning 1263 Data truncated for column 'petsyes' at row 1 INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y'); @@ -90,9 +95,13 @@ INSERT t1 VALUES(NULL,'/'); INSERT t1 VALUES(NULL,'[T,U]_axpby'); SELECT * FROM t1 WHERE name='[T,U]_axpy'; name_id name +Warnings: +Warning 1263 Data truncated for column 'name' at row 1 SELECT * FROM t1 WHERE name='[T,U]_axpby'; name_id name 2 [T,U]_axpby +Warnings: +Warning 1263 Data truncated for column 'name' at row 1 create table t2 ( name_id int not null auto_increment, @@ -150,6 +159,9 @@ drop table t1; CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT, UNIQUE (c,i)); INSERT INTO t1 (c) VALUES (NULL),(NULL); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'c' at row 1 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'c' at row 2 SELECT * FROM t1; c i 1 diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 13e0933adf4..5cfd1afd867 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -14,6 +14,34 @@ Table Op Msg_type Msg_text test.t1 check status OK drop table t1; create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)); +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 check table t1; Table Op Msg_type Msg_text test.t1 check status OK diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 08612fa191f..d6dfb4621ab 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -76,27 +76,43 @@ 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); INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55"; UPDATE t1 SET d=1/NULL; +Warnings: +Warning 1263 Data truncated for column 'd' at row 1 UPDATE t1 SET d=NULL; +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'd' at row 1 INSERT INTO t1 (a) values (null); Column 'a' cannot be null INSERT INTO t1 (a) values (1/null); Column 'a' cannot be null INSERT INTO t1 (a) values (null),(null); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 1 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 2 INSERT INTO t1 (b) values (null); Column 'b' cannot be null INSERT INTO t1 (b) values (1/null); Column 'b' cannot be null INSERT INTO t1 (b) values (null),(null); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 1 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 INSERT INTO t1 (c) values (null); Column 'c' cannot be null INSERT INTO t1 (c) values (1/null); Column 'c' cannot be null INSERT INTO t1 (c) values (null),(null); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'c' at row 1 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'c' at row 2 INSERT INTO t1 (d) values (null); Column 'd' cannot be null INSERT INTO t1 (d) values (1/null); Column 'd' cannot be null INSERT INTO t1 (d) values (null),(null); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'd' at row 1 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'd' at row 2 select * from t1; a b c d 0 0000-00-00 00:00:00 0 diff --git a/mysql-test/r/null_key.result b/mysql-test/r/null_key.result index ce3af6c37cd..d5677f877ee 100644 --- a/mysql-test/r/null_key.result +++ b/mysql-test/r/null_key.result @@ -234,6 +234,8 @@ index (id), index (id2) ); insert into t1 values(null,null),(1,1); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'id2' at row 1 select * from t1; id id2 NULL 0 diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index bd5b283f26a..73caceedfdb 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -332,6 +332,11 @@ a b c 1 NULL b 1 NULL NULL alter table t1 modify b int not null, modify c varchar(10) not null; +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warning 1263 Data truncated for column 'c' at row 1 +Warning 1263 Data truncated for column 'b' at row 2 +Warning 1263 Data truncated for column 'c' at row 3 explain select * from t1 order by a, b, c; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 18 NULL 11 Using index diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 564e102c874..c9e05a9f22d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -961,7 +961,13 @@ PRIMARY KEY (`numeropost`), UNIQUE KEY `maxnumrep` (`maxnumrep`) ) TYPE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1263 Data truncated for column 'date' at row 1 +Warning 1263 Data truncated for column 'date' at row 2 INSERT INTO t2 VALUES ('joce','1','','joce'),('test','2','','test'); +Warnings: +Warning 1263 Data truncated for column 'date' at row 1 +Warning 1263 Data truncated for column 'date' at row 2 INSERT INTO t3 VALUES (1,1); SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE numeropost=topic); diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index 4c326957c03..0e973ae3501 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -156,8 +156,18 @@ insert into t1 values ("-.1"),("+.1"),(".1"); insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1263 Data truncated for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 3 select * from t1; a 0.00 @@ -189,12 +199,33 @@ a drop table t1; create table t1 (a decimal(10,2) unsigned); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1263 Data truncated for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 3 select * from t1; a 0.00 @@ -226,12 +257,33 @@ a drop table t1; create table t1 (a decimal(10,2) zerofill); insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 6 insert into t1 values ("-.1"),("+.1"),(".1"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1263 Data truncated for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 3 select * from t1; a 00000000.00 @@ -267,7 +319,14 @@ insert into t1 values (-.1),(+.1),(.1); insert into t1 values (00000000000001),(+0000000000001),(-0000000000001); insert into t1 values (+111111111.11),(111111111.11),(-11111111.11); insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values (1e+100),(1e-100),(-1e+100); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 3 insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0); select * from t1; a @@ -300,6 +359,9 @@ a drop table t1; create table t1 (a decimal); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 7 select * from t1; a -9999999999 @@ -312,6 +374,10 @@ a drop table t1; create table t1 (a decimal unsigned); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 7 select * from t1; a 0 @@ -324,6 +390,10 @@ a drop table t1; create table t1 (a decimal zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -336,6 +406,10 @@ a drop table t1; create table t1 (a decimal unsigned zerofill); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'a' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 7 select * from t1; a 0000000000 @@ -348,11 +422,15 @@ a drop table t1; create table t1(a decimal(10,0)); insert into t1 values ("1e4294967295"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 select * from t1; a 99999999999 delete from t1; insert into t1 values("1e4294967297"); +Warnings: +Warning 1262 Data truncated, out of range for column 'a' at row 1 select * from t1; a 99999999999 diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 3914114d92c..eb9f6a00341 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -14,6 +14,9 @@ Field Type Collation Null Key Default Extra Privileges Comment f1 float binary YES NULL select,insert,update,references f2 double binary YES NULL select,insert,update,references insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); +Warnings: +Warning 1262 Data truncated, out of range for column 'f1' at row 7 +Warning 1262 Data truncated, out of range for column 'f1' at row 8 insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); select * from t1; f1 f2 diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 3922826fdfd..54e1dea59c8 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -87,8 +87,34 @@ insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','o insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); +Warnings: +Warning 1262 Data truncated, out of range for column 'utiny' at row 1 +Warning 1262 Data truncated, out of range for column 'ushort' at row 1 +Warning 1262 Data truncated, out of range for column 'umedium' at row 1 +Warning 1262 Data truncated, out of range for column 'ulong' at row 1 +Warning 1263 Data truncated for column 'options' at row 1 +Warning 1263 Data truncated for column 'flags' at row 1 insert into t1 values (0,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,-4294967295,NULL,0,0,0,-4294967295,-4294967295,-4294967295,'-4294967295',0,"one,two,tree"); +Warnings: +Warning 1262 Data truncated, out of range for column 'tiny' at row 1 +Warning 1262 Data truncated, out of range for column 'short' at row 1 +Warning 1262 Data truncated, out of range for column 'medium' at row 1 +Warning 1262 Data truncated, out of range for column 'long_int' at row 1 +Warning 1262 Data truncated, out of range for column 'utiny' at row 1 +Warning 1262 Data truncated, out of range for column 'ushort' at row 1 +Warning 1262 Data truncated, out of range for column 'umedium' at row 1 +Warning 1262 Data truncated, out of range for column 'ulong' at row 1 +Warning 1263 Data truncated for column 'options' at row 1 insert into t1 values (0,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,4294967295,NULL,0,0,0,4294967295,4294967295,4294967295,'4294967295',0,0); +Warnings: +Warning 1262 Data truncated, out of range for column 'tiny' at row 1 +Warning 1262 Data truncated, out of range for column 'short' at row 1 +Warning 1262 Data truncated, out of range for column 'medium' at row 1 +Warning 1262 Data truncated, out of range for column 'long_int' at row 1 +Warning 1262 Data truncated, out of range for column 'utiny' at row 1 +Warning 1262 Data truncated, out of range for column 'ushort' at row 1 +Warning 1262 Data truncated, out of range for column 'umedium' at row 1 +Warning 1263 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col @@ -136,6 +162,13 @@ new_field char(2), PRIMARY KEY (auto) ); INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10; +Warnings: +Warning 1263 Data truncated for column 'new_field' at row 2 +Warning 1263 Data truncated for column 'new_field' at row 3 +Warning 1263 Data truncated for column 'new_field' at row 4 +Warning 1263 Data truncated for column 'new_field' at row 5 +Warning 1263 Data truncated for column 'new_field' at row 6 +Warning 1263 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne @@ -166,6 +199,10 @@ options flags one one drop table t2; create table t2 select * from t1; +Warnings: +Warning 1263 Data truncated for column 'options' at row 4 +Warning 1263 Data truncated for column 'options' at row 5 +Warning 1263 Data truncated for column 'options' at row 6 update t2 set string="changed" where auto=16; show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result index bacc3ec0176..27f2de823c6 100644 --- a/mysql-test/r/type_time.result +++ b/mysql-test/r/type_time.result @@ -24,6 +24,10 @@ t 12:30:35 36:30:31 insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a"); +Warnings: +Warning 1262 Data truncated, out of range for column 't' at row 2 +Warning 1262 Data truncated, out of range for column 't' at row 3 +Warning 1262 Data truncated, out of range for column 't' at row 4 select * from t1; t 10:22:33 diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result index 1acfc700d3a..ee81295e696 100644 --- a/mysql-test/r/type_uint.result +++ b/mysql-test/r/type_uint.result @@ -2,6 +2,8 @@ drop table if exists t1; create table t1 (this int unsigned); insert into t1 values (1); insert into t1 values (-1); +Warnings: +Warning 1262 Data truncated, out of range for column 'this' at row 1 select * from t1; this 1 diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index c1f3041bf12..059606a62e1 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -1,13 +1,24 @@ -drop table if exists t1; +drop table if exists t1, t2; Warnings: Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' create table t1 (a int); insert into t1 values (1); insert into t1 values ("hej"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 1 insert into t1 values ("hej"),("då"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated for column 'a' at row 2 set SQL_WARNINGS=1; insert into t1 values ("hej"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 1 insert into t1 values ("hej"),("då"); +Warnings: +Warning 1263 Data truncated for column 'a' at row 1 +Warning 1263 Data truncated for column 'a' at row 2 drop table t1; set SQL_WARNINGS=0; drop temporary table if exists not_exists; @@ -34,23 +45,68 @@ drop table t1; create table t1(a tinyint, b int not null, c date, d char(5)); load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; Warnings: -Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 -Warning 1261 Data truncated for column 'd' at row 3 -Warning 1261 Data truncated for column 'c' at row 4 -Warning 1259 Value count is fewer than the column count at row 5 -Warning 1261 Data truncated for column 'b' at row 6 -Warning 1260 Value count is more than the column count at row 7 -Warning 1261 Data truncated for column 'a' at row 8 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 +Warning 1263 Data truncated for column 'd' at row 3 +Warning 1263 Data truncated for column 'c' at row 4 +Warning 1259 Record count is fewer than the column count at row 5 +Warning 1263 Data truncated for column 'b' at row 6 +Warning 1260 Record count is more than the column count at row 7 +Warning 1262 Data truncated, out of range for column 'a' at row 8 select @@warning_count; @@warning_count 7 -show warnings; -Level Code Message -Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 -Warning 1261 Data truncated for column 'd' at row 3 -Warning 1261 Data truncated for column 'c' at row 4 -Warning 1259 Value count is fewer than the column count at row 5 -Warning 1261 Data truncated for column 'b' at row 6 -Warning 1260 Value count is more than the column count at row 7 -Warning 1261 Data truncated for column 'a' at row 8 +drop table t1; +create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5)); +insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test'); +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 1 +Warning 1262 Data truncated, out of range for column 'b' at row 2 +Warning 1263 Data truncated for column 'c' at row 2 +Warning 1262 Data truncated, out of range for column 'a' at row 3 +Warning 1262 Data truncated, out of range for column 'b' at row 3 +Warning 1263 Data truncated for column 'c' at row 3 +alter table t1 modify c char(4); +Warnings: +Warning 1263 Data truncated for column 'c' at row 1 +Warning 1263 Data truncated for column 'c' at row 2 +alter table t1 add d char(2); +update t1 set a=NULL where a=10; +Warnings: +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 2 +update t1 set c='mysql ab' where c='test'; +Warnings: +Warning 1263 Data truncated for column 'c' at row 4 +update t1 set d=c; +Warnings: +Warning 1263 Data truncated for column 'd' at row 1 +Warning 1263 Data truncated for column 'd' at row 2 +Warning 1263 Data truncated for column 'd' at row 3 +Warning 1263 Data truncated for column 'd' at row 4 +create table t2(a tinyint NOT NULL, b char(3)); +insert into t2 select b,c from t1; +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warning 1263 Data truncated for column 'b' at row 2 +Warning 1263 Data truncated for column 'b' at row 3 +Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 4 +Warning 1263 Data truncated for column 'b' at row 4 +drop table t1, t2; +create table t1(a char(10)); +alter table t1 add b char; +set max_error_count=10; +update t1 set b=a; +Warnings: +Warning 1263 Data truncated for column 'b' at row 1 +Warning 1263 Data truncated for column 'b' at row 2 +Warning 1263 Data truncated for column 'b' at row 3 +Warning 1263 Data truncated for column 'b' at row 4 +Warning 1263 Data truncated for column 'b' at row 5 +Warning 1263 Data truncated for column 'b' at row 6 +Warning 1263 Data truncated for column 'b' at row 7 +Warning 1263 Data truncated for column 'b' at row 8 +Warning 1263 Data truncated for column 'b' at row 9 +Warning 1263 Data truncated for column 'b' at row 10 +select @@warning_count; +@@warning_count +50 drop table t1; diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 8378ef35685..ab528dc11e7 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -167,7 +167,10 @@ ORDER BY t12.utf8_f,t11.comment,t12.comment; SET CHARACTER SET utf8; ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2; + +--disable_warnings ALTER TABLE t1 CHANGE ucs2_f ucs2_f CHAR(32) UNICODE NOT NULL; +--enable_warnings INSERT INTO t1 (ucs2_f,comment) VALUES (0x0391,'GREEK CAPIT ALPHA'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA'); diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index bfdbb8f025a..9b210ffd82d 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -2,7 +2,7 @@ # Test some warnings # --disable-warnings -drop table if exists t1; +drop table if exists t1, t2; --enable-warnings create table t1 (a int); @@ -36,5 +36,38 @@ drop table t1; create table t1(a tinyint, b int not null, c date, d char(5)); load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ','; select @@warning_count; -show warnings; +drop table t1; + +# +# Warnings from basic INSERT, UPDATE and ALTER commands +# + +create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5)); +insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test'); +alter table t1 modify c char(4); +alter table t1 add d char(2); +update t1 set a=NULL where a=10; +update t1 set c='mysql ab' where c='test'; +update t1 set d=c; +create table t2(a tinyint NOT NULL, b char(3)); +insert into t2 select b,c from t1; +drop table t1, t2; + +# +# Test for max_error_count +# + +create table t1(a char(10)); +let $1=50; +disable_query_log; +while ($1) +{ + eval insert into t1 values('mysql ab'); + dec $1; +} +enable_query_log; +alter table t1 add b char; +set max_error_count=10; +update t1 set b=a; +select @@warning_count; drop table t1; |