mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-136 Non-blocking "set read_only".
Handle the 'set read_only=1' in lighter way, than the FLUSH TABLES READ LOCK; For the transactional engines we don't wait for operations on that tables to finish. per-file comments: mysql-test/r/read_only_innodb.result MDEV-136 Non-blocking "set read_only". test result updated. mysql-test/t/read_only_innodb.test MDEV-136 Non-blocking "set read_only". test case added. sql/mysql_priv.h MDEV-136 Non-blocking "set read_only". The close_cached_tables_set_readonly() declared. sql/set_var.cc MDEV-136 Non-blocking "set read_only". Call close_cached_tables_set_readonly() for the read_only::set_var. sql/sql_base.cc MDEV-136 Non-blocking "set read_only". Parameters added to the close_cached_tables implementation, close_cached_tables_set_readonly declared. Prevent blocking on the transactional tables if the set_readonly_mode is on.
This commit is contained in:
@ -75,7 +75,36 @@ BEGIN;
|
||||
SELECT * FROM t1;
|
||||
COMMIT;
|
||||
|
||||
#
|
||||
# Tests that LOCK TABLE doesn't block the SET READ_ONLY=1 for the InnoDB tables
|
||||
#
|
||||
|
||||
connection default;
|
||||
UNLOCK TABLES;
|
||||
FLUSH STATUS;
|
||||
--echo # Expected 0 at the beginning of the test
|
||||
show status like 'Opened_tables';
|
||||
|
||||
--echo connection con1;
|
||||
connection con1;
|
||||
lock table t1 write;
|
||||
|
||||
--echo connection default;
|
||||
connection default;
|
||||
set global read_only=1;
|
||||
--echo # Expected 1 as the slow_log was reopened
|
||||
show status like 'Opened_tables';
|
||||
|
||||
--echo connection con1;
|
||||
connection con1;
|
||||
unlock tables;
|
||||
|
||||
--echo connection default;
|
||||
connection default;
|
||||
SET GLOBAL read_only=0;
|
||||
--echo # Expected 2 as the slow_log was reopened
|
||||
show status like 'Opened_tables';
|
||||
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
DROP USER test@localhost;
|
||||
|
Reference in New Issue
Block a user