Commit 72196c9b authored by venu@myvenu.com's avatar venu@myvenu.com

Updated warning test

Updated all tests to catchup warnings for all field conversions
parent eb137c06
...@@ -124,6 +124,8 @@ select last_insert_id(); ...@@ -124,6 +124,8 @@ select last_insert_id();
last_insert_id() last_insert_id()
255 255
insert into t1 set i = null; insert into t1 set i = null;
Warnings:
Warning 1262 Data truncated, out of range for column 'i' at row 1
select last_insert_id(); select last_insert_id();
last_insert_id() last_insert_id()
255 255
......
...@@ -9,6 +9,8 @@ drop table if exists t1; ...@@ -9,6 +9,8 @@ drop table if exists t1;
create table t1 (b char(0) not null); create table t1 (b char(0) not null);
create table if not exists t1 (b char(0) not null); create table if not exists t1 (b char(0) not null);
insert into t1 values (""),(null); insert into t1 values (""),(null);
Warnings:
Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
select * from t1; select * from t1;
b b
......
...@@ -144,34 +144,92 @@ KEY qa_contact (qa_contact), ...@@ -144,34 +144,92 @@ KEY qa_contact (qa_contact),
KEY votes (votes) 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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); 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 ( CREATE TABLE t2 (
value tinytext, value tinytext,
program varchar(64), program varchar(64),
......
...@@ -164,6 +164,12 @@ select * from t1 where btn like "q%"; ...@@ -164,6 +164,12 @@ select * from t1 where btn like "q%";
btn btn
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key 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; 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"; explain select * from t1 where btn="a";
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where 1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
......
...@@ -180,6 +180,12 @@ select * from t1 where btn like "q%"; ...@@ -180,6 +180,12 @@ select * from t1 where btn like "q%";
btn btn
alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key 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; 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"; explain select * from t1 where btn="a";
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref btn btn 10 const 1 Using where 1 SIMPLE t1 ref btn btn 10 const 1 Using where
......
...@@ -164,6 +164,12 @@ select * from t1 where btn like "q%"; ...@@ -164,6 +164,12 @@ select * from t1 where btn like "q%";
btn btn
alter table t1 add column new_col char(1) not null, add key using HASH (btn,new_col), drop key 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; 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"; explain select * from t1 where btn="a";
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where 1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
......
drop table if exists t1,t2; drop table if exists t1,t2;
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) type=isam; 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); delete from t1 where (a & 1);
select sum(length(b)) from t1; select sum(length(b)) from t1;
sum(length(b)) sum(length(b))
......
...@@ -32,6 +32,11 @@ KEY price (price,area,type,transityes,shopsyes,schoolsyes,petsyes) ...@@ -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','N','N','N','N'); INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','',''); 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'); 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,'/'); ...@@ -90,9 +95,13 @@ INSERT t1 VALUES(NULL,'/');
INSERT t1 VALUES(NULL,'[T,U]_axpby'); INSERT t1 VALUES(NULL,'[T,U]_axpby');
SELECT * FROM t1 WHERE name='[T,U]_axpy'; SELECT * FROM t1 WHERE name='[T,U]_axpy';
name_id name name_id name
Warnings:
Warning 1263 Data truncated for column 'name' at row 1
SELECT * FROM t1 WHERE name='[T,U]_axpby'; SELECT * FROM t1 WHERE name='[T,U]_axpby';
name_id name name_id name
2 [T,U]_axpby 2 [T,U]_axpby
Warnings:
Warning 1263 Data truncated for column 'name' at row 1
create table t2 create table t2
( (
name_id int not null auto_increment, name_id int not null auto_increment,
...@@ -150,6 +159,9 @@ drop table t1; ...@@ -150,6 +159,9 @@ drop table t1;
CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT, CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i)); UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(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
SELECT * FROM t1; SELECT * FROM t1;
c i c i
1 1
......
...@@ -14,6 +14,34 @@ Table Op Msg_type Msg_text ...@@ -14,6 +14,34 @@ Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
drop table t1; drop table t1;
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)); 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; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
......
...@@ -76,27 +76,43 @@ drop table t1; ...@@ -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); 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"; INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
UPDATE t1 SET d=1/NULL; UPDATE t1 SET d=1/NULL;
Warnings:
Warning 1263 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL; 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); INSERT INTO t1 (a) values (null);
Column 'a' cannot be null Column 'a' cannot be null
INSERT INTO t1 (a) values (1/null); INSERT INTO t1 (a) values (1/null);
Column 'a' cannot be null Column 'a' cannot be null
INSERT INTO t1 (a) values (null),(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); INSERT INTO t1 (b) values (null);
Column 'b' cannot be null Column 'b' cannot be null
INSERT INTO t1 (b) values (1/null); INSERT INTO t1 (b) values (1/null);
Column 'b' cannot be null Column 'b' cannot be null
INSERT INTO t1 (b) values (null),(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); INSERT INTO t1 (c) values (null);
Column 'c' cannot be null Column 'c' cannot be null
INSERT INTO t1 (c) values (1/null); INSERT INTO t1 (c) values (1/null);
Column 'c' cannot be null Column 'c' cannot be null
INSERT INTO t1 (c) values (null),(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); INSERT INTO t1 (d) values (null);
Column 'd' cannot be null Column 'd' cannot be null
INSERT INTO t1 (d) values (1/null); INSERT INTO t1 (d) values (1/null);
Column 'd' cannot be null Column 'd' cannot be null
INSERT INTO t1 (d) values (null),(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; select * from t1;
a b c d a b c d
0 0000-00-00 00:00:00 0 0 0000-00-00 00:00:00 0
......
...@@ -234,6 +234,8 @@ index (id), ...@@ -234,6 +234,8 @@ index (id),
index (id2) index (id2)
); );
insert into t1 values(null,null),(1,1); 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; select * from t1;
id id2 id id2
NULL 0 NULL 0
......
...@@ -332,6 +332,11 @@ a b c ...@@ -332,6 +332,11 @@ a b c
1 NULL b 1 NULL b
1 NULL NULL 1 NULL NULL
alter table t1 modify b int not null, modify c varchar(10) not 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; explain select * from t1 order by a, b, c;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 18 NULL 11 Using index 1 SIMPLE t1 index NULL a 18 NULL 11 Using index
......
...@@ -961,7 +961,13 @@ PRIMARY KEY (`numeropost`), ...@@ -961,7 +961,13 @@ PRIMARY KEY (`numeropost`),
UNIQUE KEY `maxnumrep` (`maxnumrep`) UNIQUE KEY `maxnumrep` (`maxnumrep`)
) TYPE=MyISAM CHARSET=latin1; ) TYPE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test'); 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'); 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); INSERT INTO t3 VALUES (1,1);
SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE
numeropost=topic); numeropost=topic);
......
...@@ -156,8 +156,18 @@ insert into t1 values ("-.1"),("+.1"),(".1"); ...@@ -156,8 +156,18 @@ insert into t1 values ("-.1"),("+.1"),(".1");
insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001");
insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11");
insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.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"); 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"); 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; select * from t1;
a a
0.00 0.00
...@@ -189,12 +199,33 @@ a ...@@ -189,12 +199,33 @@ a
drop table t1; drop table t1;
create table t1 (a decimal(10,2) unsigned); create table t1 (a decimal(10,2) unsigned);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); 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"); 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"); 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"); 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"); 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"); 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"); 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; select * from t1;
a a
0.00 0.00
...@@ -226,12 +257,33 @@ a ...@@ -226,12 +257,33 @@ a
drop table t1; drop table t1;
create table t1 (a decimal(10,2) zerofill); create table t1 (a decimal(10,2) zerofill);
insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); 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"); 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"); 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"); 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"); 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"); 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"); 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; select * from t1;
a a
00000000.00 00000000.00
...@@ -267,7 +319,14 @@ insert into t1 values (-.1),(+.1),(.1); ...@@ -267,7 +319,14 @@ insert into t1 values (-.1),(+.1),(.1);
insert into t1 values (00000000000001),(+0000000000001),(-0000000000001); insert into t1 values (00000000000001),(+0000000000001),(-0000000000001);
insert into t1 values (+111111111.11),(111111111.11),(-11111111.11); insert into t1 values (+111111111.11),(111111111.11),(-11111111.11);
insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.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); 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); insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0);
select * from t1; select * from t1;
a a
...@@ -300,6 +359,9 @@ a ...@@ -300,6 +359,9 @@ a
drop table t1; drop table t1;
create table t1 (a decimal); create table t1 (a decimal);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999); 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; select * from t1;
a a
-9999999999 -9999999999
...@@ -312,6 +374,10 @@ a ...@@ -312,6 +374,10 @@ a
drop table t1; drop table t1;
create table t1 (a decimal unsigned); create table t1 (a decimal unsigned);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); 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; select * from t1;
a a
0 0
...@@ -324,6 +390,10 @@ a ...@@ -324,6 +390,10 @@ a
drop table t1; drop table t1;
create table t1 (a decimal zerofill); create table t1 (a decimal zerofill);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); 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; select * from t1;
a a
0000000000 0000000000
...@@ -336,6 +406,10 @@ a ...@@ -336,6 +406,10 @@ a
drop table t1; drop table t1;
create table t1 (a decimal unsigned zerofill); create table t1 (a decimal unsigned zerofill);
insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); 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; select * from t1;
a a
0000000000 0000000000
...@@ -348,11 +422,15 @@ a ...@@ -348,11 +422,15 @@ a
drop table t1; drop table t1;
create table t1(a decimal(10,0)); create table t1(a decimal(10,0));
insert into t1 values ("1e4294967295"); insert into t1 values ("1e4294967295");
Warnings:
Warning 1262 Data truncated, out of range for column 'a' at row 1
select * from t1; select * from t1;
a a
99999999999 99999999999
delete from t1; delete from t1;
insert into t1 values("1e4294967297"); insert into t1 values("1e4294967297");
Warnings:
Warning 1262 Data truncated, out of range for column 'a' at row 1
select * from t1; select * from t1;
a a
99999999999 99999999999
......
...@@ -14,6 +14,9 @@ Field Type Collation Null Key Default Extra Privileges Comment ...@@ -14,6 +14,9 @@ Field Type Collation Null Key Default Extra Privileges Comment
f1 float binary YES NULL select,insert,update,references f1 float binary YES NULL select,insert,update,references
f2 double 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); 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); 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; select * from t1;
f1 f2 f1 f2
......
...@@ -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 ...@@ -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 (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/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); 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"); 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); 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); 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; 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 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), ...@@ -136,6 +162,13 @@ new_field char(2),
PRIMARY KEY (auto) PRIMARY KEY (auto)
); );
INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10; 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; select * from t2;
auto string mediumblob_col new_field auto string mediumblob_col new_field
1 2 2 ne 1 2 2 ne
...@@ -166,6 +199,10 @@ options flags ...@@ -166,6 +199,10 @@ options flags
one one one one
drop table t2; drop table t2;
create table t2 select * from t1; 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; update t2 set string="changed" where auto=16;
show full columns from t1; show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment Field Type Collation Null Key Default Extra Privileges Comment
......
...@@ -24,6 +24,10 @@ t ...@@ -24,6 +24,10 @@ t
12:30:35 12:30:35
36:30:31 36:30:31
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a"); 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; select * from t1;
t t
10:22:33 10:22:33
......
...@@ -2,6 +2,8 @@ drop table if exists t1; ...@@ -2,6 +2,8 @@ drop table if exists t1;
create table t1 (this int unsigned); create table t1 (this int unsigned);
insert into t1 values (1); insert into t1 values (1);
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; select * from t1;
this this
1 1
......
drop table if exists t1; drop table if exists t1, t2;
Warnings: Warnings:
Note 1051 Unknown table 't1' Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
create table t1 (a int); create table t1 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t1 values ("hej"); insert into t1 values ("hej");
Warnings:
Warning 1263 Data truncated for column 'a' at row 1
insert into t1 values ("hej"),("då"); 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; set SQL_WARNINGS=1;
insert into t1 values ("hej"); insert into t1 values ("hej");
Warnings:
Warning 1263 Data truncated for column 'a' at row 1
insert into t1 values ("hej"),("då"); 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; drop table t1;
set SQL_WARNINGS=0; set SQL_WARNINGS=0;
drop temporary table if exists not_exists; drop temporary table if exists not_exists;
...@@ -34,23 +45,68 @@ drop table t1; ...@@ -34,23 +45,68 @@ drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5)); 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 ','; load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
Warnings: Warnings:
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 Warning 1261 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
Warning 1261 Data truncated for column 'd' at row 3 Warning 1263 Data truncated for column 'd' at row 3
Warning 1261 Data truncated for column 'c' at row 4 Warning 1263 Data truncated for column 'c' at row 4
Warning 1259 Value count is fewer than the column count at row 5 Warning 1259 Record count is fewer than the column count at row 5
Warning 1261 Data truncated for column 'b' at row 6 Warning 1263 Data truncated for column 'b' at row 6
Warning 1260 Value count is more than the column count at row 7 Warning 1260 Record count is more than the column count at row 7
Warning 1261 Data truncated for column 'a' at row 8 Warning 1262 Data truncated, out of range for column 'a' at row 8
select @@warning_count; select @@warning_count;
@@warning_count @@warning_count
7 7
show warnings; drop table t1;
Level Code Message create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
Warning 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2 insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
Warning 1261 Data truncated for column 'd' at row 3 Warnings:
Warning 1261 Data truncated for column 'c' at row 4 Warning 1261 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
Warning 1259 Value count is fewer than the column count at row 5 Warning 1262 Data truncated, out of range for column 'b' at row 2
Warning 1261 Data truncated for column 'b' at row 6 Warning 1263 Data truncated for column 'c' at row 2
Warning 1260 Value count is more than the column count at row 7 Warning 1262 Data truncated, out of range for column 'a' at row 3
Warning 1261 Data truncated for column 'a' at row 8 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; drop table t1;
...@@ -167,7 +167,10 @@ ORDER BY t12.utf8_f,t11.comment,t12.comment; ...@@ -167,7 +167,10 @@ ORDER BY t12.utf8_f,t11.comment,t12.comment;
SET CHARACTER SET utf8; SET CHARACTER SET utf8;
ALTER TABLE t1 ADD ucs2_f CHAR(32) CHARACTER SET ucs2; 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; 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 (0x0391,'GREEK CAPIT ALPHA');
INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA'); INSERT INTO t1 (ucs2_f,comment) VALUES (0x0392,'GREEK CAPIT BETA');
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Test some warnings # Test some warnings
# #
--disable-warnings --disable-warnings
drop table if exists t1; drop table if exists t1, t2;
--enable-warnings --enable-warnings
create table t1 (a int); create table t1 (a int);
...@@ -36,5 +36,38 @@ drop table t1; ...@@ -36,5 +36,38 @@ drop table t1;
create table t1(a tinyint, b int not null, c date, d char(5)); 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 ','; load data infile '../../std_data/warnings_loaddata.dat' into table t1 fields terminated by ',';
select @@warning_count; 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; drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment