summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/perfschema/t/dml_metadata_locks.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:07:14 +0000
commita175314c3e5827eb193872241446f2f8f5c9d33c (patch)
treecd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/perfschema/t/dml_metadata_locks.test
parentInitial commit. (diff)
downloadmariadb-10.5-upstream.tar.xz
mariadb-10.5-upstream.zip
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/perfschema/t/dml_metadata_locks.test')
-rw-r--r--mysql-test/suite/perfschema/t/dml_metadata_locks.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/suite/perfschema/t/dml_metadata_locks.test b/mysql-test/suite/perfschema/t/dml_metadata_locks.test
new file mode 100644
index 00000000..d4ace2c7
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/dml_metadata_locks.test
@@ -0,0 +1,35 @@
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--disable_result_log
+select * from performance_schema.metadata_locks;
+--enable_result_log
+
+select * from performance_schema.metadata_locks
+ where object_name='foo';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.metadata_locks
+ set object_name='FOO', owner_thread_id=1;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.metadata_locks
+ set owner_thread_id=12 where object_name='foo';
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.metadata_locks;
+
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.metadata_locks
+ where timer_name='CYCLE';
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.metadata_locks READ;
+UNLOCK TABLES;
+
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.metadata_locks WRITE;
+UNLOCK TABLES;
+