2003-05-21 00:14:56 -07:00
|
|
|
|
drop table if exists t1, t2;
|
2003-08-19 00:08:08 +03:00
|
|
|
|
SET SQL_WARNINGS=1;
|
2001-09-27 23:05:54 -06:00
|
|
|
|
create table t1 (a int);
|
|
|
|
|
insert into t1 values (1);
|
|
|
|
|
insert into t1 values ("hej");
|
2003-05-21 00:14:56 -07:00
|
|
|
|
Warnings:
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
2001-09-27 23:05:54 -06:00
|
|
|
|
insert into t1 values ("hej"),("d<>");
|
2003-05-21 00:14:56 -07:00
|
|
|
|
Warnings:
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
2001-09-27 23:05:54 -06:00
|
|
|
|
set SQL_WARNINGS=1;
|
|
|
|
|
insert into t1 values ("hej");
|
2003-05-21 00:14:56 -07:00
|
|
|
|
Warnings:
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
2001-09-27 23:05:54 -06:00
|
|
|
|
insert into t1 values ("hej"),("d<>");
|
2003-05-21 00:14:56 -07:00
|
|
|
|
Warnings:
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
2001-09-27 23:05:54 -06:00
|
|
|
|
drop table t1;
|
|
|
|
|
set SQL_WARNINGS=0;
|
2003-01-06 01:48:59 +02:00
|
|
|
|
drop temporary table if exists not_exists;
|
|
|
|
|
Warnings:
|
|
|
|
|
Note 1051 Unknown table 'not_exists'
|
2003-01-07 18:59:08 -08:00
|
|
|
|
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:
|
2003-07-10 10:02:57 +02:00
|
|
|
|
Note 1008 Can't drop database 'not_exists_db'; database doesn't exist
|
2003-01-07 18:59:08 -08:00
|
|
|
|
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
|
2003-05-13 11:15:11 +03:00
|
|
|
|
drop table t1;
|
2003-05-21 00:14:56 -07:00
|
|
|
|
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:
|
2004-10-02 22:20:08 +03:00
|
|
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'd' at row 3
|
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 4
|
|
|
|
|
Warning 1261 Row 5 doesn't contain data for all columns
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 6
|
2004-06-15 15:38:36 -05:00
|
|
|
|
Warning 1262 Row 7 was truncated; it contained more data than there were input columns
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 8
|
2003-05-21 00:14:56 -07:00
|
|
|
|
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:
|
2004-10-02 22:20:08 +03:00
|
|
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 1
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'b' at row 2
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 2
|
2004-09-28 20:08:00 +03:00
|
|
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 3
|
|
|
|
|
Warning 1264 Out of range value adjusted for column 'b' at row 3
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 3
|
2003-05-21 00:14:56 -07:00
|
|
|
|
alter table t1 modify c char(4);
|
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 1
|
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 2
|
2003-05-21 00:14:56 -07:00
|
|
|
|
alter table t1 add d char(2);
|
|
|
|
|
update t1 set a=NULL where a=10;
|
|
|
|
|
Warnings:
|
2004-10-02 22:20:08 +03:00
|
|
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 2
|
2003-05-21 00:14:56 -07:00
|
|
|
|
update t1 set c='mysql ab' where c='test';
|
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'c' at row 4
|
2003-05-21 00:14:56 -07:00
|
|
|
|
update t1 set d=c;
|
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'd' at row 1
|
|
|
|
|
Warning 1265 Data truncated for column 'd' at row 2
|
|
|
|
|
Warning 1265 Data truncated for column 'd' at row 3
|
|
|
|
|
Warning 1265 Data truncated for column 'd' at row 4
|
2003-05-21 00:14:56 -07:00
|
|
|
|
create table t2(a tinyint NOT NULL, b char(3));
|
|
|
|
|
insert into t2 select b,c from t1;
|
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 2
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 3
|
2004-10-02 22:20:08 +03:00
|
|
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 4
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 4
|
2003-07-21 00:13:22 -07:00
|
|
|
|
insert into t2(b) values('mysqlab');
|
2003-10-11 23:26:39 +03:00
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
2003-07-21 19:37:18 +03:00
|
|
|
|
set sql_warnings=1;
|
|
|
|
|
insert into t2(b) values('mysqlab');
|
2003-07-21 00:13:22 -07:00
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
2003-07-21 19:37:18 +03:00
|
|
|
|
set sql_warnings=0;
|
2003-05-21 00:14:56 -07:00
|
|
|
|
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:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 2
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 3
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 4
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 5
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 6
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 7
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 8
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 9
|
|
|
|
|
Warning 1265 Data truncated for column 'b' at row 10
|
2003-05-21 00:14:56 -07:00
|
|
|
|
select @@warning_count;
|
|
|
|
|
@@warning_count
|
|
|
|
|
50
|
2003-05-21 01:21:06 -07:00
|
|
|
|
drop table t1;
|
2003-12-10 04:31:42 +00:00
|
|
|
|
create table t1 (id int) engine=isam;
|
2003-05-13 11:15:11 +03:00
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1266 Using storage engine MyISAM for table 't1'
|
2003-12-10 04:31:42 +00:00
|
|
|
|
alter table t1 engine=isam;
|
2003-05-13 11:15:11 +03:00
|
|
|
|
Warnings:
|
2004-02-16 10:03:25 +02:00
|
|
|
|
Warning 1266 Using storage engine MyISAM for table 't1'
|
2003-05-13 11:15:11 +03:00
|
|
|
|
drop table t1;
|
2003-12-10 04:31:42 +00:00
|
|
|
|
create table t1 (id int) type=heap;
|
|
|
|
|
Warnings:
|
2004-06-15 15:38:36 -05:00
|
|
|
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
2003-12-10 04:31:42 +00:00
|
|
|
|
alter table t1 type=myisam;
|
|
|
|
|
Warnings:
|
2004-06-15 15:38:36 -05:00
|
|
|
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
2003-12-10 04:31:42 +00:00
|
|
|
|
drop table t1;
|
2003-12-17 22:52:03 +00:00
|
|
|
|
set table_type=MYISAM;
|
|
|
|
|
Warnings:
|
2004-06-15 15:38:36 -05:00
|
|
|
|
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
|