summaryrefslogtreecommitdiff
path: root/mysql-test/t/warnings.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/warnings.test')
-rw-r--r--mysql-test/t/warnings.test33
1 files changed, 19 insertions, 14 deletions
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 29714438835..573f3c538c7 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -21,11 +21,11 @@ create table t (i);
show count(*) errors;
show errors;
insert into t1 values (1);
-insert into t1 values ("hej");
-insert into t1 values ("hej"),("då");
+insert ignore into t1 values ("hej");
+insert ignore into t1 values ("hej"),("då");
set SQL_WARNINGS=1;
-insert into t1 values ("hej");
-insert into t1 values ("hej"),("då");
+insert ignore into t1 values ("hej");
+insert ignore into t1 values ("hej"),("då");
drop table t1;
set SQL_WARNINGS=0;
@@ -62,17 +62,18 @@ 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');
+insert ignore into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
+SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
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;
+update ignore t1 set a=NULL where a=10;
+update ignore t1 set c='mysql ab' where c='test';
+update ignore t1 set d=c;
create table t2(a tinyint NOT NULL, b char(3));
-insert into t2 select b,c from t1;
-insert into t2(b) values('mysqlab');
+insert ignore into t2 select b,c from t1;
+insert ignore into t2(b) values('mysqlab');
set sql_warnings=1;
-insert into t2(b) values('mysqlab');
+insert ignore into t2(b) values('mysqlab');
set sql_warnings=0;
drop table t1, t2;
@@ -93,7 +94,7 @@ commit;
--enable_query_log
alter table t1 add b char;
set max_error_count=10;
-update t1 set b=a;
+update ignore t1 set b=a;
--disable_ps_protocol
select @@warning_count;
--enable_ps_protocol
@@ -101,7 +102,7 @@ select @@warning_count;
# Bug#9072
set max_error_count=0;
show variables like 'max_error_count';
-update t1 set b='hi';
+update ignore t1 set b='hi';
--disable_ps_protocol
select @@warning_count;
--enable_ps_protocol
@@ -119,7 +120,7 @@ drop table t1;
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
# should generate 10 warnings
-update t1 set a='abc';
+update ignore t1 set a='abc';
show warnings limit 2, 1;
show warnings limit 0, 10;
show warnings limit 9, 1;
@@ -152,6 +153,7 @@ INSERT INTO t3 VALUES ( 'a`', 'a`', '1000-01-1' );
DROP PROCEDURE IF EXISTS sp1;
DROP PROCEDURE IF EXISTS sp2;
DROP PROCEDURE IF EXISTS sp3;
+SET sql_mode = '';
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
@@ -172,8 +174,10 @@ delimiter ;//
CALL sp1();
CALL sp2();
CALL sp3();
+SET sql_mode = DEFAULT;
DROP PROCEDURE IF EXISTS sp1;
+SET sql_mode = '';
delimiter //;
CREATE PROCEDURE sp1()
BEGIN
@@ -182,6 +186,7 @@ SELECT f1 into x from t2 limit 1;
END//
delimiter ;//
CALL sp1();
+SET sql_mode = DEFAULT;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;