Added detection for USE <db> (= DATABASE()), which is a system function which changes session variable. Therefore it must be treted as SESION write and executed in both master and slave.
This commit is contained in:
parent
a8c630f581
commit
89de86320e
@ -568,7 +568,15 @@ static skygw_query_type_t resolve_query_type(
|
||||
pthread_self())));
|
||||
break;
|
||||
case Item_func::UNKNOWN_FUNC:
|
||||
func_qtype = QUERY_TYPE_READ;
|
||||
if (strncmp(item->name, "DATABASE()", 10) == 0)
|
||||
{
|
||||
/** 'USE <db' */
|
||||
func_qtype = QUERY_TYPE_SESSION_WRITE;
|
||||
}
|
||||
else
|
||||
{
|
||||
func_qtype = QUERY_TYPE_READ;
|
||||
}
|
||||
/**
|
||||
* Many built-in functions are of this
|
||||
* type, for example, rand(), soundex(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user