From 2224fe96801f110aace07e73baacceea40ad007e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Feb 2002 14:10:11 +0200 Subject: Fixing some bugs in UNION's --- sql/sql_union.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0d8a41e9966..51ad2425022 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -76,6 +76,12 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) for (sl= &lex->select_lex; sl; sl=sl->next) { lex->select=sl; + thd->offset_limit=sl->offset_limit; + thd->select_limit=sl->select_limit+sl->offset_limit; + if (thd->select_limit < sl->select_limit) + thd->select_limit= HA_POS_ERROR; // no limit + if (thd->select_limit == HA_POS_ERROR) + sl->options&= ~OPTION_FOUND_ROWS; res=mysql_select(thd, (TABLE_LIST*) sl->table_list.first, sl->item_list, sl->where, -- cgit v1.2.1 From 143a179f3c1c4cca5b61979bb1a24b2053057ae0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2002 14:05:47 +0200 Subject: Porting surgical changes from 4.0 to 4.1 --- sql/sql_union.cc | 58 +++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 51ad2425022..60155e0ce8d 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -31,10 +31,11 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) ORDER *order; List item_list; TABLE *table; + int describe=(lex->select_lex.options & SELECT_DESCRIBE) ? 1 : 0; + int res; TABLE_LIST result_table_list; TMP_TABLE_PARAM tmp_table_param; select_union *union_result; - int res; DBUG_ENTER("mysql_union"); /* Fix tables 'to-be-unioned-from' list to point at opened tables */ @@ -70,33 +71,26 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) lex_sl=0; order=0; } - - if (lex->select_lex.options & SELECT_DESCRIBE) + + if (describe) { - for (sl= &lex->select_lex; sl; sl=sl->next) - { - lex->select=sl; - thd->offset_limit=sl->offset_limit; - thd->select_limit=sl->select_limit+sl->offset_limit; - if (thd->select_limit < sl->select_limit) - thd->select_limit= HA_POS_ERROR; // no limit - if (thd->select_limit == HA_POS_ERROR) - sl->options&= ~OPTION_FOUND_ROWS; - res=mysql_select(thd, (TABLE_LIST*) sl->table_list.first, - sl->item_list, - sl->where, - ((sl->braces) ? - (ORDER *) sl->order_list.first : (ORDER *) 0), - (ORDER*) sl->group_list.first, - sl->having, - (ORDER*) NULL, - (sl->options | thd->options | SELECT_NO_UNLOCK | - SELECT_DESCRIBE), - result); - } - DBUG_RETURN(0); + Item *item; + item_list.push_back(new Item_empty_string("table",NAME_LEN)); + item_list.push_back(new Item_empty_string("type",10)); + item_list.push_back(item=new Item_empty_string("possible_keys", + NAME_LEN*MAX_KEY)); + item->maybe_null=1; + item_list.push_back(item=new Item_empty_string("key",NAME_LEN)); + item->maybe_null=1; + item_list.push_back(item=new Item_int("key_len",0,3)); + item->maybe_null=1; + item_list.push_back(item=new Item_empty_string("ref", + NAME_LEN*MAX_REF_PARTS)); + item->maybe_null=1; + item_list.push_back(new Item_real("rows",0.0,0,10)); + item_list.push_back(new Item_empty_string("Extra",255)); } - + else { Item *item; List_iterator it(lex->select_lex.item_list); @@ -113,7 +107,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); tmp_table_param.field_count=item_list.elements; if (!(table=create_tmp_table(thd, &tmp_table_param, item_list, - (ORDER*) 0, !lex->union_option, + (ORDER*) 0, !describe & !lex->union_option, 1, 0, (lex->select_lex.options | thd->options | TMP_TABLE_ALL_COLUMNS)))) @@ -130,7 +124,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) res= -1; goto exit; } - for (sl= &lex->select_lex; sl; sl=sl->next) + union_result->save_time_stamp=!describe; + + for (sl=&lex->select_lex;sl;sl=sl->next) { thd->offset_limit=sl->offset_limit; thd->select_limit=sl->select_limit+sl->offset_limit; @@ -146,7 +142,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) (ORDER*) sl->group_list.first, sl->having, (ORDER*) NULL, - sl->options | thd->options | SELECT_NO_UNLOCK, + sl->options | thd->options | SELECT_NO_UNLOCK | ((describe) ? SELECT_DESCRIBE : 0), union_result); if (res) goto exit; @@ -187,6 +183,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) if (thd->select_limit == HA_POS_ERROR) thd->options&= ~OPTION_FOUND_ROWS; } + if (describe) + thd->select_limit= HA_POS_ERROR; // no limit res=mysql_select(thd,&result_table_list, item_list, NULL, /*ftfunc_list,*/ order, (ORDER*) NULL, NULL, (ORDER*) NULL, @@ -222,7 +220,7 @@ select_union::~select_union() int select_union::prepare(List &list) { - if (list.elements != table->fields) + if (save_time_stamp && list.elements != table->fields) { my_message(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT, ER(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT),MYF(0)); -- cgit v1.2.1 From 53bd33c676a4b87e3170ea06f9ff75cdbff48507 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Mar 2002 14:21:06 +0200 Subject: making full-text working with UNION's --- sql/sql_union.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 60155e0ce8d..7d921d6e598 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -126,7 +126,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) } union_result->save_time_stamp=!describe; - for (sl=&lex->select_lex;sl;sl=sl->next) + for (sl=lex->select=&lex->select_lex;sl;sl=lex->select=sl->next) { thd->offset_limit=sl->offset_limit; thd->select_limit=sl->select_limit+sl->offset_limit; @@ -155,6 +155,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) delete union_result; /* Send result to 'result' */ + lex->select = &lex->select_lex; res =-1; { /* Create a list of fields in the temporary table */ -- cgit v1.2.1 From af87d92aa29ebaabf3aa78d8c7a0e8afc53db2d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Mar 2002 14:23:11 +0200 Subject: Some changes from 4.0. Take a look their for details --- sql/sql_union.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 7d921d6e598..7532f43a663 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -184,6 +184,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) if (thd->select_limit == HA_POS_ERROR) thd->options&= ~OPTION_FOUND_ROWS; } + else + thd->select_limit= HA_POS_ERROR; // no limit if (describe) thd->select_limit= HA_POS_ERROR; // no limit res=mysql_select(thd,&result_table_list, -- cgit v1.2.1 From 2ec108107db299b3984a06746388798acbd95b0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Mar 2002 15:06:05 +0200 Subject: Derived tables ! mysql-test/r/union.result: small bug fixes in unions BitKeeper/etc/ignore: Added Docs/manual.texi.orig Docs/manual.texi.rej to the ignore list mysql-test/t/union.test: test for a bug fix in union's sql/sql_union.cc: bug fix for unions --- sql/sql_union.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 7532f43a663..1658fa701c5 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -126,8 +126,9 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) } union_result->save_time_stamp=!describe; - for (sl=lex->select=&lex->select_lex;sl;sl=lex->select=sl->next) + for (sl= &lex->select_lex; sl; sl=sl->next) { + lex->select=sl; thd->offset_limit=sl->offset_limit; thd->select_limit=sl->select_limit+sl->offset_limit; if (thd->select_limit < sl->select_limit) @@ -185,7 +186,10 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) thd->options&= ~OPTION_FOUND_ROWS; } else - thd->select_limit= HA_POS_ERROR; // no limit + { + thd->offset_limit= 0; + thd->select_limit= thd->default_select_limit; + } if (describe) thd->select_limit= HA_POS_ERROR; // no limit res=mysql_select(thd,&result_table_list, -- cgit v1.2.1 From 2c62a868a60058a8664dcf3e45cdd86b41635ddd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 May 2002 00:04:16 +0300 Subject: new SELECT_LEX structure mysql-test/r/derived.result: derived table bug test mysql-test/t/derived.test: derived table bug test sql/mysql_priv.h: new mysql_new_select call & layout fixing sql/sql_class.h: passing unit as parameter of Table_ident constructor sql/sql_lex.cc: new SELECT_LEX structure methods sql/sql_lex.h: new SELECT_LEX structure definition sql/table.h: fixed layout --- sql/sql_union.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index c8237f3ae9b..7178b857bbc 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -43,8 +43,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) /* Fix tables 'to-be-unioned-from' list to point at opened tables */ last_sl= &lex->select_lex; for (sl= last_sl; - sl && sl->linkage != NOT_A_SELECT; - last_sl=sl, sl=sl->next) + sl && sl->linkage != GLOBAL_OPTIONS_TYPE; + last_sl= sl, sl= (SELECT_LEX *) sl->next) { for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first; cursor; @@ -133,7 +133,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) } union_result->save_time_stamp=!describe; - for (sl= &lex->select_lex; sl; sl=sl->next) + for (sl= &lex->select_lex; sl; sl= (SELECT_LEX*) sl->next) { lex->select=sl; thd->offset_limit=sl->offset_limit; @@ -143,15 +143,19 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) if (thd->select_limit == HA_POS_ERROR) sl->options&= ~OPTION_FOUND_ROWS; - res=mysql_select(thd, (describe && sl->linkage==NOT_A_SELECT) ? first_table : (TABLE_LIST*) sl->table_list.first, - sl->item_list, - sl->where, - (sl->braces) ? (ORDER *)sl->order_list.first : (ORDER *) 0, - (ORDER*) sl->group_list.first, - sl->having, - (ORDER*) NULL, - sl->options | thd->options | SELECT_NO_UNLOCK | ((describe) ? SELECT_DESCRIBE : 0), - union_result); + res= mysql_select(thd, + (describe && sl->linkage==GLOBAL_OPTIONS_TYPE) ? + first_table : (TABLE_LIST*) sl->table_list.first, + sl->item_list, + sl->where, + (sl->braces) ? + (ORDER *)sl->order_list.first : (ORDER *) 0, + (ORDER*) sl->group_list.first, + sl->having, + (ORDER*) NULL, + sl->options | thd->options | + SELECT_NO_UNLOCK | ((describe) ? SELECT_DESCRIBE : 0), + union_result); if (res) goto exit; } -- cgit v1.2.1 From 6ff06df2333d90021cb10a27f9285586908ee542 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 May 2002 23:14:40 +0300 Subject: new SELECT_LEX structures used for storing global ORDER BY, global LIMIT & limit counters mysql-test/r/union.result: correct result of union explain command --- sql/sql_union.cc | 102 ++++++++++++++++++++++--------------------------------- 1 file changed, 40 insertions(+), 62 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 7178b857bbc..2eae37a70eb 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -27,8 +27,8 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) { - SELECT_LEX *sl, *last_sl, *lex_sl; - ORDER *order; + SELECT_LEX *sl; + SELECT_LEX_UNIT *unit= &(lex->unit); List item_list; TABLE *table; int describe=(lex->select_lex.options & SELECT_DESCRIBE) ? 1 : 0; @@ -39,12 +39,12 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) TMP_TABLE_PARAM tmp_table_param; select_union *union_result; DBUG_ENTER("mysql_union"); + st_select_lex_node * global; /* Fix tables 'to-be-unioned-from' list to point at opened tables */ - last_sl= &lex->select_lex; - for (sl= last_sl; - sl && sl->linkage != GLOBAL_OPTIONS_TYPE; - last_sl= sl, sl= (SELECT_LEX *) sl->next) + for (sl= &lex->select_lex; + sl; + sl= (SELECT_LEX *) sl->next) { for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first; cursor; @@ -52,31 +52,13 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) cursor->table= ((TABLE_LIST*) cursor->table)->table; } - /* last_sel now points at the last select where the ORDER BY is stored */ - if (sl) + /* Global option */ + if (((void*)(global= unit->global_parameters)) == ((void*)unit)) { - /* - The found SL is an extra SELECT_LEX argument that contains - the ORDER BY and LIMIT parameter for the whole UNION - */ - lex_sl= sl; - order= (ORDER *) lex_sl->order_list.first; - found_rows_for_union = lex->select_lex.options & OPTION_FOUND_ROWS && !describe && sl->select_limit; + found_rows_for_union = lex->select_lex.options & OPTION_FOUND_ROWS && + !describe && global->select_limit; if (found_rows_for_union) lex->select_lex.options ^= OPTION_FOUND_ROWS; -// This is done to eliminate unnecessary slowing down of the first query - if (!order || !describe) - last_sl->next=0; // Remove this extra element - } - else if (!last_sl->braces) - { - lex_sl= last_sl; // ORDER BY is here - order= (ORDER *) lex_sl->order_list.first; - } - else - { - lex_sl=0; - order=0; } if (describe) @@ -113,11 +95,12 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) bzero((char*) &tmp_table_param,sizeof(tmp_table_param)); tmp_table_param.field_count=item_list.elements; - if (!(table=create_tmp_table(thd, &tmp_table_param, item_list, - (ORDER*) 0, !describe & !lex->union_option, - 1, 0, - (lex->select_lex.options | thd->options | - TMP_TABLE_ALL_COLUMNS)))) + if (!(table= create_tmp_table(thd, &tmp_table_param, item_list, + (ORDER*) 0, !describe & !lex->union_option, + 1, 0, + (lex->select_lex.options | thd->options | + TMP_TABLE_ALL_COLUMNS), + unit))) DBUG_RETURN(-1); table->file->extra(HA_EXTRA_WRITE_CACHE); table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); @@ -136,11 +119,11 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) for (sl= &lex->select_lex; sl; sl= (SELECT_LEX*) sl->next) { lex->select=sl; - thd->offset_limit=sl->offset_limit; - thd->select_limit=sl->select_limit+sl->offset_limit; - if (thd->select_limit < sl->select_limit) - thd->select_limit= HA_POS_ERROR; // no limit - if (thd->select_limit == HA_POS_ERROR) + unit->offset_limit_cnt= sl->offset_limit; + unit->select_limit_cnt= sl->select_limit+sl->offset_limit; + if (unit->select_limit_cnt < sl->select_limit) + unit->select_limit_cnt= HA_POS_ERROR; // no limit + if (unit->select_limit_cnt == HA_POS_ERROR) sl->options&= ~OPTION_FOUND_ROWS; res= mysql_select(thd, @@ -155,7 +138,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) (ORDER*) NULL, sl->options | thd->options | SELECT_NO_UNLOCK | ((describe) ? SELECT_DESCRIBE : 0), - union_result); + union_result, unit); if (res) goto exit; } @@ -187,26 +170,20 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) } if (!thd->fatal_error) // Check if EOM { - if (lex_sl) - { - thd->offset_limit=lex_sl->offset_limit; - thd->select_limit=lex_sl->select_limit+lex_sl->offset_limit; - if (thd->select_limit < lex_sl->select_limit) - thd->select_limit= HA_POS_ERROR; // no limit - if (thd->select_limit == HA_POS_ERROR) - thd->options&= ~OPTION_FOUND_ROWS; - } - else - { - thd->offset_limit= 0; - thd->select_limit= thd->default_select_limit; - } + st_select_lex_node * global= unit->global_parameters; + unit->offset_limit_cnt= global->offset_limit; + unit->select_limit_cnt= global->select_limit+global->offset_limit; + if (unit->select_limit_cnt < global->select_limit) + unit->select_limit_cnt= HA_POS_ERROR; // no limit + if (unit->select_limit_cnt == HA_POS_ERROR) + thd->options&= ~OPTION_FOUND_ROWS; if (describe) - thd->select_limit= HA_POS_ERROR; // no limit - res=mysql_select(thd,&result_table_list, - item_list, NULL, (describe) ? 0 : order, - (ORDER*) NULL, NULL, (ORDER*) NULL, - thd->options, result); + unit->select_limit_cnt= HA_POS_ERROR; // no limit + res= mysql_select(thd,&result_table_list, + item_list, NULL, + (describe) ? 0 : (ORDER*)global->order_list.first, + (ORDER*) NULL, NULL, (ORDER*) NULL, + thd->options, result, unit); if (found_rows_for_union && !res) thd->limit_found_rows = (ulonglong)table->file->records; } @@ -230,7 +207,7 @@ select_union::select_union(TABLE *table_par) We can always use DUP_IGNORE because the temporary table will only contain a unique key if we are using not using UNION ALL */ - info.handle_duplicates=DUP_IGNORE; + info.handle_duplicates= DUP_IGNORE; } select_union::~select_union() @@ -238,8 +215,9 @@ select_union::~select_union() } -int select_union::prepare(List &list) +int select_union::prepare(List &list, SELECT_LEX_UNIT *u) { + unit= u; if (save_time_stamp && list.elements != table->fields) { my_message(ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT, @@ -251,9 +229,9 @@ int select_union::prepare(List &list) bool select_union::send_data(List &values) { - if (thd->offset_limit) + if (unit->offset_limit_cnt) { // using limit offset,count - thd->offset_limit--; + unit->offset_limit_cnt--; return 0; } fill_record(table->field,values); -- cgit v1.2.1 From 510a4d1da1578c240a37328e82f2dbaae1a7bfc3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 May 2002 12:12:17 +0300 Subject: removed fake description (EXPLAIN) of first table for last SELECT_LEX with global parameters, because now it is absent --- sql/sql_union.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 2eae37a70eb..d821c6f6641 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -35,7 +35,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) int res; bool found_rows_for_union=false; TABLE_LIST result_table_list; - TABLE_LIST *first_table=(TABLE_LIST *)lex->select_lex.table_list.first; TMP_TABLE_PARAM tmp_table_param; select_union *union_result; DBUG_ENTER("mysql_union"); @@ -127,8 +126,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) sl->options&= ~OPTION_FOUND_ROWS; res= mysql_select(thd, - (describe && sl->linkage==GLOBAL_OPTIONS_TYPE) ? - first_table : (TABLE_LIST*) sl->table_list.first, + (TABLE_LIST*) sl->table_list.first, sl->item_list, sl->where, (sl->braces) ? -- cgit v1.2.1 From b69d8dab20811845e41c9f5c770125fd2f3b1a2f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 May 2002 15:23:57 +0300 Subject: total table list managment is changed sql/sql_lex.cc: tabllist creation routine moved to SELECT_LEX_UNION class & made recursive sql/sql_lex.h: list creation routine moved to SELECT_LEX_UNION class sql/sql_parse.cc: list creation routine moved to SELECT_LEX_UNION class anonymous union used for storing TABLE*/TABLE_LIST* sql/sql_union.cc: anonymous union used for storing TABLE*/TABLE_LIST* sql/table.h: anonymous union used for storing TABLE*/TABLE_LIST* --- sql/sql_union.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index d821c6f6641..ef34af6fe1e 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -48,7 +48,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first; cursor; cursor=cursor->next) - cursor->table= ((TABLE_LIST*) cursor->table)->table; + cursor->table= cursor->table_list->table; } /* Global option */ -- cgit v1.2.1 From 044cbe42ac583969f8339f6974f90e4430371536 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 12 May 2002 23:46:42 +0300 Subject: simple subselects ported to new select_lex structures include/mysqld_error.h: simple subselects libmysqld/Makefile.am: simple subselects sql/Makefile.am: simple subselects sql/item.h: simple subselects sql/item_strfunc.h: simple subselects sql/share/czech/errmsg.txt: simple subselects sql/share/danish/errmsg.txt: simple subselects sql/share/dutch/errmsg.txt: simple subselects sql/share/english/errmsg.txt: simple subselects sql/share/estonian/errmsg.txt: simple subselects sql/share/french/errmsg.txt: simple subselects sql/share/german/errmsg.txt: simple subselects sql/share/greek/errmsg.txt: simple subselects sql/share/hungarian/errmsg.txt: simple subselects sql/share/italian/errmsg.txt: simple subselects sql/share/japanese/errmsg.txt: simple subselects sql/share/korean/errmsg.txt: simple subselects sql/share/norwegian-ny/errmsg.txt: simple subselects sql/share/norwegian/errmsg.txt: simple subselects sql/share/polish/errmsg.txt: simple subselects sql/share/portuguese/errmsg.txt: simple subselects sql/share/romanian/errmsg.txt: simple subselects sql/share/russian/errmsg.txt: simple subselects sql/share/slovak/errmsg.txt: simple subselects sql/share/spanish/errmsg.txt: simple subselects sql/share/swedish/errmsg.txt: simple subselects sql/share/ukrainian/errmsg.txt: simple subselects sql/sql_class.cc: simple subselects sql/sql_class.h: simple subselects sql/sql_lex.cc: simple subselects sql/sql_select.cc: simple subselects sql/sql_select.h: simple subselects sql/sql_union.cc: simple subselects sql/sql_yacc.yy: simple subselects --- sql/sql_union.cc | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index ef34af6fe1e..b5db593a234 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -40,17 +40,6 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) DBUG_ENTER("mysql_union"); st_select_lex_node * global; - /* Fix tables 'to-be-unioned-from' list to point at opened tables */ - for (sl= &lex->select_lex; - sl; - sl= (SELECT_LEX *) sl->next) - { - for (TABLE_LIST *cursor= (TABLE_LIST *)sl->table_list.first; - cursor; - cursor=cursor->next) - cursor->table= cursor->table_list->table; - } - /* Global option */ if (((void*)(global= unit->global_parameters)) == ((void*)unit)) { -- cgit v1.2.1 From 807b50855c4db0759aa93b84881c2559c24d01d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 May 2002 20:52:54 +0300 Subject: Hiding internal pointers of SELECT_LEX structures --- sql/sql_union.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index b5db593a234..585b5de11ab 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -104,7 +104,7 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) } union_result->save_time_stamp=!describe; - for (sl= &lex->select_lex; sl; sl= (SELECT_LEX*) sl->next) + for (sl= &lex->select_lex; sl; sl= sl->next_select()) { lex->select=sl; unit->offset_limit_cnt= sl->offset_limit; -- cgit v1.2.1 From 5a28c2caca888be932140d12f87c496398ad4220 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Oct 2002 13:33:08 +0300 Subject: Fixes and code cleanups after merge with 4.0.3 Warning handling and initial prepared statement handling (last not complete yet) Changed a lot of functions that returned 0/1 to my_bool type. GRANT handling now uses read/write locks instead of mutex Change basic net functions to use THD instead of NET (needed for 4.1 protocol) Use my_sprintf instead of sprintf() + strlen() Added alloc_query() to be able to chare query initialization code with prepared statements. Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID() Note that the following test fails (will be fixed ASAP): sub_select, union, rpl_rotate_logs and rpl_mystery22 BitKeeper/deleted/.del-README~3449730baf983117: Delete: mysql-test/t/README BitKeeper/deleted/.del-sql_error.cc~2f1caca8d2485dbe: Delete: libmysqld/sql_error.cc BitKeeper/deleted/.del-sql_prepare.cc~f703729793935ed6: Delete: libmysqld/sql_prepare.cc Docs/manual.texi: Updated variable list client/mysql.cc: Show warning count to user. client/mysqltest.c: Add warnings to test results configure.in: New shared library version number include/errmsg.h: Indentation cleanup include/mysql.h: Removed MYSQL_ERROR Indentaion cleanups include/mysql_com.h: Changed functions to returns true/false to my_bool. include/mysqld_error.h: New error messages isam/pack_isam.c: Indentation change libmysql/Makefile.am: Fix of wrong merge libmysql/Makefile.shared: Indentation cleanup libmysql/errmsg.c: Removed not used errors libmysql/libmysql.c: Change functions to return 1 on error (not -1) Change type of functions that returns 0/1 to my_bool Lot of code optimizations. Lot of changes for prepared statements. This now handles sending of binary data to server. Receving of binary data is not yet done (will have to wait until server code for this is ready) mysql_warning_count and mysql_warnings() implemented. libmysql/libmysql.def: Added mysql_warnings and mysql_warning_count libmysql/manager.c: Fixed wrong testing of result from my_connect() libmysqld/lib_sql.cc: Removed global variable THR_NET Change basic net functions to use THD instead of NET GRANT handling now uses read/write locks instead of mutex libmysqld/libmysqld.c: Changed functions to be my_bool myisam/ft_boolean_search.c: Trivial code cleanup myisam/ft_stopwords.c: Trivial code cleanup myisam/mi_check.c: Update to 4.1 structures myisam/myisampack.c: Trivial code cleanup myisam/rt_key.c: Code cleanup myisam/rt_test.c: Code cleanup Removed compiler warnings myisam/sp_key.c: Indentation changes myisam/sp_test.c: Removed compiler warnings mysql-test/README: Updated to reflect the new --external flag. mysql-test/mysql-test-run.sh: --local (start new server) is now default. Use --external to test against external server. mysql-test/r/rollback.result: Updated for 4.1 warnings mysql-test/r/rpl_log.result: Update for 4.1 mysql-test/t/rollback.test: Updated for 4.1 warnings mysql-test/t/rpl_log_pos.test: Portability fix mysys/hash.c: Indentation change mysys/my_error.c: Indentation change mysys/tree.c: Updated file description sql/field.cc: Fixed bugs introduced by merge Use my_sprintf instead of sprintf() + strlen() sql/field.h: Add CHARSET_INFO to field structure sql/gstream.h: Indentation changes. Added GPL copyright header sql/ha_innodb.cc: Updated parameters for net functions. sql/item.cc: Updates of Item_param Indentation changes sql/item.h: Removed size_of() function from item. sql/item_func.cc: Update function usage for 4.1 Added get_system_var() sql/item_func.h: Indentation change sql/item_strfunc.cc: Removed not needed inclusion of gstream.h Update to use system variables (from 4.0) sql/item_sum.h: Removed size_of() functions from item. sql/item_timefunc.cc: Change sprintf() + strlen() -> my_sprintf() Added length parameter to ->append() sql/item_timefunc.h: Removed size_of() functions from item. sql/item_uniq.h: Removed size_of() functions from item. sql/lex.h: Removed SQL_ERROR_COUNT variable sql/log.cc: Change sprintf() + strlen() -> my_sprintf() sql/log_event.cc: Change sprintf() + strlen() -> my_sprintf() sql/mini_client.cc: Added check that one always specifies a length to mc_mysql_query() sql/mysql_priv.h: New prototypes Change of NET -> THD parameter for net functions. sql/mysqld.cc: New startup options: 'max_prepared_statements', 'max_error_count' Updated usage of net functions. sql/net_pkg.cc: Change basic net functions to use THD instead of NET (needed to be able to handle 4.0 and 4.1 protocols) Lots of function comments sql/net_serv.cc: Change int return values -> my_bool Updated net_write_command() to take an extra header block to be added to the packet. (This made the prepared statement code much nicer and more efficient) sql/repl_failsafe.cc: Update net functions to use THD instead of NET sql/set_var.cc: Added @@error_count and @@warning_count variables. Updated to 4.1 function usage sql/set_var.h: Added @@error_count and @@warning_count variables. sql/share/czech/errmsg.txt: Removed Warning: from warning error messages. sql/share/english/errmsg.txt: Removed Warning: from warning error messages. sql/share/greek/errmsg.txt: Removed Warning: from warning error messages. sql/share/hungarian/errmsg.txt: Removed Warning: from warning error messages. sql/share/japanese/errmsg.txt: Removed Warning: from warning error messages. sql/share/korean/errmsg.txt: Removed Warning: from warning error messages. sql/share/norwegian-ny/errmsg.txt: Removed Warning: from warning error messages. sql/share/norwegian/errmsg.txt: Removed Warning: from warning error messages. sql/share/polish/errmsg.txt: Removed Warning: from warning error messages. sql/share/romanian/errmsg.txt: Removed Warning: from warning error messages. sql/share/slovak/errmsg.txt: Removed Warning: from warning error messages. sql/share/swedish/errmsg.txt: Removed Warning: from warning error messages. sql/slave.cc: Change basic net functions to use THD instead of NET skip_load_data_file recoded to fit new client/server protocol sql/spatial.h: Added copyright header Indentation cleanups sql/sql_acl.cc: Change basic net functions to use THD instead of NET GRANT handling now uses read/write locks instead of mutex sql/sql_analyse.cc: Change basic net functions to use THD instead of NET sprintf() + strlen() -> my_sprintf() sql/sql_base.cc: More DBUG statements sql/sql_class.cc: Change basic net functions to use THD instead of NET warning and prepared statement handling sql/sql_class.h: Change basic net functions to use THD instead of NET warning and prepared statement handling sql/sql_db.cc: Code cleanup & optimization. sql/sql_delete.cc: Change basic net functions to use THD instead of NET sql/sql_derived.cc: Change basic net functions to use THD instead of NET sql/sql_do.cc: Change basic net functions to use THD instead of NET sql/sql_error.cc: Big rewrite of error handling. sql/sql_handler.cc: Change basic net functions to use THD instead of NET sql/sql_insert.cc: Change basic net functions to use THD instead of NET sql/sql_lex.cc: Change basic net functions to use THD instead of NET sql/sql_lex.h: Added param_count to st_select_lex_node sql/sql_list.h: Removed not needed error list. sql/sql_load.cc: Change basic net functions to use THD instead of NET sql/sql_parse.cc: Change basic net functions to use THD instead of NET Added alloc_query() to be able to chare query initialization code with prepared statements. Update of warning handling. Added create_select_for_variable() (for SHOW COUNT(*) WARNINGS) sql/sql_prepare.cc: Initial prepared statement handling sql/sql_rename.cc: Change basic net functions to use THD instead of NET sql/sql_repl.cc: Change basic net functions to use THD instead of NET sql/sql_select.cc: Small code cleanups Added missing initialization of error that caused some queries that returned an empty result set to fail sql/sql_select.h: Ensure that JOIN.error is properly initialized sql/sql_show.cc: Change basic net functions to use THD instead of NET A lot of optimization sql/sql_table.cc: Change basic net functions to use THD instead of NET Indentaion cleanup sql/sql_udf.cc: Change basic net functions to use THD instead of NET sql/sql_union.cc: Change basic net functions to use THD instead of NET sql/sql_update.cc: Change basic net functions to use THD instead of NET sql/sql_yacc.yy: Change basic net functions to use THD instead of NET Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID() sql/structs.h: Moved structures to files where they was used sql/table.cc: Don't accept empty database names sql/uniques.cc: Indentation cleanup sql/unireg.cc: Change basic net functions to use THD instead of NET sql/unireg.h: Added defaults for warnings and prepared statements strings/ctype-simple.c: optimization tests/client_test.c: Fixed wrong paramaters to printf() --- sql/sql_union.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 51f278536de..8244384cc94 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -242,7 +242,7 @@ bool select_union::flush() if ((error=table->file->extra(HA_EXTRA_NO_CACHE))) { table->file->print_error(error,MYF(0)); - ::send_error(&thd->net); + ::send_error(thd); return 1; } return 0; -- cgit v1.2.1