diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2019-12-03 15:46:49 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2019-12-03 15:46:49 +0300 |
commit | bf2f391664c56334ff9229e448bb3efa166c40b7 (patch) | |
tree | bf6abe329c9cbd904d24ce209945551152af8f72 /sql | |
parent | cef2b34f25b45198868be0c06e00a74a1c1ad062 (diff) | |
download | mariadb-git-bf2f391664c56334ff9229e448bb3efa166c40b7.tar.gz |
MDEV-21147 Assertion `marked_for_read()' upon UPDATE on versioned table via view
Unit prepare prematurely fixed field which must be fixed via
setup_conds() to correctly update table->covering_keys.
Call vers_setup_conds() directly instead, because actually everything
else is not needed.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_derived.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 652353fb722..9d6748937ad 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -707,8 +707,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) case SQLCOM_DELETE_MULTI: case SQLCOM_UPDATE: case SQLCOM_UPDATE_MULTI: - if ((res= unit->prepare(derived, derived->derived_result, 0))) + if ((res= unit->first_select()->vers_setup_conds(thd, derived->merge_underlying_list))) goto exit; + derived->where= and_items(thd, derived->where, derived->merge_underlying_list->where); default: break; } |