Commit 49ee18eb authored by Jan Lindström's avatar Jan Lindström

MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in cluster

In 10.5 If WSREP_ON=ON do not allow RELEASE_ALL_LOCKS function.
Instead print clear error message.
parent 696562ce
...@@ -15,5 +15,10 @@ ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluste ...@@ -15,5 +15,10 @@ ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluste
SHOW WARNINGS; SHOW WARNINGS;
Level Code Message Level Code Message
Error 1235 This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluster (WSREP_ON=ON)' Error 1235 This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluster (WSREP_ON=ON)'
SELECT RELEASE_ALL_LOCKS();
ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)'
SHOW WARNINGS;
Level Code Message
Error 1235 This version of MariaDB doesn't yet support 'RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)'
COMMIT; COMMIT;
DROP TABLE t; DROP TABLE t;
...@@ -9,6 +9,10 @@ SELECT * FROM t; ...@@ -9,6 +9,10 @@ SELECT * FROM t;
--error ER_NOT_SUPPORTED_YET --error ER_NOT_SUPPORTED_YET
SELECT RELEASE_LOCK('a'); SELECT RELEASE_LOCK('a');
SHOW WARNINGS; SHOW WARNINGS;
# New in 10.5
--error ER_NOT_SUPPORTED_YET
SELECT RELEASE_ALL_LOCKS();
SHOW WARNINGS;
COMMIT; COMMIT;
DROP TABLE t; DROP TABLE t;
...@@ -4843,6 +4843,13 @@ Create_func_release_all_locks Create_func_release_all_locks::s_singleton; ...@@ -4843,6 +4843,13 @@ Create_func_release_all_locks Create_func_release_all_locks::s_singleton;
Item* Item*
Create_func_release_all_locks::create_builder(THD *thd) Create_func_release_all_locks::create_builder(THD *thd)
{ {
#ifdef WITH_WSREP
if (WSREP_ON && WSREP(thd))
{
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)");
return NULL;
}
#endif /* WITH_WSREP */
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
return new (thd->mem_root) Item_func_release_all_locks(thd); return new (thd->mem_root) Item_func_release_all_locks(thd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment