mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 19:11:46 +01:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into polly.local:/home/kaa/src/maint/mysql-5.1-maint
This commit is contained in:
commit
332afaa7b6
3 changed files with 22 additions and 4 deletions
|
@ -39,6 +39,11 @@ delete t1 from t1,t3 where t1.a=t3.a;
|
|||
drop table t1;
|
||||
insert into t1 values(1);
|
||||
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
|
||||
drop temporary table ttt;
|
||||
ERROR 42S02: Unknown table 'ttt'
|
||||
drop temporary table if exists ttt;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 'ttt'
|
||||
drop table t1,t2;
|
||||
drop user test@localhost;
|
||||
set global read_only=0;
|
||||
|
|
|
@ -101,6 +101,18 @@ drop table t1;
|
|||
--error 1290
|
||||
insert into t1 values(1);
|
||||
|
||||
#
|
||||
# BUG #22077 "DROP TEMPORARY TABLE fails with wrong error if read_only is set"
|
||||
#
|
||||
# check if DROP TEMPORARY on a non-existing temporary table returns the right
|
||||
# error
|
||||
|
||||
--error ER_BAD_TABLE_ERROR
|
||||
drop temporary table ttt;
|
||||
|
||||
# check if DROP TEMPORARY TABLE IF EXISTS produces a warning with read_only set
|
||||
drop temporary table if exists ttt;
|
||||
|
||||
connection default;
|
||||
drop table t1,t2;
|
||||
drop user test@localhost;
|
||||
|
|
|
@ -2564,10 +2564,11 @@ mysql_execute_command(THD *thd)
|
|||
if (opt_readonly &&
|
||||
!(thd->security_ctx->master_access & SUPER_ACL) &&
|
||||
(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) &&
|
||||
!((lex->sql_command == SQLCOM_CREATE_TABLE) &&
|
||||
(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
|
||||
((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
|
||||
some_non_temp_table_to_be_updated(thd, all_tables)))
|
||||
!((lex->sql_command == SQLCOM_CREATE_TABLE) &&
|
||||
(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
|
||||
!((lex->sql_command == SQLCOM_DROP_TABLE) && lex->drop_temporary) &&
|
||||
((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
|
||||
some_non_temp_table_to_be_updated(thd, all_tables)))
|
||||
{
|
||||
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
|
||||
DBUG_RETURN(-1);
|
||||
|
|
Loading…
Add table
Reference in a new issue