diff options
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 3de842c8551..9894deb5841 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -287,13 +287,15 @@ static char *get_text(LEX *lex) { c = yyGet(); #ifdef USE_MB - int l; - if (use_mb(cs) && - (l = my_ismbchar(cs, - (const char *)lex->ptr-1, - (const char *)lex->end_of_query))) { + { + int l; + if (use_mb(cs) && + (l = my_ismbchar(cs, + (const char *)lex->ptr-1, + (const char *)lex->end_of_query))) { lex->ptr += l-1; continue; + } } #endif if (c == '\\' && @@ -760,8 +762,8 @@ int MYSQLlex(void *arg, void *yythd) lex->tok_start=lex->ptr; // Skip first ` while ((c=yyGet())) { - int length; - if ((length= my_mbcharlen(cs, c)) == 1) + int var_length; + if ((var_length= my_mbcharlen(cs, c)) == 1) { if (c == (uchar) NAMES_SEP_CHAR) break; /* Old .frm format can't handle this char */ @@ -775,9 +777,9 @@ int MYSQLlex(void *arg, void *yythd) } } #ifdef USE_MB - else if (length < 1) + else if (var_length < 1) break; // Error - lex->ptr+= length-1; + lex->ptr+= var_length-1; #endif } if (double_quotes) @@ -1717,13 +1719,14 @@ bool st_lex::can_be_merged() bool selects_allow_merge= select_lex.next_select() == 0; if (selects_allow_merge) { - for (SELECT_LEX_UNIT *unit= select_lex.first_inner_unit(); - unit; - unit= unit->next_unit()) + for (SELECT_LEX_UNIT *tmp_unit= select_lex.first_inner_unit(); + tmp_unit; + tmp_unit= tmp_unit->next_unit()) { - if (unit->first_select()->parent_lex == this && - (unit->item == 0 || - (unit->item->place() != IN_WHERE && unit->item->place() != IN_ON))) + if (tmp_unit->first_select()->parent_lex == this && + (tmp_unit->item == 0 || + (tmp_unit->item->place() != IN_WHERE && + tmp_unit->item->place() != IN_ON))) { selects_allow_merge= 0; break; @@ -2021,12 +2024,12 @@ void st_lex::first_lists_tables_same() FALSE - success */ -bool st_lex::add_time_zone_tables_to_query_tables(THD *thd) +bool st_lex::add_time_zone_tables_to_query_tables(THD *thd_arg) { /* We should not add these tables twice */ if (!time_zone_tables_used) { - time_zone_tables_used= my_tz_get_table_list(thd, &query_tables_last); + time_zone_tables_used= my_tz_get_table_list(thd_arg, &query_tables_last); if (time_zone_tables_used == &fake_time_zone_tables_list) return TRUE; } |