Skip to content

Commit 49ee18e

Browse files
committed
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.
1 parent 696562c commit 49ee18e

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

mysql-test/suite/galera/r/galera_locks_funcs.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluste
1515
SHOW WARNINGS;
1616
Level Code Message
1717
Error 1235 This version of MariaDB doesn't yet support 'RELEASE_LOCK in cluster (WSREP_ON=ON)'
18+
SELECT RELEASE_ALL_LOCKS();
19+
ERROR 42000: This version of MariaDB doesn't yet support 'RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)'
20+
SHOW WARNINGS;
21+
Level Code Message
22+
Error 1235 This version of MariaDB doesn't yet support 'RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)'
1823
COMMIT;
1924
DROP TABLE t;

mysql-test/suite/galera/t/galera_locks_funcs.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ SELECT * FROM t;
99
--error ER_NOT_SUPPORTED_YET
1010
SELECT RELEASE_LOCK('a');
1111
SHOW WARNINGS;
12+
# New in 10.5
13+
--error ER_NOT_SUPPORTED_YET
14+
SELECT RELEASE_ALL_LOCKS();
15+
SHOW WARNINGS;
1216
COMMIT;
1317
DROP TABLE t;
1418

sql/item_create.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4843,6 +4843,13 @@ Create_func_release_all_locks Create_func_release_all_locks::s_singleton;
48434843
Item*
48444844
Create_func_release_all_locks::create_builder(THD *thd)
48454845
{
4846+
#ifdef WITH_WSREP
4847+
if (WSREP_ON && WSREP(thd))
4848+
{
4849+
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "RELEASE_ALL_LOCKS in cluster (WSREP_ON=ON)");
4850+
return NULL;
4851+
}
4852+
#endif /* WITH_WSREP */
48464853
thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
48474854
thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT);
48484855
return new (thd->mem_root) Item_func_release_all_locks(thd);

0 commit comments

Comments
 (0)