mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
after merge fix of 577 task (SCRUM, pre commit to be able to merge with static tables optimization fix)
fixed derived tables with subselect inside
This commit is contained in:
@ -532,8 +532,9 @@ static bool mysql_test_upd_fields(PREP_STMT *stmt, TABLE_LIST *table_list,
|
||||
And send column list fields info back to client.
|
||||
*/
|
||||
static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
|
||||
uint wild_num,
|
||||
List<Item> &fields, COND *conds,
|
||||
ORDER *order, ORDER *group,
|
||||
uint og_num, ORDER *order, ORDER *group,
|
||||
Item *having, ORDER *proc,
|
||||
ulong select_options,
|
||||
SELECT_LEX_UNIT *unit,
|
||||
@ -545,7 +546,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
|
||||
DBUG_ENTER("mysql_test_select_fields");
|
||||
|
||||
if ((&lex->select_lex != lex->all_selects_list &&
|
||||
lex->unit.create_total_list(thd, lex, &tables)))
|
||||
lex->unit.create_total_list(thd, lex, &tables, 0)))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
if (open_and_lock_tables(thd, tables))
|
||||
@ -564,7 +565,8 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables,
|
||||
JOIN *join= new JOIN(thd, fields, select_options, result);
|
||||
thd->used_tables= 0; // Updated by setup_fields
|
||||
|
||||
if (join->prepare(tables, conds, order, group, having, proc,
|
||||
if (join->prepare(&select_lex->ref_pointer_array, tables,
|
||||
wild_num, conds, og_num, order, group, having, proc,
|
||||
select_lex, unit, 0))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
@ -623,9 +625,11 @@ static bool send_prepare_results(PREP_STMT *stmt)
|
||||
break;
|
||||
|
||||
case SQLCOM_SELECT:
|
||||
if (mysql_test_select_fields(stmt, tables,
|
||||
if (mysql_test_select_fields(stmt, tables, select_lex->with_wild,
|
||||
select_lex->item_list,
|
||||
select_lex->where,
|
||||
select_lex->order_list.elements +
|
||||
select_lex->group_list.elements,
|
||||
(ORDER*) select_lex->order_list.first,
|
||||
(ORDER*) select_lex->group_list.first,
|
||||
select_lex->having,
|
||||
|
Reference in New Issue
Block a user