summaryrefslogtreecommitdiff
path: root/mysql-test/r/insert.result
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/r/insert.result
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/r/insert.result')
-rw-r--r--mysql-test/r/insert.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index a722ab8d97f..82f3977e231 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -697,3 +697,23 @@ ERROR 42000: Column 'a' specified twice
INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2;
ERROR 42000: Column 'a' specified twice
DROP TABLE t1;
+#
+# MDEV-5168: Ensure that we can disable duplicate key warnings
+# from INSERT IGNORE
+#
+create table t1 (f1 int unique, f2 int unique);
+insert into t1 values (1,12);
+insert into t1 values (2,13);
+insert into t1 values (1,12);
+ERROR 23000: Duplicate entry '1' for key 'f1'
+insert ignore into t1 values (1,12);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'f1'
+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);
+Warnings:
+Warning 1062 Duplicate entry '1' for key 'f1'
+DROP TABLE t1;