summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sql_sequence/lock.result
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/suite/sql_sequence/lock.result
parentInitial commit. (diff)
downloadmariadb-upstream.tar.xz
mariadb-upstream.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/suite/sql_sequence/lock.result')
-rw-r--r--mysql-test/suite/sql_sequence/lock.result39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/suite/sql_sequence/lock.result b/mysql-test/suite/sql_sequence/lock.result
new file mode 100644
index 00000000..e92bdbff
--- /dev/null
+++ b/mysql-test/suite/sql_sequence/lock.result
@@ -0,0 +1,39 @@
+drop table if exists s1, t1, t2;
+CREATE SEQUENCE s1;
+create table t1 (a int);
+create table t2 (a int);
+LOCK TABLE s1 WRITE, t1 write;
+create or replace sequence s1;
+select * from s1;
+next_not_cached_value minimum_value maximum_value start_value increment cache_size cycle_option cycle_count
+1 1 9223372036854775806 1 1 1000 0 0
+select * from t1;
+a
+select * from t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+select * from t1;
+a
+select * from t2;
+a
+drop tables s1, t1, t2;
+CREATE SEQUENCE s1;
+LOCK TABLE s1 READ;
+SELECT NEXTVAL(s1);
+ERROR HY000: Table 's1' was locked with a READ lock and can't be updated
+SELECT NEXTVAL(s);
+ERROR HY000: Table 's' was not locked with LOCK TABLES
+DROP SEQUENCE s1;
+ERROR HY000: Table 's1' was locked with a READ lock and can't be updated
+unlock tables;
+DROP SEQUENCE s1;
+CREATE SEQUENCE seq1;
+CREATE SEQUENCE seq2;
+LOCK TABLE seq1 WRITE, seq2 WRITE;
+INSERT INTO seq1 VALUES (1, 1, 100000, 1, 1, 100, 1, 1);
+DROP SEQUENCE seq1, seq2;
+CREATE OR REPLACE SEQUENCE s1 ENGINE=MyISAM;
+LOCK TABLE s1 WRITE;
+TRUNCATE TABLE s1;
+ERROR HY000: Storage engine SEQUENCE of the table `test`.`s1` doesn't have this option
+DROP SEQUENCE s1;