mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
3446199d8e
client/mysqltest.c: Fixed bug that comments did a ping include/thr_lock.h: Added function to abort a lock for a specific thread mysql-test/mysql-test-run.sh: Fixed where mysqltest traces are put mysql-test/r/lock_multi.result: Test for LOCK TABLE + DROP TABLE bug mysql-test/t/lock_multi.test: Test for LOCK TABLE + DROP TABLE bug mysys/thr_lock.c: Added function to abort a lock for a specific thread sql/handler.cc: Indentation cleanup sql/lock.cc: Added function to abort a lock for a specific thread sql/mysql_priv.h: Added function to abort a lock for a specific thread sql/mysqld.cc: Use automatic recover even with --safe
70 lines
1.5 KiB
Text
70 lines
1.5 KiB
Text
# This test doesn't work with the embedded version as this code
|
|
# assumes that one query is running while we are doing queries on
|
|
# a second connection.
|
|
# This would work if mysqltest run would be threaded and handle each
|
|
# connection in a separate thread.
|
|
#
|
|
-- source include/not_embedded.inc
|
|
|
|
drop table if exists t1,t2;
|
|
|
|
# test to see if select will get the lock ahead of low priority update
|
|
|
|
connect (locker,localhost,root,,);
|
|
connect (reader,localhost,root,,);
|
|
connect (writer,localhost,root,,);
|
|
|
|
connection locker;
|
|
create table t1(n int);
|
|
insert into t1 values (1);
|
|
lock tables t1 write;
|
|
connection writer;
|
|
send update low_priority t1 set n = 4;
|
|
connection reader;
|
|
--sleep 2
|
|
send select n from t1;
|
|
connection locker;
|
|
--sleep 2
|
|
unlock tables;
|
|
connection writer;
|
|
reap;
|
|
connection reader;
|
|
reap;
|
|
drop table t1;
|
|
|
|
connection locker;
|
|
create table t1(n int);
|
|
insert into t1 values (1);
|
|
lock tables t1 read;
|
|
connection writer;
|
|
send update low_priority t1 set n = 4;
|
|
connection reader;
|
|
--sleep 2
|
|
send select n from t1;
|
|
connection locker;
|
|
--sleep 2
|
|
unlock tables;
|
|
connection writer;
|
|
reap;
|
|
connection reader;
|
|
reap;
|
|
drop table t1;
|
|
|
|
#
|
|
# Test problem when using locks on many tables and droping a table that
|
|
# is to-be-locked by another thread
|
|
#
|
|
|
|
connection locker;
|
|
create table t1 (a int);
|
|
create table t2 (a int);
|
|
lock table t1 write, t2 write;
|
|
connection reader;
|
|
send insert t1 select * from t2;
|
|
connection locker;
|
|
drop table t2;
|
|
connection reader;
|
|
--error 1146
|
|
reap;
|
|
connection locker;
|
|
drop table t1;
|