diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-09-29 16:03:02 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-09-29 16:03:02 +0300 |
commit | a10b63bf58795335b96281bfc22169c9b8613037 (patch) | |
tree | 09d4b117202c5df7985c84d6b5a30c4368dc6c72 /plugin | |
parent | 05abcd7e600ddc2dee280b000439ded2855ff772 (diff) | |
parent | f3bc4f49f7c02018cac2c721837f9d1f52e9fff0 (diff) | |
download | mariadb-git-a10b63bf58795335b96281bfc22169c9b8613037.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/feedback/feedback.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index 75e9a1e430e..a7bc1d3d60e 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -92,16 +92,18 @@ 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; const char *db= tables->db.str, *table= tables->alias.str; 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) @@ -109,7 +111,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); |