403Webshell
Server IP : 172.67.216.182  /  Your IP : 162.158.106.97
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/mysql-test/suite/ndb/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb/t/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;

Youez - 2016 - github.com/yon3zu
LinuXploit