summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2014-01-26 21:48:42 +0100
committerSergei Golubchik <sergii@pisem.net>2014-01-26 21:48:42 +0100
commit680288873c4dd0418657fbc718687b1f91e2afbd (patch)
tree64918b4eb75ae72ac947ff76cd1fa2e1b520aa71 /mysql-test/t/insert.test
parentfb018850dc04f15234e3b1afdfb5911f28f9ecb9 (diff)
downloadmariadb-git-680288873c4dd0418657fbc718687b1f91e2afbd.tar.gz
Fix for MDEV-5168: MariaDB returns warnings for INSERT IGNORE
Added variable "OLD_MODE" that can be used to turn off the new behavior mysql-test/r/insert.result: Added test case mysql-test/r/mysqld--help.result: Added old_mode mysql-test/suite/sys_vars/r/old_mode_basic.result: Added testing of new variable mysql-test/suite/sys_vars/t/old_mode_basic.test: Added testing of new variable mysql-test/t/insert.test: Added test case sql/sql_class.h: Added bit flags for OLD_MODE sql/sql_insert.cc: Disable duplicate key warnings for INSERT IGNORE of OLD_MODE NO_DUP_KEY_WARNINGS_WITH_IGNORE is used sql/sql_show.cc: Don't show progress reporting on SHOW PROCESSLIST if OLD_MODE NO_PROGRESS_INFO is used sql/sys_vars.cc: Added OLD_MODE
Diffstat (limited to 'mysql-test/t/insert.test')
-rw-r--r--mysql-test/t/insert.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index f9b9fcf266d..ff8396fd7fd 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -555,3 +555,21 @@ INSERT IGNORE t1 (a, a) SELECT 1,1;
INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-5168: Ensure that we can disable duplicate key warnings
+--echo # from INSERT IGNORE
+--echo #
+
+create table t1 (f1 int unique, f2 int unique);
+insert into t1 values (1,12);
+insert into t1 values (2,13);
+--error ER_DUP_ENTRY
+insert into t1 values (1,12);
+insert ignore into t1 values (1,12);
+set @@old_mode="NO_DUP_KEY_WARNINGS_WITH_IGNORE";
+insert ignore into t1 values (1,12);
+insert ignore into t1 values (1,12) on duplicate key update f2=13;
+set @@old_mode="";
+insert ignore into t1 values (1,12);
+DROP TABLE t1;