summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/sql_safe_updates.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:00:34 +0000
commit3f619478f796eddbba6e39502fe941b285dd97b1 (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/main/sql_safe_updates.test
parentInitial commit. (diff)
downloadmariadb-3f619478f796eddbba6e39502fe941b285dd97b1.tar.xz
mariadb-3f619478f796eddbba6e39502fe941b285dd97b1.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/sql_safe_updates.test')
-rw-r--r--mysql-test/main/sql_safe_updates.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/main/sql_safe_updates.test b/mysql-test/main/sql_safe_updates.test
new file mode 100644
index 00000000..25fe4a15
--- /dev/null
+++ b/mysql-test/main/sql_safe_updates.test
@@ -0,0 +1,23 @@
+--echo #
+--echo # MDEV-14429 sql_safe_updates in my.cnf not work
+--echo #
+select @@sql_safe_updates;
+
+--echo #
+--echo # MDEV-18304 sql_safe_updates does not work with OR clauses
+--echo #
+create table t1 (a int, b int, primary key (a), key (b));
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+update t1 set b=2 where a=1 or b=2;
+explain update t1 set b=2 where a=1 or b=2;
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+delete from t1 where a=1 or b=2;
+explain delete from t1 where a=1 or b=2;
+insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
+update t1 set b=2 where a=1 or b=2;
+delete from t1 where a=1 or b=2;
+drop table t1;
+
+--echo #
+--echo # End of 10.3 tests
+--echo #