diff options
-rw-r--r-- | sql/ha_myisam.cc | 4 | ||||
-rw-r--r-- | sql/item.cc | 4 | ||||
-rw-r--r-- | sql/item_cmpfunc.cc | 2 | ||||
-rw-r--r-- | sql/item_create.cc | 4 | ||||
-rw-r--r-- | sql/mysqld.cc | 4 | ||||
-rw-r--r-- | sql/repl_failsafe.cc | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 | ||||
-rw-r--r-- | sql/sql_base.cc | 2 | ||||
-rw-r--r-- | sql/sql_cache.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.cc | 1 | ||||
-rw-r--r-- | sql/sql_lex.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 12 | ||||
-rw-r--r-- | sql/sql_repl.cc | 12 | ||||
-rw-r--r-- | sql/sql_select.cc | 4 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | sql/sql_yacc.yy | 4 |
17 files changed, 34 insertions, 33 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 6356f209ba2..1a597415ff3 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -390,7 +390,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt) int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt) { HA_CHECK_OPT tmp_check_opt; - char* backup_dir = thd->lex->backup_dir; + char* backup_dir= thd->lex->backup_dir; char src_path[FN_REFLEN], dst_path[FN_REFLEN]; char* table_name = table->real_name; int error; @@ -430,7 +430,7 @@ int ha_myisam::restore(THD* thd, HA_CHECK_OPT *check_opt) int ha_myisam::backup(THD* thd, HA_CHECK_OPT *check_opt) { - char* backup_dir = thd->lex->backup_dir; + char* backup_dir= thd->lex->backup_dir; char src_path[FN_REFLEN], dst_path[FN_REFLEN]; char* table_name = table->real_name; int error; diff --git a/sql/item.cc b/sql/item.cc index 9ac4fbd6840..acb2fdbb40a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -54,7 +54,7 @@ Item::Item(): thd->free_list= this; /* Item constructor can be called during execution other then SQL_COM - command => we should check thd->lex.current_select on zero (thd->lex + command => we should check thd->lex->current_select on zero (thd->lex can be uninitialised) */ if (thd->lex->current_select) @@ -873,7 +873,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) Item **refer= (Item **)not_found_item; uint counter; // Prevent using outer fields in subselects, that is not supported now - SELECT_LEX *cursel=(SELECT_LEX *) thd->lex->current_select; + SELECT_LEX *cursel= (SELECT_LEX *) thd->lex->current_select; if (cursel->master_unit()->first_select()->linkage != DERIVED_TABLE_TYPE) { SELECT_LEX_UNIT *prev_unit= cursel->master_unit(); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index bd88c79c8fb..a79ef21e97a 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1723,7 +1723,7 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) if (item->maybe_null) maybe_null=1; } - thd->lex->current_select->cond_count+=list.elements; + thd->lex->current_select->cond_count+= list.elements; fix_length_and_dec(); fixed= 1; return 0; diff --git a/sql/item_create.cc b/sql/item_create.cc index 7a548962cde..a5b4a8904f1 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -76,7 +76,7 @@ Item *create_func_ceiling(Item* a) Item *create_func_connection_id(void) { THD *thd=current_thd; - thd->lex->safe_to_cache_query=0; + thd->lex->safe_to_cache_query= 0; return new Item_int(NullS,(longlong) ((thd->slave_thread) ? thd->variables.pseudo_thread_id : @@ -148,7 +148,7 @@ Item *create_func_floor(Item* a) Item *create_func_found_rows(void) { THD *thd=current_thd; - thd->lex->safe_to_cache_query=0; + thd->lex->safe_to_cache_query= 0; return new Item_int(NullS,(longlong) thd->found_rows(),21); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 14ebf475692..6e286dcd01e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1278,7 +1278,7 @@ static void server_init(void) void yyerror(const char *s) { THD *thd=current_thd; - char *yytext=(char*) thd->lex->tok_start; + char *yytext= (char*) thd->lex->tok_start; /* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */ if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0) s=ER(ER_SYNTAX_ERROR); @@ -1885,7 +1885,7 @@ extern "C" int my_message_sql(uint error, const char *str, DBUG_RETURN(0); } /* - thd->lex.current_select == 0 if lex structure is not inited + thd->lex->current_select == 0 if lex structure is not inited (not query command (COM_QUERY)) */ if (thd->lex->current_select && diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 49c29ee1e9f..81ea9d9e2ac 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -441,7 +441,7 @@ int show_new_master(THD* thd) DBUG_ENTER("show_new_master"); List<Item> field_list; char errmsg[SLAVE_ERRMSG_SIZE]; - LEX_MASTER_INFO* lex_mi = &thd->lex->mi; + LEX_MASTER_INFO* lex_mi= &thd->lex->mi; errmsg[0]=0; // Safety if (translate_master(thd, lex_mi, errmsg)) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 486d9df5393..2feb9594715 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1573,7 +1573,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, break; } - USER_RESOURCES mqh = thd->lex->mqh; + USER_RESOURCES mqh= thd->lex->mqh; if (mqh.bits & 1) table->field[28]->store((longlong) mqh.questions); if (mqh.bits & 2) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 82e84f8ce49..02ecb158ebe 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2269,7 +2269,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } } cond_and->used_tables_cache= t1->map | t2->map; - thd->lex->current_select->cond_count+=cond_and->list.elements; + thd->lex->current_select->cond_count+= cond_and->list.elements; if (!table->outer_join) // Not left join { if (!(*conds=and_conds(*conds, cond_and))) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 4a517a04495..02df644f3b4 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -289,7 +289,7 @@ TODO list: if (thd->temp_tables || global_merge_table_count) - - Another option would be to set thd->lex.safe_to_cache_query to 0 + - Another option would be to set thd->lex->safe_to_cache_query to 0 in 'get_lock_data' if any of the tables was a tmp table or a MRG_ISAM table. (This could be done with almost no speed penalty) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d1ebcdbd15e..e17c6b152d0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -92,6 +92,7 @@ THD::THD():user_time(0), is_fatal_error(0), global_read_lock(0), bootstrap(0), spcont(NULL) { host= user= priv_user= db= ip= 0; + lex= &main_lex; host_or_ip= "connecting host"; locked=some_tables_deleted=no_errors=password= 0; query_start_used= 0; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a67ee2385b9..b0381ae1d30 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -455,7 +455,7 @@ int yylex(void *arg, void *yythd) int tokval, result_state; uint length; enum my_lex_states state; - LEX *lex= (((THD *)yythd)->lex); + LEX *lex= ((THD *)yythd)->lex; YYSTYPE *yylval=(YYSTYPE*) arg; CHARSET_INFO *cs= ((THD *) yythd)->charset(); uchar *state_map= cs->state_map; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c91a3594b8d..4b1e2397ffd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2649,7 +2649,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; @@ -3957,7 +3957,7 @@ void mysql_init_query(THD *thd, bool lexonly) { 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; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 2897af0b87f..964cf55f942 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -641,7 +641,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables, SELECT_LEX *select_lex) { THD *thd= stmt->thd; - LEX *lex= thd->lex; + LEX *lex= &thd->main_lex; select_result *result= thd->lex->result; DBUG_ENTER("mysql_test_select_fields"); @@ -703,7 +703,7 @@ static bool mysql_test_select_fields(PREP_STMT *stmt, TABLE_LIST *tables, static bool send_prepare_results(PREP_STMT *stmt) { THD *thd= stmt->thd; - LEX *lex= thd->lex; + LEX *lex= &thd->main_lex; enum enum_sql_command sql_command= thd->lex->sql_command; DBUG_ENTER("send_prepare_results"); DBUG_PRINT("enter",("command: %d, param_count: %ld", @@ -812,7 +812,7 @@ static bool init_param_items(PREP_STMT *stmt) Item_param **to; uint32 length= thd->query_length; - stmt->lex= *thd->lex; + stmt->lex= thd->main_lex; if (mysql_bin_log.is_open()) { @@ -972,8 +972,8 @@ void mysql_stmt_execute(THD *thd, char *packet) DBUG_VOID_RETURN; } - LEX *thd_lex= thd->lex; - thd->lex= &stmt->lex; + LEX thd_lex= thd->main_lex; + thd->main_lex= stmt->lex; for (sl= stmt->lex.all_selects_list; sl; @@ -1012,7 +1012,7 @@ void mysql_stmt_execute(THD *thd, char *packet) if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); - thd->lex= thd_lex; + thd->main_lex= thd_lex; DBUG_VOID_RETURN; } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index c0ee4277128..d3c033d985c 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -679,7 +679,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report) bit to 0 for the other thread */ if (thd->lex->slave_thd_opt) - thread_mask &= thd->lex->slave_thd_opt; + thread_mask&= thd->lex->slave_thd_opt; if (thread_mask) //some threads are stopped, start them { if (init_master_info(mi,master_info_file,relay_log_info_file, 0)) @@ -700,7 +700,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report) mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_MASTER_POS; mi->rli.until_log_pos= thd->lex->mi.pos; /* - We don't check thd->lex.mi.log_file_name for NULL here + We don't check thd->lex->mi.log_file_name for NULL here since it is checked in sql_yacc.yy */ strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name, @@ -975,7 +975,7 @@ int change_master(THD* thd, MASTER_INFO* mi) } thd->proc_info = "Changing master"; - LEX_MASTER_INFO* lex_mi = &thd->lex->mi; + LEX_MASTER_INFO* lex_mi= &thd->lex->mi; // TODO: see if needs re-write if (init_master_info(mi, master_info_file, relay_log_info_file, 0)) { @@ -1204,7 +1204,7 @@ int show_binlog_events(THD* thd) if (mysql_bin_log.is_open()) { - LEX_MASTER_INFO *lex_mi = &thd->lex->mi; + LEX_MASTER_INFO *lex_mi= &thd->lex->mi; ha_rows event_count, limit_start, limit_end; my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly char search_file_name[FN_REFLEN], *name; @@ -1213,8 +1213,8 @@ int show_binlog_events(THD* thd) LOG_INFO linfo; Log_event* ev; - limit_start = thd->lex->current_select->offset_limit; - limit_end = thd->lex->current_select->select_limit + limit_start; + limit_start= thd->lex->current_select->offset_limit; + limit_end= thd->lex->current_select->select_limit + limit_start; name= search_file_name; if (log_file_name) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b2c1ef1ea8f..297b6ce71c8 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3551,7 +3551,7 @@ static void make_join_readinfo(JOIN *join, uint options) { uint i; - SELECT_LEX *select_lex = &(join->thd->lex->select_lex); + SELECT_LEX *select_lex= &join->thd->lex->select_lex; DBUG_ENTER("make_join_readinfo"); for (i=join->const_tables ; i < join->tables ; i++) @@ -8957,7 +8957,7 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, List<Item> field_list; List<Item> item_list; THD *thd=join->thd; - SELECT_LEX *select_lex = &(join->thd->lex->select_lex); + SELECT_LEX *select_lex= &join->thd->lex->select_lex; select_result *result=join->result; Item *item_null= new Item_null(); CHARSET_INFO *cs= &my_charset_latin1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0b48ae9bc2e..fe2cfcf2b41 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1237,7 +1237,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table, } else { - char* backup_dir = thd->lex->backup_dir; + char* backup_dir= thd->lex->backup_dir; char src_path[FN_REFLEN], dst_path[FN_REFLEN]; char* table_name = table->real_name; char* db = thd->db ? thd->db : table->db; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index bd73762c5a7..a5ec1a20959 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -28,7 +28,7 @@ #define MYSQL_YACC #define YYINITDEPTH 100 #define YYMAXDEPTH 3200 /* Because of 64K stack */ -#define Lex ((YYTHD->lex)) +#define Lex (YYTHD->lex) #define Select Lex->current_select #include "mysql_priv.h" #include "slave.h" @@ -800,7 +800,7 @@ query: } else { - thd->lex->sql_command = SQLCOM_EMPTY_QUERY; + thd->lex->sql_command= SQLCOM_EMPTY_QUERY; } } | verb_clause END_OF_INPUT {}; |