summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com/narttu.mysql.fi>2006-12-15 01:01:52 +0200
committerunknown <monty@mysql.com/narttu.mysql.fi>2006-12-15 01:01:52 +0200
commit2bcbffa0c50f5a09152d1b7b4de7a65abc9283b6 (patch)
treeb60f635d3126e8d0f1321f0187390d7cf8496558 /sql/sql_lex.cc
parent39d873cf3ccad03bda9c751aebc6c59d4a126c91 (diff)
parentf00257ddd0a2f392f9b80c9cd5c405017e3a9d63 (diff)
downloadmariadb-git-2bcbffa0c50f5a09152d1b7b4de7a65abc9283b6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0 client/mysql.cc: Auto merged client/mysql_upgrade.c: Auto merged client/mysqltest.c: Auto merged extra/yassl/include/yassl_imp.hpp: Auto merged extra/yassl/include/yassl_int.hpp: Auto merged extra/yassl/taocrypt/include/algebra.hpp: Auto merged extra/yassl/taocrypt/include/des.hpp: Auto merged extra/yassl/taocrypt/include/modes.hpp: Auto merged extra/yassl/taocrypt/src/aes.cpp: Auto merged extra/yassl/taocrypt/src/algebra.cpp: Auto merged extra/yassl/taocrypt/test/test.cpp: Auto merged include/my_sys.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/lib_sql.cc: Auto merged myisam/mi_open.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/r/mysqltest.result: Auto merged mysql-test/t/mysqltest.test: Auto merged ndb/src/common/util/File.cpp: Auto merged ndb/src/common/util/socket_io.cpp: Auto merged ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/Dbtc.hpp: Auto merged ndb/src/kernel/blocks/dbtup/Dbtup.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/tools/ndb_config.cpp: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_subselect.h: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_load.cc: Auto merged sql-common/my_time.c: Auto merged sql/sql_string.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.cc: Auto merged strings/strtod.c: Auto merged tests/mysql_client_test.c: Auto merged extra/yassl/taocrypt/include/rsa.hpp: manual merge mysql-test/t/mysql.test: manual merge sql/sql_parse.cc: manual merge
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc37
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;
}