403Webshell
Server IP : 88.99.149.37  /  Your IP : 216.73.216.141
Web Server : nginx/1.31.2
System : Linux server-88-99-149-37 6.12.0-124.56.5.el10_1.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 06:12:08 EDT 2026 x86_64
User : muralimurth ( 1015)
PHP Version : 8.4.23
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/mysql/mysql-test/main/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/mysql/mysql-test/main/tablelock.test
--source include/have_innodb.inc

#
# Test of lock tables
#

--disable_warnings
drop table if exists t1,t2;
--enable_warnings

create table t1 ( n int auto_increment primary key);
lock tables t1 write;
insert into t1 values(NULL);
unlock tables;
check table t1;
lock tables t1 write, t1 as t0 read;
insert into t1 values(NULL);
unlock tables;
check table t1;
lock tables t1 write, t1 as t0 read, t1 as t2 read;
insert into t1 values(NULL);
unlock tables;
check table t1;
lock tables t1 write, t1 as t0 write, t1 as t2 read;
insert into t1 values(NULL);
unlock tables;
check table t1;
lock tables t1 write, t1 as t0 write, t1 as t2 read, t1 as t3 read;
insert into t1 values(NULL);
unlock tables;
check table t1;
lock tables t1 write, t1 as t0 write, t1 as t2 write;
insert into t1 values(NULL);
unlock tables;
check table t1;
drop table t1;

#
# Test of locking and delete of files
#

CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
drop table t1,t2;

CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
lock tables t1 write,t1 as b write, t2 write, t2 as c read;
drop table t2,t1;
unlock tables;

# End of 4.1 tests

#
# Bug#23588 SHOW COLUMNS on a temporary table causes locking issues
#
create temporary table t1(f1 int);
lock tables t1 write;
insert into t1 values (1);
show columns from t1;
insert into t1 values(2);
drop table t1;
unlock tables;

# End of 5.0 tests


--echo #
--echo # Bug#19988193 ASSERTION `(*TABLES)->REGINFO.LOCK_TYPE >= TL_READ'
--echo # FAILED IN LOCK_EXTERNAL
--echo #

CREATE TABLE t1(a INT);
CREATE PROCEDURE p1() CREATE VIEW v1 AS SELECT * FROM t1;
--echo
--echo # Create trigger calling proc creating view, when view DOES NOT
--echo # exist already
CREATE TRIGGER trg_p1_t1 AFTER INSERT ON t1 FOR EACH ROW CALL p1();
--echo
--echo # Verify that it is possible to lock table
LOCK TABLES t1 WRITE;
UNLOCK TABLES;
--echo
--echo # Fails, as expected
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
INSERT INTO t1 VALUES (1);
--echo
--echo # Make sure v1 already exists
CREATE VIEW v1 AS SELECT a+1 FROM t1;
--echo
--echo # Verify that it is possible to lock table
LOCK TABLES t1 WRITE;
UNLOCK TABLES;
--echo
--echo # Verify that we get the expected error when inserting into the table
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
INSERT INTO t1 VALUES (1);
--echo
--echo # Cleanup
DROP TRIGGER trg_p1_t1;
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1;


--echo #
--echo # Bug#21198646 ASSERTION FAILED: (*TABLES)->REGINFO.LOCK_TYPE >= TL_READ
--echo # FILE LOCK.CC, LINE 356
--echo #

CREATE TABLE t2(a INT);

--echo # Create procedure p1 invoking RENAME TABLE
CREATE PROCEDURE p1() RENAME TABLE t2 TO t3;

--echo # Create function f1 calling p1
DELIMITER $;
CREATE FUNCTION f1() RETURNS INT BEGIN CALL p1(); RETURN 1; END $
DELIMITER ;$

--echo # Invoke function f1 and verify that we get the expected error
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
SELECT f1();

--echo # Cleanup
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP TABLE t2;

--echo #
--echo # MDEV-16686 DDL in procedure propagates no locking to tables locked by DML
--echo #
create table t (i int);
create view v as select * from t;
create procedure p() create view v as select * from t;
create trigger tr after insert on t for each row call p();
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
insert into t values (1), (2);

# cleanup
drop procedure p;
drop view v;
drop table t;

CREATE TABLE t (a INT);
CREATE PROCEDURE p() RENAME TABLE t TO t2;
CREATE TRIGGER tt AFTER INSERT ON t FOR EACH ROW CALL p();
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
INSERT INTO t VALUES (0);
drop procedure p;
drop table t;

--echo # End of 10.11 tests

Youez - 2016 - github.com/yon3zu
LinuXploit