mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge 4.1 to 5.0
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged client/mysql.cc: Auto merged client/mysqltest.c: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged include/mysql_com.h: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged myisam/myisamchk.c: Auto merged myisam/myisamdef.h: Auto merged myisam/sort.c: Auto merged mysql-test/install_test_db.sh: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisam.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/protocol.cc: Auto merged sql/protocol.h: Auto merged sql/protocol_cursor.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_error.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_list.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_select.h: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_test.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged
This commit is contained in:
@ -166,11 +166,23 @@ class JOIN :public Sql_alloc
|
||||
JOIN *tmp_join; // copy of this JOIN to be used with temporary tables
|
||||
ROLLUP rollup; // Used with rollup
|
||||
|
||||
bool select_distinct, //Is select distinct?
|
||||
no_order, simple_order, simple_group,
|
||||
skip_sort_order, need_tmp,
|
||||
hidden_group_fields,
|
||||
buffer_result;
|
||||
bool select_distinct; // Set if SELECT DISTINCT
|
||||
|
||||
/*
|
||||
simple_xxxxx is set if ORDER/GROUP BY doesn't include any references
|
||||
to other tables than the first non-constant table in the JOIN.
|
||||
It's also set if ORDER/GROUP BY is empty.
|
||||
*/
|
||||
bool simple_order, simple_group;
|
||||
/*
|
||||
Is set only in case if we have a GROUP BY clause
|
||||
and no ORDER BY after constant elimination of 'order'.
|
||||
*/
|
||||
bool no_order;
|
||||
/* Is set if we have a GROUP BY and we have ORDER BY on a constant. */
|
||||
bool skip_sort_order;
|
||||
|
||||
bool need_tmp, hidden_group_fields, buffer_result;
|
||||
DYNAMIC_ARRAY keyuse;
|
||||
Item::cond_result cond_value;
|
||||
List<Item> all_fields; // to store all fields that used in query
|
||||
@ -195,14 +207,14 @@ class JOIN :public Sql_alloc
|
||||
bool union_part; // this subselect is part of union
|
||||
bool optimized; // flag to avoid double optimization in EXPLAIN
|
||||
|
||||
JOIN(THD *thd_arg, List<Item> &fields, ulong select_options_arg,
|
||||
JOIN(THD *thd_arg, List<Item> &fields_arg, ulong select_options_arg,
|
||||
select_result *result_arg)
|
||||
:fields_list(fields)
|
||||
:fields_list(fields_arg)
|
||||
{
|
||||
init(thd_arg, fields, select_options_arg, result_arg);
|
||||
init(thd_arg, fields_arg, select_options_arg, result_arg);
|
||||
}
|
||||
|
||||
void init(THD *thd_arg, List<Item> &fields, ulong select_options_arg,
|
||||
void init(THD *thd_arg, List<Item> &fields_arg, ulong select_options_arg,
|
||||
select_result *result_arg)
|
||||
{
|
||||
join_tab= join_tab_save= 0;
|
||||
@ -235,8 +247,8 @@ class JOIN :public Sql_alloc
|
||||
hidden_group_fields= 0; /*safety*/
|
||||
buffer_result= test(select_options & OPTION_BUFFER_RESULT) &&
|
||||
!test(select_options & OPTION_FOUND_ROWS);
|
||||
all_fields= fields;
|
||||
fields_list= fields;
|
||||
all_fields= fields_arg;
|
||||
fields_list= fields_arg;
|
||||
error= 0;
|
||||
select= 0;
|
||||
ref_pointer_array= items0= items1= items2= items3= 0;
|
||||
@ -244,7 +256,7 @@ class JOIN :public Sql_alloc
|
||||
zero_result_cause= 0;
|
||||
optimized= 0;
|
||||
|
||||
fields_list= fields;
|
||||
fields_list= fields_arg;
|
||||
bzero((char*) &keyuse,sizeof(keyuse));
|
||||
tmp_table_param.copy_field=0;
|
||||
tmp_table_param.end_write_records= HA_POS_ERROR;
|
||||
@ -254,7 +266,7 @@ class JOIN :public Sql_alloc
|
||||
int prepare(Item ***rref_pointer_array, TABLE_LIST *tables, uint wind_num,
|
||||
COND *conds, uint og_num, ORDER *order, ORDER *group,
|
||||
Item *having, ORDER *proc_param, SELECT_LEX *select,
|
||||
SELECT_LEX_UNIT *unit, bool tables_and_fields_initied);
|
||||
SELECT_LEX_UNIT *unit);
|
||||
int optimize();
|
||||
int reinit();
|
||||
void exec();
|
||||
|
Reference in New Issue
Block a user