mirror of
https://github.com/MariaDB/server.git
synced 2025-09-03 20:43:11 +03:00
A pre-requisite patch for the fix for Bug#52044.
This patch also fixes Bug#55452 "SET PASSWORD is replicated twice in RBR mode". The goal of this patch is to remove the release of metadata locks from close_thread_tables(). This is necessary to not mistakenly release the locks in the course of a multi-step operation that involves multiple close_thread_tables() or close_tables_for_reopen(). On the same token, move statement commit outside close_thread_tables(). Other cleanups: Cleanup COM_FIELD_LIST. Don't call close_thread_tables() in COM_SHUTDOWN -- there are no open tables there that can be closed (we leave the locked tables mode in THD destructor, and this close_thread_tables() won't leave it anyway). Make open_and_lock_tables() and open_and_lock_tables_derived() call close_thread_tables() upon failure. Remove the calls to close_thread_tables() that are now unnecessary. Simplify the back off condition in Open_table_context. Streamline metadata lock handling in LOCK TABLES implementation. Add asserts to ensure correct life cycle of statement transaction in a session. Remove a piece of dead code that has also become redundant after the fix for Bug 37521.
This commit is contained in:
@@ -1677,3 +1677,25 @@ SET @@sql_quote_show_create = @sql_quote_show_create_saved;
|
||||
|
||||
# End of Bug#34828.
|
||||
|
||||
# Make sure we can manipulate with autocommit in the
|
||||
# along with other variables.
|
||||
drop table if exists t1;
|
||||
drop function if exists t1_max;
|
||||
drop function if exists t1_min;
|
||||
create table t1 (a int) engine=innodb;
|
||||
insert into t1(a) values (0), (1);
|
||||
create function t1_max() returns int return (select max(a) from t1);
|
||||
create function t1_min() returns int return (select min(a) from t1);
|
||||
select t1_min();
|
||||
t1_min()
|
||||
0
|
||||
select t1_max();
|
||||
t1_max()
|
||||
1
|
||||
set @@session.autocommit=t1_min(), @@session.autocommit=t1_max(),
|
||||
@@session.autocommit=t1_min(), @@session.autocommit=t1_max(),
|
||||
@@session.autocommit=t1_min(), @@session.autocommit=t1_max();
|
||||
# Cleanup.
|
||||
drop table t1;
|
||||
drop function t1_min;
|
||||
drop function t1_max;
|
||||
|
@@ -1955,15 +1955,15 @@ CHECK TABLE v1, v2, v3, v4, v5, v6;
|
||||
Table Op Msg_type Msg_text
|
||||
test.v1 check Error FUNCTION test.f1 does not exist
|
||||
test.v1 check Error View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
test.v1 check status Operation failed
|
||||
test.v1 check error Corrupt
|
||||
test.v2 check status OK
|
||||
test.v3 check Error FUNCTION test.f1 does not exist
|
||||
test.v3 check Error View 'test.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
test.v3 check status Operation failed
|
||||
test.v3 check error Corrupt
|
||||
test.v4 check status OK
|
||||
test.v5 check Error FUNCTION test.f1 does not exist
|
||||
test.v5 check Error View 'test.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
test.v5 check status Operation failed
|
||||
test.v5 check error Corrupt
|
||||
test.v6 check status OK
|
||||
create function f1 () returns int return (select max(col1) from t1);
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user