1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

THD::lex now points to THD::main_lex like in 5.0

All tests pass (client_test included)
This commit is contained in:
konstantin@oak.local
2003-12-19 20:52:13 +03:00
parent c49773237d
commit d37da004f6
33 changed files with 233 additions and 231 deletions

View File

@@ -1176,7 +1176,7 @@ bool do_command(THD *thd)
indicator of uninitialized lex => normal flow of errors handling
(see my_message_sql)
*/
thd->lex.current_select= 0;
thd->lex->current_select= 0;
packet=0;
old_timeout=net->read_timeout;
@@ -1383,16 +1383,16 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
DBUG_PRINT("query",("%-.4096s",thd->query));
mysql_parse(thd,thd->query, thd->query_length);
while (!thd->killed && !thd->is_fatal_error && thd->lex.found_colon)
while (!thd->killed && !thd->is_fatal_error && thd->lex->found_colon)
{
char *packet= thd->lex.found_colon;
char *packet= thd->lex->found_colon;
/*
Multiple queries exits, execute them individually
*/
if (thd->lock || thd->open_tables || thd->derived_tables)
close_thread_tables(thd);
ulong length= thd->query_length-(ulong)(thd->lex.found_colon-thd->query);
ulong length= thd->query_length-(ulong)(thd->lex->found_colon-thd->query);
/* Remove garbage at start of query */
while (my_isspace(thd->charset(), *packet) && length > 0)
@@ -1736,7 +1736,7 @@ void
mysql_execute_command(THD *thd)
{
int res= 0;
LEX *lex= &thd->lex;
LEX *lex= thd->lex;
TABLE_LIST *tables= (TABLE_LIST*) lex->select_lex.table_list.first;
SELECT_LEX *select_lex= &lex->select_lex;
SELECT_LEX_UNIT *unit= &lex->unit;
@@ -1865,7 +1865,7 @@ mysql_execute_command(THD *thd)
else
thd->send_explain_fields(result);
fix_tables_pointers(lex->all_selects_list);
res= mysql_explain_union(thd, &thd->lex.unit, result);
res= mysql_explain_union(thd, &thd->lex->unit, result);
MYSQL_LOCK *save_lock= thd->lock;
thd->lock= (MYSQL_LOCK *)0;
if (lex->describe & DESCRIBE_EXTENDED)
@@ -1873,7 +1873,7 @@ mysql_execute_command(THD *thd)
char buff[1024];
String str(buff,(uint32) sizeof(buff), system_charset_info);
str.length(0);
thd->lex.unit.print(&str);
thd->lex->unit.print(&str);
str.append('\0');
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_YES, str.ptr());
@@ -2634,7 +2634,7 @@ mysql_execute_command(THD *thd)
}
case SQLCOM_DELETE_MULTI:
{
TABLE_LIST *aux_tables=(TABLE_LIST *)thd->lex.auxilliary_table_list.first;
TABLE_LIST *aux_tables= (TABLE_LIST *)thd->lex->auxilliary_table_list.first;
TABLE_LIST *auxi;
uint table_count=0;
multi_delete *result;
@@ -3693,7 +3693,7 @@ void
mysql_init_query(THD *thd)
{
DBUG_ENTER("mysql_init_query");
LEX *lex=&thd->lex;
LEX *lex= thd->lex;
lex->unit.init_query();
lex->unit.init_select();
lex->unit.thd= thd;
@@ -3821,7 +3821,7 @@ void create_select_for_variable(const char *var_name)
DBUG_ENTER("create_select_for_variable");
thd= current_thd;
lex= &thd->lex;
lex= thd->lex;
mysql_init_select(lex);
lex->sql_command= SQLCOM_SELECT;
tmp.str= (char*) var_name;
@@ -3899,7 +3899,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
uint uint_geom_type)
{
register create_field *new_field;
LEX *lex= &thd->lex;
LEX *lex= thd->lex;
uint allowed_type_modifier=0;
char warn_buff[MYSQL_ERRMSG_SIZE];
DBUG_ENTER("add_field_to_list");
@@ -4233,7 +4233,7 @@ add_proc_to_list(THD* thd, Item *item)
*item_ptr= item;
order->item=item_ptr;
order->free_me=0;
thd->lex.proc_list.link_in_list((byte*) order,(byte**) &order->next);
thd->lex->proc_list.link_in_list((byte*) order,(byte**) &order->next);
return 0;
}
@@ -4715,11 +4715,11 @@ static bool append_file_to_dir(THD *thd, char **filename_ptr, char *table_name)
bool check_simple_select()
{
THD *thd= current_thd;
if (thd->lex.current_select != &thd->lex.select_lex)
if (thd->lex->current_select != &thd->lex->select_lex)
{
char command[80];
strmake(command, thd->lex.yylval->symbol.str,
min(thd->lex.yylval->symbol.length, sizeof(command)-1));
strmake(command, thd->lex->yylval->symbol.str,
min(thd->lex->yylval->symbol.length, sizeof(command)-1));
net_printf(thd, ER_CANT_USE_OPTION_HERE, command);
return 1;
}