mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Added option --read-only (Thanks to Markus Benning)
myisam/myisamchk.c: Removed warning from fulltext when repairing many tables with fulltext index sql/init.cc: Remove not used variables sql/mysql_priv.h: Remove not used variables sql/mysqld.cc: Removed not used variables Added option --read-only Change opt_do_pstack and master_ssl to get them to work with my_getopt sql/set_var.cc: Option --read-only sql/sql_parse.cc: Option --read-only
This commit is contained in:
@ -1329,6 +1329,18 @@ mysql_execute_command(void)
|
||||
(table_rules_on && tables && thd->slave_thread &&
|
||||
!tables_ok(thd,tables)))
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
/*
|
||||
When option readonly is set deny operations which change tables.
|
||||
Except for the replication thread and the 'super' users.
|
||||
*/
|
||||
if (opt_readonly &&
|
||||
!(thd->slave_thread || (thd->master_access & SUPER_ACL)) &&
|
||||
(uc_update_queries[lex->sql_command] > 0))
|
||||
{
|
||||
send_error(&thd->net,ER_CANT_UPDATE_WITH_READLOCK);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
statistic_increment(com_stat[lex->sql_command],&LOCK_status);
|
||||
switch (lex->sql_command) {
|
||||
|
Reference in New Issue
Block a user