mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
1f6ecc0cd3
Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print()
53 lines
1.1 KiB
Text
53 lines
1.1 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
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
# 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;
|