mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 00:54:30 +02:00
Bug#12329653 - EXPLAIN, UNION, PREPARED STATEMENT, CRASH, SQL_FULL_GROUP_BY
The query was re-written *after* we had tagged it with NON_AGG_FIELD_USED. Remove the flag before continuing. mysql-test/r/explain.result: Update test case for Bug#48295. mysql-test/r/subselect.result: New test case. mysql-test/t/explain.test: Update test case for Bug#48295. mysql-test/t/subselect.test: New test case. sql/item.cc: Use accessor functions for non_agg_field_used/agg_func_used. sql/item_subselect.cc: Remove non_agg_field_used when we rewrite query '1 < some (...)' => '1 < max(...)' sql/item_sum.cc: Use accessor functions for non_agg_field_used/agg_func_used. sql/mysql_priv.h: Remove unused #defines. sql/sql_lex.cc: Initialize new member variables. sql/sql_lex.h: Replace full_group_by_flag with two boolean flags, and itroduce accessors for manipulating them. sql/sql_select.cc: Use accessor functions for non_agg_field_used/agg_func_used.
This commit is contained in:
parent
3b52208fe1
commit
1cf483aa58
11 changed files with 110 additions and 38 deletions
|
|
@ -936,6 +936,14 @@ Item_in_subselect::single_value_transformer(JOIN *join,
|
|||
it.replace(item);
|
||||
}
|
||||
|
||||
DBUG_EXECUTE("where",
|
||||
print_where(item, "rewrite with MIN/MAX"););
|
||||
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
|
||||
{
|
||||
DBUG_ASSERT(select_lex->non_agg_field_used());
|
||||
select_lex->set_non_agg_field_used(false);
|
||||
}
|
||||
|
||||
save_allow_sum_func= thd->lex->allow_sum_func;
|
||||
thd->lex->allow_sum_func|= 1 << thd->lex->current_select->nest_level;
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue