summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorRinat Ibragimov <ri@tempesta-tech.com>2020-10-21 23:34:36 +0300
committerMonty <monty@mariadb.org>2020-10-22 00:18:33 +0300
commit709ba7dcae871e365697f67677c908b55ad4a964 (patch)
treedde2860dddbc468d6f1a4484b8e109baff7226a5 /sql/sql_class.h
parentac8d20579512e05001f9bf8193187e47c870d35a (diff)
downloadmariadb-git-709ba7dcae871e365697f67677c908b55ad4a964.tar.gz
MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure
MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure | SIGSEGV in I_P_List from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized builds) | Assertion `ticket->m_duration == MDL_EXPLICIT' failed BACKUP LOCK behavior is modified so it won't be used wrong: - BACKUP LOCK should commit any active transactions. - BACKUP LOCK should not be allowed in stored procedures. - When BACKUP LOCK is active, don't allow any DDL's for that connection. - FTWRL is forbidden on the same connection while BACKUP LOCK is active. Reviewed-by: monty@mariadb.com
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 64cd1ed6ba3..6f07cc0037f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3630,10 +3630,17 @@ public:
return server_status & SERVER_STATUS_IN_TRANS;
}
void give_protection_error();
+ /*
+ Give an error if any of the following is true for this connection
+ - BACKUP STAGE is active
+ - FLUSH TABLE WITH READ LOCK is active
+ - BACKUP LOCK table_name is active
+ */
inline bool has_read_only_protection()
{
if (current_backup_stage == BACKUP_FINISHED &&
- !global_read_lock.is_acquired())
+ !global_read_lock.is_acquired() &&
+ !mdl_backup_lock)
return FALSE;
give_protection_error();
return TRUE;