@@ -33,10 +33,10 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01;
3333
3434/* Macros to look like lex */
3535
36- #define yyGet () *(lex->ptr++)
37- #define yyGetLast () lex->ptr[-1 ]
38- #define yyPeek () lex->ptr[0 ]
39- #define yyPeek2 () lex->ptr[1 ]
36+ #define yyGet () ((uchar) *(lex->ptr++) )
37+ #define yyGetLast () ((uchar) lex->ptr[-1 ])
38+ #define yyPeek () ((uchar) lex->ptr[0 ])
39+ #define yyPeek2 () ((uchar) lex->ptr[1 ])
4040#define yyUnget () lex->ptr--
4141#define yySkip () lex->ptr++
4242#define yyLength () ((uint) (lex->ptr - lex->tok_start)-1 )
@@ -127,7 +127,7 @@ st_parsing_options::reset()
127127 (We already do too much here)
128128*/
129129
130- void lex_start (THD *thd, const uchar *buf, uint length)
130+ void lex_start (THD *thd, const char *buf, uint length)
131131{
132132 LEX *lex= thd->lex ;
133133 DBUG_ENTER (" lex_start" );
@@ -238,9 +238,9 @@ void lex_end(LEX *lex)
238238
239239static int find_keyword (LEX *lex, uint len, bool function)
240240{
241- const uchar *tok=lex->tok_start ;
241+ const char *tok= lex->tok_start ;
242242
243- SYMBOL *symbol= get_hash_symbol (( const char *) tok,len,function);
243+ SYMBOL *symbol= get_hash_symbol (tok, len, function);
244244 if (symbol)
245245 {
246246 lex->yylval ->symbol .symbol =symbol;
@@ -305,16 +305,16 @@ static LEX_STRING get_token(LEX *lex,uint length)
305305static LEX_STRING get_quoted_token (LEX *lex,uint length, char quote)
306306{
307307 LEX_STRING tmp;
308- const uchar *from, *end;
309- uchar *to;
308+ const char *from, *end;
309+ char *to;
310310 yyUnget (); // ptr points now after last token char
311311 tmp.length =lex->yytoklen =length;
312312 tmp.str =(char *) lex->thd ->alloc (tmp.length +1 );
313- for (from= lex->tok_start , to= (uchar*) tmp.str , end= to+length ;
313+ for (from= lex->tok_start , to= tmp.str , end= to+length ;
314314 to != end ;
315315 )
316316 {
317- if ((*to++= *from++) == (uchar) quote)
317+ if ((*to++= *from++) == quote)
318318 from++; // Skip double quotes
319319 }
320320 *to= 0 ; // End null for safety
@@ -341,9 +341,7 @@ static char *get_text(LEX *lex)
341341 {
342342 int l;
343343 if (use_mb (cs) &&
344- (l = my_ismbchar (cs,
345- (const char *)lex->ptr -1 ,
346- (const char *)lex->end_of_query ))) {
344+ (l = my_ismbchar (cs, lex->ptr -1 , lex->end_of_query ))) {
347345 lex->ptr += l-1 ;
348346 continue ;
349347 }
@@ -368,12 +366,12 @@ static char *get_text(LEX *lex)
368366 yyUnget ();
369367
370368 /* Found end. Unescape and return string */
371- const uchar *str, *end;
372- uchar *start;
369+ const char *str, *end;
370+ char *start;
373371
374372 str=lex->tok_start +1 ;
375373 end=lex->ptr -1 ;
376- if (!(start=(uchar *) lex->thd ->alloc ((uint) (end-str)+1 )))
374+ if (!(start= ( char *) lex->thd ->alloc ((uint) (end-str)+1 )))
377375 return (char *) " " ; // Sql_alloc has set error flag
378376 if (!found_escape)
379377 {
@@ -383,15 +381,14 @@ static char *get_text(LEX *lex)
383381 }
384382 else
385383 {
386- uchar *to;
384+ char *to;
387385
388386 for (to=start ; str != end ; str++)
389387 {
390388#ifdef USE_MB
391389 int l;
392390 if (use_mb (cs) &&
393- (l = my_ismbchar (cs,
394- (const char *)str, (const char *)end))) {
391+ (l = my_ismbchar (cs, str, end))) {
395392 while (l--)
396393 *to++ = *str++;
397394 str--;
@@ -437,7 +434,7 @@ static char *get_text(LEX *lex)
437434 *to=0 ;
438435 lex->yytoklen =(uint) (to-start);
439436 }
440- return ( char *) start;
437+ return start;
441438 }
442439 }
443440 return 0 ; // unexpected end of query
@@ -556,7 +553,6 @@ int MYSQLlex(void *arg, void *yythd)
556553
557554 lex->yylval =yylval; // The global state
558555
559- lex->tok_end_prev = lex->tok_end ;
560556 lex->tok_start_prev = lex->tok_start ;
561557
562558 lex->tok_start =lex->tok_end =lex->ptr ;
@@ -640,16 +636,14 @@ int MYSQLlex(void *arg, void *yythd)
640636 break ;
641637 }
642638 case MY_LEX_IDENT:
643- const uchar *start;
639+ const char *start;
644640#if defined(USE_MB) && defined(USE_MB_IDENT)
645641 if (use_mb (cs))
646642 {
647643 result_state= IDENT_QUOTED;
648644 if (my_mbcharlen (cs, yyGetLast ()) > 1 )
649645 {
650- int l = my_ismbchar (cs,
651- (const char *)lex->ptr -1 ,
652- (const char *)lex->end_of_query );
646+ int l = my_ismbchar (cs, lex->ptr -1 , lex->end_of_query );
653647 if (l == 0 ) {
654648 state = MY_LEX_CHAR;
655649 continue ;
@@ -661,9 +655,7 @@ int MYSQLlex(void *arg, void *yythd)
661655 if (my_mbcharlen (cs, c) > 1 )
662656 {
663657 int l;
664- if ((l = my_ismbchar (cs,
665- (const char *)lex->ptr -1 ,
666- (const char *)lex->end_of_query )) == 0 )
658+ if ((l = my_ismbchar (cs, lex->ptr -1 , lex->end_of_query )) == 0 )
667659 break ;
668660 lex->ptr += l-1 ;
669661 }
@@ -786,9 +778,7 @@ int MYSQLlex(void *arg, void *yythd)
786778 if (my_mbcharlen (cs, c) > 1 )
787779 {
788780 int l;
789- if ((l = my_ismbchar (cs,
790- (const char *)lex->ptr -1 ,
791- (const char *)lex->end_of_query )) == 0 )
781+ if ((l = my_ismbchar (cs, lex->ptr -1 , lex->end_of_query )) == 0 )
792782 break ;
793783 lex->ptr += l-1 ;
794784 }
@@ -1122,7 +1112,7 @@ int MYSQLlex(void *arg, void *yythd)
11221112 Pointer to the last non-comment symbol of the statement.
11231113*/
11241114
1125- const uchar *skip_rear_comments (const uchar *begin, const uchar *end)
1115+ const char *skip_rear_comments (const char *begin, const char *end)
11261116{
11271117 while (begin < end && (end[-1 ] <= ' ' || end[-1 ] == ' *' ||
11281118 end[-1 ] == ' /' || end[-1 ] == ' ;' ))
0 commit comments