Commit e4665f41 authored by Sergei Petrunia's avatar Sergei Petrunia Committed by Alexey Botchkov

MDEV-25202: JSON_TABLE: Early table reference leads to unexpected result set

Followup to review input address commit: pass the new parameter type
to find_field_in_table_ref().
parent a4353c25
...@@ -6966,8 +6966,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, ...@@ -6966,8 +6966,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
Field *f=find_field_in_table_ref(thd, table_list, column->column.ptr(), Field *f=find_field_in_table_ref(thd, table_list, column->column.ptr(),
column->column.length(), column->column.length(),
column->column.ptr(), NULL, NULL, column->column.ptr(), NULL, NULL,
table_map(0), NULL, TRUE, FALSE, ignored_tables_list_t(NULL), NULL,
&unused_field_idx, FALSE, &dummy); TRUE, FALSE, &unused_field_idx, FALSE,
&dummy);
if (unlikely(f == (Field*)0)) if (unlikely(f == (Field*)0))
{ {
my_error(ER_BAD_FIELD_ERROR, MYF(0), my_error(ER_BAD_FIELD_ERROR, MYF(0),
......
...@@ -99,7 +99,7 @@ static bool init_fields(THD *thd, TABLE_LIST *tables, ...@@ -99,7 +99,7 @@ static bool init_fields(THD *thd, TABLE_LIST *tables,
Lex_cstring_strlen(find_fields->table_name), Lex_cstring_strlen(find_fields->table_name),
Lex_cstring_strlen(find_fields->field_name))); Lex_cstring_strlen(find_fields->field_name)));
if (!(find_fields->field= find_field_in_tables(thd, field, tables, NULL, if (!(find_fields->field= find_field_in_tables(thd, field, tables, NULL,
table_map(0), ignored_tables_list_t(NULL),
0, REPORT_ALL_ERRORS, 1, 0, REPORT_ALL_ERRORS, 1,
TRUE))) TRUE)))
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -24522,8 +24522,8 @@ find_order_in_list(THD *thd, Ref_ptr_array ref_pointer_array, ...@@ -24522,8 +24522,8 @@ find_order_in_list(THD *thd, Ref_ptr_array ref_pointer_array,
order_item_type == Item::REF_ITEM) order_item_type == Item::REF_ITEM)
{ {
from_field= find_field_in_tables(thd, (Item_ident*) order_item, tables, from_field= find_field_in_tables(thd, (Item_ident*) order_item, tables,
NULL, table_map(0), &view_ref, NULL, ignored_tables_list_t(NULL),
IGNORE_ERRORS, FALSE, FALSE); &view_ref, IGNORE_ERRORS, FALSE, FALSE);
if (!from_field) if (!from_field)
from_field= (Field*) not_found_field; from_field= (Field*) not_found_field;
} }
......
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