diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-30 11:04:27 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-30 11:04:27 +0300 |
commit | 6da14d7b4a935466de55a6aa87db14bc359dbd30 (patch) | |
tree | a2d1a73a6bf6bbe0dab2857fd87fa782969412f4 /sql/sql_select.cc | |
parent | 4783494a5e21939424ecca92bf23d2df65528266 (diff) | |
parent | 2e1d10ecacc8ccfc0bda8a199c741ee36df981be (diff) | |
download | mariadb-git-6da14d7b4a935466de55a6aa87db14bc359dbd30.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ee74cfa8e97..568a3ed6062 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1029,10 +1029,16 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables) if (vers_conditions.is_set()) { + if (vers_conditions.was_set() && + table->lock_type > TL_READ_NO_INSERT && + !vers_conditions.delete_history) + { + my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0), table->alias.str); + DBUG_RETURN(-1); + } + if (vers_conditions.type == SYSTEM_TIME_ALL) continue; - - lock_type= TL_READ; // ignore TL_WRITE, history is immutable anyway } bool timestamps_only= table->table->versioned(VERS_TIMESTAMP); |