MXS-1591 Mark GET_LOCK(...) et.al. as WRITE

The follwing statements

    SELECT GET_LOCK('lock1',10);
    SELECT IS_FREE_LOCK('lock1');
    SELECT IS_USED_LOCK('lock1');
    SELECT RELEASE_LOCK('lock1');

are now classified as QUERY_TYPE_READ|QUERY_TYPE_WRITE. That will
make cooperative locking work if these functions are used inside
non-read-only transactions and outside transanctions.
This commit is contained in:
Johan Wikman
2018-01-29 15:15:57 +02:00
parent 0db538db9a
commit ef1ec2e524
3 changed files with 18 additions and 4 deletions

View File

@ -250,27 +250,33 @@ static const char* BUILTIN_FUNCTIONS[] =
* https://mariadb.com/kb/en/mariadb/miscellaneous-functions/
*/
"default",
"get_lock",
"inet6_aton",
"inet6_ntoa",
"inet_aton",
"inet_ntoa",
"is_free_lock",
"is_ipv4",
"is_ipv4_compat",
"is_ipv4_mapped",
"is_ipv6",
"is_used_lock",
"last_value",
"master_gtid_wait",
"master_pos_wait",
"name_const",
"release_lock",
"sleep",
"uuid",
"uuid_short",
"values",
/**
* Although conceptually non-updating, we classify these as WRITE as
* that will force them to be sent to _master_ outside transactions.
*
* "get_lock",
* "is_free_lock",
* "is_used_lock",
* "release_lock",
*/
/*
* Numeric Functions
* https://mariadb.com/kb/en/mariadb/numeric-functions/