Commit 216fdb15 authored by Dave Gosselin's avatar Dave Gosselin Committed by Dave Gosselin

MDEV-33971 fix --view-protocol test failure

Allow the NAME_CONST unwrap optimization when the client is not
in the PREPARE step of prepared statement nor in the view
analysis mode.
parent a938503c
...@@ -2214,8 +2214,9 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref) ...@@ -2214,8 +2214,9 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
*/ */
if ((thd->where == THD_WHERE::WHERE_CLAUSE || if ((thd->where == THD_WHERE::WHERE_CLAUSE ||
thd->where == THD_WHERE::ON_CLAUSE) && thd->where == THD_WHERE::ON_CLAUSE) &&
(value_item->type() == FUNC_ITEM || (value_item->type() == CONST_ITEM ||
value_item->type() == CONST_ITEM)) value_item->type() == FUNC_ITEM) &&
!thd->lex->is_ps_or_view_context_analysis())
{ {
thd->change_item_tree(ref, value_item); thd->change_item_tree(ref, value_item);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment