diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-12-14 18:25:08 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-12-19 11:44:42 +0100 |
commit | a587ded283d8abd1f20258b283911abe759f5f64 (patch) | |
tree | d9c40466c58df8661bd11de698b4eee101cfac30 /sql/sql_derived.cc | |
parent | 5785de72ac85ba37eda837c691aaf9a9195ba45d (diff) | |
download | mariadb-git-a587ded283d8abd1f20258b283911abe759f5f64.tar.gz |
MDEV-24346 valgrind error in main.precedence
in queries like
create view v1 as select 2 like 1 escape (3 in (select 0 union select 1));
select 2 union select * from v1;
Item_func_like::escape was left uninitialized, because
Item_in_optimizer is const_during_execution()
but not actually const_item() during execution.
It's not, because const subquery evaluation was disabled for derived.
Practically it only needs to be disabled for multi-update
that runs fix_fields() before all tables are locked.
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 33f323b86a0..be5905da683 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -738,14 +738,12 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) !(derived->derived_result= new (thd->mem_root) select_union(thd))) DBUG_RETURN(TRUE); // out of memory - lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_DERIVED; // st_select_lex_unit::prepare correctly work for single select if ((res= unit->prepare(thd, derived->derived_result, 0))) goto exit; if (derived->with && (res= derived->with->rename_columns_of_derived_unit(thd, unit))) goto exit; - lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_DERIVED; if ((res= check_duplicate_names(thd, unit->types, 0))) goto exit; |