summaryrefslogtreecommitdiff
path: root/plugin/feedback/feedback.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 09:04:43 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 09:04:43 +0300
commit064cb58efea063595e336e4cd0feccb12d26f8cf (patch)
treef140b96c8a20172cbb484375e38a7aa481ab660b /plugin/feedback/feedback.cc
parente5a9dcfda20e174525ad63a30e12f592aa9c96d3 (diff)
parent57fdd016ce6167c15ba9cd41048b8a42ba582447 (diff)
downloadmariadb-git-064cb58efea063595e336e4cd0feccb12d26f8cf.tar.gz
Merge 10.4 into 10.5
FIXME: Part of the MDEV-20699 test is disabled due to nonderterministic result.
Diffstat (limited to 'plugin/feedback/feedback.cc')
-rw-r--r--plugin/feedback/feedback.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index eb3f562f329..3b2e95f1e13 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -92,17 +92,19 @@ static COND * const OOM= (COND*)1;
static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
{
Item_cond_or *res= NULL;
- Name_resolution_context nrc;
+ /* A reference to this context will be stored in Item_field */
+ Name_resolution_context *nrc= new (thd->mem_root) Name_resolution_context;
LEX_CSTRING &db= tables->db;
LEX_CSTRING &table= tables->alias;
LEX_CSTRING &field= tables->table->field[0]->field_name;
CHARSET_INFO *cs= &my_charset_latin1;
- if (!filter->str)
+ if (!filter->str || !nrc)
return 0;
- nrc.init();
- nrc.resolve_in_table_list_only(tables);
+ nrc->init();
+ nrc->resolve_in_table_list_only(tables);
+ nrc->select_lex= tables->select_lex;
res= new (thd->mem_root) Item_cond_or(thd);
if (!res)
@@ -110,7 +112,7 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
for (; filter->str; filter++)
{
- Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table,
+ Item_field *fld= new (thd->mem_root) Item_field(thd, nrc, db, table,
field);
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
(uint) filter->length, cs);