1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

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
This commit is contained in:
unknown
2002-05-07 00:04:16 +03:00
parent 234dc3a35e
commit 2c62a868a6
11 changed files with 372 additions and 111 deletions

View File

@@ -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;
}