warnings.result 4.29 KB
Newer Older
venu@myvenu.com's avatar
venu@myvenu.com committed
1
drop table if exists t1, t2;
2 3
Warnings:
Note	1051	Unknown table 't1'
venu@myvenu.com's avatar
venu@myvenu.com committed
4
Note	1051	Unknown table 't2'
5 6 7
create table t1 (a int);
insert into t1 values (1);
insert into t1 values ("hej");
venu@myvenu.com's avatar
venu@myvenu.com committed
8 9
Warnings:
Warning	1263	Data truncated for column 'a' at row 1
10
insert into t1 values ("hej"),("då");
venu@myvenu.com's avatar
venu@myvenu.com committed
11 12 13
Warnings:
Warning	1263	Data truncated for column 'a' at row 1
Warning	1263	Data truncated for column 'a' at row 2
14 15
set SQL_WARNINGS=1;
insert into t1 values ("hej");
venu@myvenu.com's avatar
venu@myvenu.com committed
16 17
Warnings:
Warning	1263	Data truncated for column 'a' at row 1
18
insert into t1 values ("hej"),("då");
venu@myvenu.com's avatar
venu@myvenu.com committed
19 20 21
Warnings:
Warning	1263	Data truncated for column 'a' at row 1
Warning	1263	Data truncated for column 'a' at row 2
22 23
drop table t1;
set SQL_WARNINGS=0;
24 25 26
drop temporary table if exists not_exists;
Warnings:
Note	1051	Unknown table 'not_exists'
27 28 29 30 31 32 33 34
drop table if exists not_exists_table;
Warnings:
Note	1051	Unknown table 'not_exists_table'
show warnings limit 1;
Level	Code	Message
Note	1051	Unknown table 'not_exists_table'
drop database if exists not_exists_db;
Warnings:
35
Note	1008	Can't drop database 'not_exists_db'; database doesn't exist
36 37 38 39 40 41 42 43
show count(*) warnings;
@@session.warning_count
1
create table t1(id int);
create table if not exists t1(id int);
select @@warning_count;
@@warning_count
0
44
drop table t1;
venu@myvenu.com's avatar
venu@myvenu.com committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
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	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
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
112
drop table t1;
113 114
create table t1 (id int) type=isam;
Warnings:
venu@myvenu.com's avatar
venu@myvenu.com committed
115
Warning	1264	Using storage engine MYISAM for table 't1'
116 117
alter table t1 type=isam;
Warnings:
venu@myvenu.com's avatar
venu@myvenu.com committed
118
Warning	1264	Using storage engine MYISAM for table 't1'
119
drop table t1;