⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
suite
/
ndb
/
t
/
View File Name :
ndb_global_schema_lock.test
# The include statement below is a temp one for tests that are yet to #be ported to run with InnoDB, #but needs to be kept for tests that would need MyISAM in future. --source include/force_myisam_default.inc -- source include/have_ndb.inc # # Run all the commands which should take the global schema lock # and thus increment the ndb_schema_locks_count variable # --source ndb_init_schema_locks_count.inc CREATE DATABASE test2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc ALTER DATABASE test2 CHARACTER SET latin2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc DROP DATABASE test2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc CREATE TABLE t1(a int not null primary key) ENGINE ndb; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc RENAME TABLE t1 TO t2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc CREATE TABLE t3 LIKE t2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc ALTER TABLE t3 ADD COLUMN b int default NULL; --source ndb_schema_locks_count.inc # Insert a row to truncate INSERT INTO t2 VALUES(1); --source ndb_init_schema_locks_count.inc TRUNCATE TABLE t2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc CREATE TABLE t4 ENGINE=NDB AS SELECT * FROM t2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc DROP TABLE t2; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc DROP TABLE t3, t4; --source ndb_schema_locks_count.inc # # Testing GSL behaviour combined with LOCK TABLES # # NOTE! Using LOCK TABLES should not be a way to circumvent # global schema locking # CREATE TABLE t10(a int primary key) ENGINE ndb; # # Database DDL with READ lock, should return error # LOCK TABLES t10 READ; --error ER_LOCK_OR_ACTIVE_TRANSACTION CREATE DATABASE test2; --error ER_LOCK_OR_ACTIVE_TRANSACTION ALTER DATABASE test2 CHARACTER SET latin2; --error ER_LOCK_OR_ACTIVE_TRANSACTION DROP DATABASE test2; UNLOCK TABLES; # # Database DDL with WRITE lock, should return error # LOCK TABLES t10 WRITE; --error ER_LOCK_OR_ACTIVE_TRANSACTION CREATE DATABASE test2; --error ER_LOCK_OR_ACTIVE_TRANSACTION ALTER DATABASE test2 CHARACTER SET latin2; --error ER_LOCK_OR_ACTIVE_TRANSACTION DROP DATABASE test2; UNLOCK TABLES; # # Table DDL with READ lock # LOCK TABLES t10 READ; # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t1(a int not null primary key); --error ER_LOCK_OR_ACTIVE_TRANSACTION RENAME TABLE t10 TO t2; # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t3 LIKE t10; --error ER_TABLE_NOT_LOCKED_FOR_WRITE ALTER TABLE t10 ADD COLUMN b int default NULL; --error ER_TABLE_NOT_LOCKED_FOR_WRITE TRUNCATE TABLE t10; # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t4 AS SELECT * FROM t10; --error ER_TABLE_NOT_LOCKED_FOR_WRITE DROP TABLE t10; UNLOCK TABLES; # # Table DDL with WRITE lock # LOCK TABLES t10 WRITE; # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t1(a int not null primary key); --error ER_LOCK_OR_ACTIVE_TRANSACTION RENAME TABLE t10 TO t2; # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t3 LIKE t10; --source ndb_init_schema_locks_count.inc ALTER TABLE t10 ADD COLUMN b int default NULL; --source ndb_schema_locks_count.inc --source ndb_init_schema_locks_count.inc TRUNCATE TABLE t10; --source ndb_schema_locks_count.inc # Catch 22, not possible to lock table until created --error ER_TABLE_NOT_LOCKED CREATE TABLE t4 AS SELECT * FROM t10; DROP TABLE t10; UNLOCK TABLES;