diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2023-01-26 14:34:12 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2023-01-27 08:39:32 +0200 |
commit | 844ddb1109410e0ab1d4444549932f1dddb7b845 (patch) | |
tree | c152889f2d060bd0cf634581e32bd333fd88d1a7 /sql | |
parent | 765291d63e0c2a10c513a354e9ecb2e905570775 (diff) | |
download | mariadb-git-844ddb1109410e0ab1d4444549932f1dddb7b845.tar.gz |
MDEV-30473 : Do not allow GET_LOCK() / RELEASE_LOCK() in cluster
If WSREP_ON=ON do not allow GET_LOCK and RELEASE_LOCK functions.
Instead print clear error message.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_create.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc index 2dfbc1d2021..9fc43df2aea 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -4933,6 +4933,13 @@ Create_func_get_lock Create_func_get_lock::s_singleton; Item* Create_func_get_lock::create_2_arg(THD *thd, Item *arg1, Item *arg2) { +#ifdef WITH_WSREP + if (WSREP_ON && WSREP(thd)) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), "GET_LOCK in cluster (WSREP_ON=ON)"); + return NULL; + } +#endif /* WITH_WSREP */ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); return new (thd->mem_root) Item_func_get_lock(thd, arg1, arg2); @@ -6535,6 +6542,13 @@ Create_func_release_lock Create_func_release_lock::s_singleton; Item* Create_func_release_lock::create_1_arg(THD *thd, Item *arg1) { +#ifdef WITH_WSREP + if (WSREP_ON && WSREP(thd)) + { + my_error(ER_NOT_SUPPORTED_YET, MYF(0), "RELEASE_LOCK in cluster (WSREP_ON=ON)"); + return NULL; + } +#endif /* WITH_WSREP */ thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); return new (thd->mem_root) Item_func_release_lock(thd, arg1); |