MXS-2095: Fix crash on GRANT CREATE TEMPORARY TABLE
The avrorouter classified the GRANT statement as a CREATE TABLE statement.
This commit is contained in:
@ -37,6 +37,11 @@ int main(int argc, char *argv[])
|
|||||||
test.set_timeout(120);
|
test.set_timeout(120);
|
||||||
test.repl->connect();
|
test.repl->connect();
|
||||||
|
|
||||||
|
// MXS-2095: Crash on GRANT CREATE TABLE
|
||||||
|
execute_query(test.repl->nodes[0], "CREATE USER test IDENTIFIED BY 'test'");
|
||||||
|
execute_query(test.repl->nodes[0], "GRANT CREATE TEMPORARY TABLES ON *.* TO test");
|
||||||
|
execute_query(test.repl->nodes[0], "DROP USER test");
|
||||||
|
|
||||||
create_t1(test.repl->nodes[0]);
|
create_t1(test.repl->nodes[0]);
|
||||||
insert_into_t1(test.repl->nodes[0], 3);
|
insert_into_t1(test.repl->nodes[0], 3);
|
||||||
execute_query(test.repl->nodes[0], "FLUSH LOGS");
|
execute_query(test.repl->nodes[0], "FLUSH LOGS");
|
||||||
|
|||||||
@ -59,9 +59,9 @@ static const char* avro_index_name = "avro.index";
|
|||||||
|
|
||||||
/** For detection of CREATE/ALTER TABLE statements */
|
/** For detection of CREATE/ALTER TABLE statements */
|
||||||
static const char* create_table_regex =
|
static const char* create_table_regex =
|
||||||
"(?i)create[a-z0-9[:space:]_]+table";
|
"(?i)^[[:space:]]*create[a-z0-9[:space:]_]+table";
|
||||||
static const char* alter_table_regex =
|
static const char* alter_table_regex =
|
||||||
"(?i)alter[[:space:]]+table";
|
"(?i)^[[:space:]]*alter[[:space:]]+table";
|
||||||
|
|
||||||
/* The router entry points */
|
/* The router entry points */
|
||||||
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
|
||||||
|
|||||||
Reference in New Issue
Block a user