summaryrefslogtreecommitdiff
path: root/mysql-test/suite/compat
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-05-21 14:22:49 +0400
committerAlexander Barkov <bar@mariadb.com>2019-05-21 14:22:49 +0400
commit8164bd24a611ee2682ff0ba922fd0da526f75f14 (patch)
treecfe7ae117353778c867729e16323fb564dbe81c3 /mysql-test/suite/compat
parented39181a27ed95e1de63661bdeb6cfc21c3c6c03 (diff)
downloadmariadb-git-8164bd24a611ee2682ff0ba922fd0da526f75f14.tar.gz
MDEV-19535 sql_mode=ORACLE: 'SELECT INTO @var FOR UPDATE' does not lock the table
Diffstat (limited to 'mysql-test/suite/compat')
-rw-r--r--mysql-test/suite/compat/oracle/r/update_innodb.result26
-rw-r--r--mysql-test/suite/compat/oracle/t/update_innodb.test28
2 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/suite/compat/oracle/r/update_innodb.result b/mysql-test/suite/compat/oracle/r/update_innodb.result
new file mode 100644
index 00000000000..1dae643eeff
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/r/update_innodb.result
@@ -0,0 +1,26 @@
+#
+# MDEV-19535 sql_mode=ORACLE: 'SELECT INTO @var FOR UPDATE' does not lock the table
+#
+SET sql_mode='ORACLE';
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) engine=innodb;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+SELECT a AS a_con1 FROM t1 INTO @a FOR UPDATE;
+Warnings:
+Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
+connect con2,localhost,root,,;
+SET sql_mode='ORACLE';
+START TRANSACTION;
+SELECT a AS a_con2 FROM t1 INTO @a FOR UPDATE;;
+connection default;
+UPDATE t1 SET a=a+100;
+COMMIT;
+connection con2;
+Warnings:
+Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
+SELECT a AS con2 FROM t1;
+con2
+101
+COMMIT;
+connection default;
+DROP TABLE t1;
diff --git a/mysql-test/suite/compat/oracle/t/update_innodb.test b/mysql-test/suite/compat/oracle/t/update_innodb.test
new file mode 100644
index 00000000000..8af219584d6
--- /dev/null
+++ b/mysql-test/suite/compat/oracle/t/update_innodb.test
@@ -0,0 +1,28 @@
+--source include/have_innodb.inc
+
+--echo #
+--echo # MDEV-19535 sql_mode=ORACLE: 'SELECT INTO @var FOR UPDATE' does not lock the table
+--echo #
+
+SET sql_mode='ORACLE';
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) engine=innodb;
+INSERT INTO t1 VALUES (1);
+START TRANSACTION;
+SELECT a AS a_con1 FROM t1 INTO @a FOR UPDATE;
+
+--connect(con2,localhost,root,,)
+SET sql_mode='ORACLE';
+START TRANSACTION;
+--send SELECT a AS a_con2 FROM t1 INTO @a FOR UPDATE;
+
+--connection default
+UPDATE t1 SET a=a+100;
+COMMIT;
+
+--connection con2
+--reap
+SELECT a AS con2 FROM t1;
+COMMIT;
+
+--connection default
+DROP TABLE t1;