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:
@ -250,27 +250,33 @@ static const char* BUILTIN_FUNCTIONS[] =
|
|||||||
* https://mariadb.com/kb/en/mariadb/miscellaneous-functions/
|
* https://mariadb.com/kb/en/mariadb/miscellaneous-functions/
|
||||||
*/
|
*/
|
||||||
"default",
|
"default",
|
||||||
"get_lock",
|
|
||||||
"inet6_aton",
|
"inet6_aton",
|
||||||
"inet6_ntoa",
|
"inet6_ntoa",
|
||||||
"inet_aton",
|
"inet_aton",
|
||||||
"inet_ntoa",
|
"inet_ntoa",
|
||||||
"is_free_lock",
|
|
||||||
"is_ipv4",
|
"is_ipv4",
|
||||||
"is_ipv4_compat",
|
"is_ipv4_compat",
|
||||||
"is_ipv4_mapped",
|
"is_ipv4_mapped",
|
||||||
"is_ipv6",
|
"is_ipv6",
|
||||||
"is_used_lock",
|
|
||||||
"last_value",
|
"last_value",
|
||||||
"master_gtid_wait",
|
"master_gtid_wait",
|
||||||
"master_pos_wait",
|
"master_pos_wait",
|
||||||
"name_const",
|
"name_const",
|
||||||
"release_lock",
|
|
||||||
"sleep",
|
"sleep",
|
||||||
"uuid",
|
"uuid",
|
||||||
"uuid_short",
|
"uuid_short",
|
||||||
"values",
|
"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
|
* Numeric Functions
|
||||||
* https://mariadb.com/kb/en/mariadb/numeric-functions/
|
* https://mariadb.com/kb/en/mariadb/numeric-functions/
|
||||||
|
|||||||
@ -19,3 +19,7 @@ QUERY_TYPE_READ|QUERY_TYPE_SYSVAR_READ
|
|||||||
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
|
QUERY_TYPE_READ|QUERY_TYPE_WRITE
|
||||||
|
|||||||
@ -19,3 +19,7 @@ select if(@@hostname='box02','prod_mariadb02','n');
|
|||||||
select next value for seq1;
|
select next value for seq1;
|
||||||
select nextval(seq1);
|
select nextval(seq1);
|
||||||
select seq1.nextval;
|
select seq1.nextval;
|
||||||
|
SELECT GET_LOCK('lock1',10);
|
||||||
|
SELECT IS_FREE_LOCK('lock1');
|
||||||
|
SELECT IS_USED_LOCK('lock1');
|
||||||
|
SELECT RELEASE_LOCK('lock1');
|
||||||
|
|||||||
Reference in New Issue
Block a user