From be84f9cea764a8cdfaeeeb04c9147271b36c29ab Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 7 Jun 2021 13:48:56 +0300 Subject: [PATCH] Record in test suite that temporary tables only uses write locks --- mysql-test/main/temp_table.result | 12 ++++++++++++ mysql-test/main/temp_table.test | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/mysql-test/main/temp_table.result b/mysql-test/main/temp_table.result index 64a5d9b681b..0e443cb71dd 100644 --- a/mysql-test/main/temp_table.result +++ b/mysql-test/main/temp_table.result @@ -619,3 +619,15 @@ ERROR 42S02: Unknown table 'test.t2' # # End of 10.5 tests # +# +# Record that temporary table locks are always WRITE locks +# +CREATE TEMPORARY TABLE t1 (a INT); +LOCK TABLE t1 READ; +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +UNLOCK TABLES; +DROP TABLE t1; +# +# End of 10.6 tests +# diff --git a/mysql-test/main/temp_table.test b/mysql-test/main/temp_table.test index ccaa5fb93e8..4f1bb3c5568 100644 --- a/mysql-test/main/temp_table.test +++ b/mysql-test/main/temp_table.test @@ -681,3 +681,17 @@ drop temporary table t2; --echo # End of 10.5 tests --echo # +--echo # +--echo # Record that temporary table locks are always WRITE locks +--echo # + +CREATE TEMPORARY TABLE t1 (a INT); +LOCK TABLE t1 READ; +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +UNLOCK TABLES; +DROP TABLE t1; + +--echo # +--echo # End of 10.6 tests +--echo #