summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
committerunknown <monty@mysql.com>2005-11-23 22:58:53 +0200
commit039168c2fa724b9ed87ce2f19a7ea20acbd8a1de (patch)
tree8972ae3c8dffff8f3b6f27565d191af346c9ac8d /sql/sql_lex.cc
parentfe245ed8ba1258e1f3920e449338ea92e3a3a96e (diff)
parentf631b361b6119fb73df38602ad58e140848f92d7 (diff)
downloadmariadb-git-039168c2fa724b9ed87ce2f19a7ea20acbd8a1de.tar.gz
Merge mysql.com:/home/my/mysql-5.1
into mysql.com:/home/my/mysql-5.1-TDC mysql-test/r/variables.result: Auto merged mysql-test/t/variables.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_federated.cc: Auto merged sql/ha_federated.h: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_myisammrg.cc: 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_subselect.cc: Auto merged sql/item_sum.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/key.cc: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/parse_file.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_load.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged sql/sql_view.cc: Auto merged sql/structs.h: Auto merged sql/field.cc: Merge with global tree sql/sql_base.cc: Merge with global tree sql/table.cc: Merge with global tree
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index c19efff2d85..4d32e26f1b7 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -110,7 +110,7 @@ void lex_free(void)
(We already do too much here)
*/
-void lex_start(THD *thd, uchar *buf,uint length)
+void lex_start(THD *thd, const uchar *buf, uint length)
{
LEX *lex= thd->lex;
DBUG_ENTER("lex_start");
@@ -196,9 +196,9 @@ void lex_end(LEX *lex)
static int find_keyword(LEX *lex, uint len, bool function)
{
- uchar *tok=lex->tok_start;
+ const uchar *tok=lex->tok_start;
- SYMBOL *symbol = get_hash_symbol((const char *)tok,len,function);
+ SYMBOL *symbol= get_hash_symbol((const char *)tok,len,function);
if (symbol)
{
lex->yylval->symbol.symbol=symbol;
@@ -256,15 +256,16 @@ static LEX_STRING get_token(LEX *lex,uint length)
static LEX_STRING get_quoted_token(LEX *lex,uint length, char quote)
{
LEX_STRING tmp;
- byte *from, *to, *end;
+ const uchar *from, *end;
+ uchar *to;
yyUnget(); // ptr points now after last token char
tmp.length=lex->yytoklen=length;
tmp.str=(char*) lex->thd->alloc(tmp.length+1);
- for (from= (byte*) lex->tok_start, to= (byte*) tmp.str, end= to+length ;
+ for (from= lex->tok_start, to= (uchar*) tmp.str, end= to+length ;
to != end ;
)
{
- if ((*to++= *from++) == quote)
+ if ((*to++= *from++) == (uchar) quote)
from++; // Skip double quotes
}
*to= 0; // End null for safety
@@ -284,7 +285,6 @@ static char *get_text(LEX *lex)
CHARSET_INFO *cs= lex->thd->charset();
sep= yyGetLast(); // String should end with this
- //lex->tok_start=lex->ptr-1; // Remember '
while (lex->ptr != lex->end_of_query)
{
c = yyGet();
@@ -328,7 +328,8 @@ static char *get_text(LEX *lex)
yyUnget();
/* Found end. Unescape and return string */
- uchar *str,*end,*start;
+ const uchar *str, *end;
+ uchar *start;
str=lex->tok_start+1;
end=lex->ptr-1;
@@ -612,7 +613,7 @@ int yylex(void *arg, void *yythd)
break;
}
case MY_LEX_IDENT:
- uchar *start;
+ const uchar *start;
#if defined(USE_MB) && defined(USE_MB_IDENT)
if (use_mb(cs))
{