diff options
author | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-07-17 16:36:55 +0530 |
---|---|---|
committer | Rucha Deodhar <rucha.deodhar@mariadb.com> | 2021-07-22 21:56:18 +0530 |
commit | 5518c3209b2505108cc7732f2ef94334573d4c27 (patch) | |
tree | a628c17d26659fecd34493d84e467bf887432b56 /sql/sql_base.h | |
parent | 091743c6d88986dc10ff7b1bd2ff3a644739ac0f (diff) | |
download | mariadb-git-5518c3209b2505108cc7732f2ef94334573d4c27.tar.gz |
MDEV-23178: Qualified asterisk not supported in INSERT .. RETURNING
Analysis: When we have INSERT/REPLACE returning with qualified asterisk in the
RETURNING clause, '*' is not resolved properly because of wrong context.
context->table_list is NULL or has incorrect table because context->table_list
has tables from the FROM clause. For INSERT/REPLACE...SELECT...RETURNING,
context->table_list has table we are inserting from. While in other
INSERT/REPLACE syntax, context->table_list is NULL because there is no FROM
clause.
Fix: If filling fields instead of '*' for qualified asterisk in RETURNING,
use first_name_resolution_table for correct resolution of item.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r-- | sql/sql_base.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h index 0c90a95b5b0..79f54dfe1ed 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -176,11 +176,11 @@ bool fill_record_n_invoke_before_triggers(THD *thd, TABLE *table, bool insert_fields(THD *thd, Name_resolution_context *context, const char *db_name, const char *table_name, List_iterator<Item> *it, bool any_privileges, - uint *hidden_bit_fields); + uint *hidden_bit_fields, bool returning_field); void make_leaves_list(THD *thd, List<TABLE_LIST> &list, TABLE_LIST *tables, bool full_table_list, TABLE_LIST *boundary); int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields, - List<Item> *sum_func_list, SELECT_LEX *sl); + List<Item> *sum_func_list, SELECT_LEX *sl, bool returning_field); int setup_returning_fields(THD* thd, TABLE_LIST* table_list); bool setup_fields(THD *thd, Ref_ptr_array ref_pointer_array, List<Item> &item, enum_column_usage column_usage, |