mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into narttu.mysql.fi:/my/mysql-4.1 sql/sql_select.cc: Auto merged sql/unireg.cc: Auto merged
This commit is contained in:
@@ -296,7 +296,7 @@ protected:
|
|||||||
|
|
||||||
select_result *result;
|
select_result *result;
|
||||||
int res;
|
int res;
|
||||||
ulong describe, found_rows_for_union;
|
ulong found_rows_for_union;
|
||||||
bool prepared, // prepare phase already performed for UNION (unit)
|
bool prepared, // prepare phase already performed for UNION (unit)
|
||||||
optimized, // optimize phase already performed for UNION (unit)
|
optimized, // optimize phase already performed for UNION (unit)
|
||||||
executed, // already executed
|
executed, // already executed
|
||||||
|
@@ -862,7 +862,8 @@ JOIN::optimize()
|
|||||||
We only need to do this when we have a simple_order or simple_group
|
We only need to do this when we have a simple_order or simple_group
|
||||||
as in other cases the join is done before the sort.
|
as in other cases the join is done before the sort.
|
||||||
*/
|
*/
|
||||||
if ((order || group_list) && join_tab[const_tables].type != JT_ALL &&
|
if (const_tables != tables &&
|
||||||
|
(order || group_list) && join_tab[const_tables].type != JT_ALL &&
|
||||||
join_tab[const_tables].type != JT_FT &&
|
join_tab[const_tables].type != JT_FT &&
|
||||||
(order && simple_order || group_list && simple_group))
|
(order && simple_order || group_list && simple_group))
|
||||||
{
|
{
|
||||||
|
@@ -377,11 +377,12 @@ int st_select_lex_unit::exec()
|
|||||||
offset_limit_cnt= global_parameters->offset_limit;
|
offset_limit_cnt= global_parameters->offset_limit;
|
||||||
select_limit_cnt= global_parameters->select_limit +
|
select_limit_cnt= global_parameters->select_limit +
|
||||||
global_parameters->offset_limit;
|
global_parameters->offset_limit;
|
||||||
|
|
||||||
if (select_limit_cnt < global_parameters->select_limit)
|
if (select_limit_cnt < global_parameters->select_limit)
|
||||||
select_limit_cnt= HA_POS_ERROR; // no limit
|
select_limit_cnt= HA_POS_ERROR; // no limit
|
||||||
if (select_limit_cnt == HA_POS_ERROR)
|
if (select_limit_cnt == HA_POS_ERROR)
|
||||||
options&= ~OPTION_FOUND_ROWS;
|
options&= ~OPTION_FOUND_ROWS;
|
||||||
else if (found_rows_for_union && !describe)
|
else if (found_rows_for_union && !thd->lex.describe)
|
||||||
options|= OPTION_FOUND_ROWS;
|
options|= OPTION_FOUND_ROWS;
|
||||||
fake_select_lex->ftfunc_list= &empty_list;
|
fake_select_lex->ftfunc_list= &empty_list;
|
||||||
fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
|
fake_select_lex->table_list.link_in_list((byte *)&result_table_list,
|
||||||
|
Reference in New Issue
Block a user