BUG#25250768: WRITING ON A READ_ONLY=ON SERVER WITHOUT SUPER PRIVILEGE
simplify. add a test case.
This commit is contained in:
parent
f6bcdb9e3c
commit
9b3360ea44
@ -30,6 +30,8 @@ create temporary table t3 (a int);
|
||||
create temporary table t4 (a int) select * from t3;
|
||||
insert into t3 values(1);
|
||||
insert into t4 select * from t3;
|
||||
create table t3 (a int);
|
||||
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
||||
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
|
||||
update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;
|
||||
|
@ -80,6 +80,9 @@ insert into t3 values(1);
|
||||
|
||||
insert into t4 select * from t3;
|
||||
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
create table t3 (a int);
|
||||
|
||||
# a non-temp table updated:
|
||||
--error ER_OPTION_PREVENTS_STATEMENT
|
||||
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
|
||||
|
@ -835,24 +835,16 @@ static my_bool deny_updates_if_read_only_option(THD *thd,
|
||||
if (lex->sql_command == SQLCOM_UPDATE_MULTI)
|
||||
DBUG_RETURN(FALSE);
|
||||
|
||||
const my_bool create_temp_tables=
|
||||
(lex->sql_command == SQLCOM_CREATE_TABLE) &&
|
||||
(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE);
|
||||
/*
|
||||
a table-to-be-created is not in the temp table list yet,
|
||||
so CREATE TABLE needs a special treatment
|
||||
*/
|
||||
const bool update_real_tables=
|
||||
lex->sql_command == SQLCOM_CREATE_TABLE
|
||||
? !(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)
|
||||
: some_non_temp_table_to_be_updated(thd, all_tables);
|
||||
|
||||
const my_bool create_real_tables=
|
||||
(lex->sql_command == SQLCOM_CREATE_TABLE) &&
|
||||
!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE);
|
||||
|
||||
const my_bool drop_temp_tables=
|
||||
(lex->sql_command == SQLCOM_DROP_TABLE) &&
|
||||
lex->drop_temporary;
|
||||
|
||||
const my_bool update_real_tables=
|
||||
((create_real_tables ||
|
||||
some_non_temp_table_to_be_updated(thd, all_tables)) &&
|
||||
!(create_temp_tables || drop_temp_tables));
|
||||
|
||||
const my_bool create_or_drop_databases=
|
||||
const bool create_or_drop_databases=
|
||||
(lex->sql_command == SQLCOM_CREATE_DB) ||
|
||||
(lex->sql_command == SQLCOM_DROP_DB);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user