diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-02 09:14:15 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-02 09:14:15 +0300 |
commit | bce380f2a5da2f951ec3fad76c7012499abc49f4 (patch) | |
tree | 8dcd9f5b2b419a1ef8726ffa56fa42fac3cc6ab9 /storage/innobase/pars | |
parent | d59ad6972bc70c32ad756db0a8f8f64df3c7f80b (diff) | |
parent | b88f3786484e22759c8402494b8b9cc1e7a1cc46 (diff) | |
download | mariadb-git-bce380f2a5da2f951ec3fad76c7012499abc49f4.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage/innobase/pars')
-rw-r--r-- | storage/innobase/pars/lexyy.cc | 477 | ||||
-rwxr-xr-x | storage/innobase/pars/make_flex.sh | 7 | ||||
-rw-r--r-- | storage/innobase/pars/pars0lex.l | 5 | ||||
-rw-r--r-- | storage/innobase/pars/pars0pars.cc | 9 |
4 files changed, 243 insertions, 255 deletions
diff --git a/storage/innobase/pars/lexyy.cc b/storage/innobase/pars/lexyy.cc index 4d1b021fa2b..bd0b6d78cd2 100644 --- a/storage/innobase/pars/lexyy.cc +++ b/storage/innobase/pars/lexyy.cc @@ -10,7 +10,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 1 +#define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -85,10 +85,16 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + #endif /* ! C99 */ #endif /* ! FLEXINT_H */ +/* begin standard C++ headers. */ + /* TODO: this is always defined, so inline it */ #define yyconst const @@ -101,32 +107,26 @@ typedef unsigned int flex_uint32_t; /* Returned upon end-of-file. */ #define YY_NULL 0 -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * - /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START - /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - +#define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ @@ -163,7 +163,7 @@ typedef size_t yy_size_t; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 - + #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) @@ -180,7 +180,6 @@ typedef size_t yy_size_t; YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) - #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE @@ -262,7 +261,6 @@ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) - /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ @@ -283,65 +281,59 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -static void yyrestart (FILE *input_file ); -MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -static YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -static void yy_delete_buffer (YY_BUFFER_STATE b ); -static void yy_flush_buffer (YY_BUFFER_STATE b ); -MY_ATTRIBUTE((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); +static void yyrestart ( FILE *input_file ); +MY_ATTRIBUTE((unused)) static void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); +static YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); +static void yy_delete_buffer ( YY_BUFFER_STATE b ); +static void yy_flush_buffer ( YY_BUFFER_STATE b ); +MY_ATTRIBUTE((unused)) static void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); +MY_ATTRIBUTE((unused)) static void yypop_buffer_state ( void ); -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) +static void yyensure_buffer_stack ( void ); +static void yy_load_buffer_state ( void ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); -static void *yyalloc (yy_size_t ); -static void *yyrealloc (void *,yy_size_t ); -static void yyfree (void * ); +static void *yyalloc ( yy_size_t ); +static void *yyrealloc ( void *, yy_size_t ); +static void yyfree ( void * ); #define yy_new_buffer yy_create_buffer - #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } - #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ + yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } - #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap() (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; +typedef flex_uint8_t YY_CHAR; static FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; - static int yylineno = 1; @@ -350,10 +342,10 @@ static int yylineno = 1; #endif #define yytext_ptr yytext -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yynoreturn yy_fatal_error (yyconst char* msg ); +static yy_state_type yy_get_previous_state ( void ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); +static int yy_get_next_buffer ( void ); +static void yynoreturn yy_fatal_error ( const char* msg ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. @@ -364,7 +356,6 @@ static void yynoreturn yy_fatal_error (yyconst char* msg ); (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; - #define YY_NUM_RULES 123 #define YY_END_OF_BUFFER 124 /* This struct is not used in this scanner, @@ -374,7 +365,7 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[404] = +static const flex_int16_t yy_accept[404] = { 0, 0, 0, 118, 118, 0, 0, 0, 0, 124, 122, 121, 121, 8, 122, 113, 5, 102, 108, 111, 109, @@ -423,7 +414,7 @@ static yyconst flex_int16_t yy_accept[404] = 95, 72, 0 } ; -static yyconst YY_CHAR yy_ec[256] = +static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -455,7 +446,7 @@ static yyconst YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst YY_CHAR yy_meta[57] = +static const YY_CHAR yy_meta[57] = { 0, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 5, 1, 1, 1, 1, 6, 7, 1, 1, 1, @@ -465,7 +456,7 @@ static yyconst YY_CHAR yy_meta[57] = 9, 9, 9, 9, 1, 1 } ; -static yyconst flex_uint16_t yy_base[417] = +static const flex_int16_t yy_base[417] = { 0, 0, 0, 296, 281, 283, 280, 261, 252, 253, 1285, 55, 57, 1285, 0, 1285, 1285, 1285, 1285, 1285, 1285, @@ -515,7 +506,7 @@ static yyconst flex_uint16_t yy_base[417] = 1243, 1252, 1261, 1268, 1272, 1275 } ; -static yyconst flex_int16_t yy_def[417] = +static const flex_int16_t yy_def[417] = { 0, 403, 1, 404, 404, 405, 405, 406, 406, 403, 403, 403, 403, 403, 407, 403, 403, 403, 403, 403, 403, @@ -565,7 +556,7 @@ static yyconst flex_int16_t yy_def[417] = 403, 403, 403, 403, 403, 403 } ; -static yyconst flex_uint16_t yy_nxt[1342] = +static const flex_int16_t yy_nxt[1342] = { 0, 10, 11, 12, 13, 10, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, @@ -717,7 +708,7 @@ static yyconst flex_uint16_t yy_nxt[1342] = 403 } ; -static yyconst flex_int16_t yy_chk[1342] = +static const flex_int16_t yy_chk[1342] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -887,7 +878,7 @@ static char *yytext; /***************************************************************************** Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -937,9 +928,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - (result = pars_get_lex_chars(buf, max_size)) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ @@ -971,10 +961,9 @@ string_append( stringbuf_len += len; } +#line 964 "lexyy.cc" - - -#line 977 "lexyy.cc" +#line 966 "lexyy.cc" #define INITIAL 0 #define comment 1 @@ -993,36 +982,36 @@ string_append( #define YY_EXTRA_TYPE void * #endif -static int yy_init_globals (void ); +static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ -MY_ATTRIBUTE((unused)) static int yylex_destroy (void ); +MY_ATTRIBUTE((unused)) static int yylex_destroy ( void ); -MY_ATTRIBUTE((unused)) static int yyget_debug (void ); +MY_ATTRIBUTE((unused)) static int yyget_debug ( void ); -MY_ATTRIBUTE((unused)) static void yyset_debug (int debug_flag ); +MY_ATTRIBUTE((unused)) static void yyset_debug ( int debug_flag ); -YY_EXTRA_TYPE yyget_extra (void ); +YY_EXTRA_TYPE yyget_extra ( void ); -MY_ATTRIBUTE((unused)) static FILE *yyget_in (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_in ( void ); -MY_ATTRIBUTE((unused)) static void yyset_in (FILE * _in_str ); +MY_ATTRIBUTE((unused)) static void yyset_in ( FILE * _in_str ); -MY_ATTRIBUTE((unused)) static FILE *yyget_out (void ); +MY_ATTRIBUTE((unused)) static FILE *yyget_out ( void ); -MY_ATTRIBUTE((unused)) static void yyset_out (FILE * _out_str ); +MY_ATTRIBUTE((unused)) static void yyset_out ( FILE * _out_str ); - MY_ATTRIBUTE((unused)) static int yyget_leng (void ); + MY_ATTRIBUTE((unused)) static int yyget_leng ( void ); -MY_ATTRIBUTE((unused)) static char *yyget_text (void ); +MY_ATTRIBUTE((unused)) static char *yyget_text ( void ); -MY_ATTRIBUTE((unused)) static int yyget_lineno (void ); +MY_ATTRIBUTE((unused)) static int yyget_lineno ( void ); -MY_ATTRIBUTE((unused)) static void yyset_lineno (int _line_number ); +MY_ATTRIBUTE((unused)) static void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -1030,9 +1019,9 @@ MY_ATTRIBUTE((unused)) static void yyset_lineno (int _line_number ); #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap (void ); +extern "C" int yywrap ( void ); #else -extern int yywrap (void ); +extern int yywrap ( void ); #endif #endif @@ -1041,19 +1030,18 @@ extern int yywrap (void ); #endif #ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); +static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); +static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT - #ifdef __cplusplus -static int yyinput (void ); +static int yyinput ( void ); #else -static int input (void ); +static int input ( void ); #endif #endif @@ -1084,7 +1072,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1097,7 +1085,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = (int) fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -1186,17 +1174,17 @@ YY_DECL if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_load_buffer_state( ); + yy_load_buffer_state( ); } { -#line 113 "pars0lex.l" +#line 112 "pars0lex.l" -#line 1199 "lexyy.cc" +#line 1187 "lexyy.cc" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1224,9 +1212,9 @@ yy_match: { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 404 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_current_state != 403 ); @@ -1251,7 +1239,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 115 "pars0lex.l" +#line 114 "pars0lex.l" { yylval = sym_tab_add_int_lit(pars_sym_tab_global, atoi(yytext)); @@ -1260,7 +1248,7 @@ YY_RULE_SETUP YY_BREAK case 2: YY_RULE_SETUP -#line 121 "pars0lex.l" +#line 120 "pars0lex.l" { ut_error; /* not implemented */ @@ -1269,7 +1257,7 @@ YY_RULE_SETUP YY_BREAK case 3: YY_RULE_SETUP -#line 127 "pars0lex.l" +#line 126 "pars0lex.l" { ulint type; @@ -1281,7 +1269,7 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 136 "pars0lex.l" +#line 135 "pars0lex.l" { yylval = sym_tab_add_bound_id(pars_sym_tab_global, yytext + 1); @@ -1291,7 +1279,7 @@ YY_RULE_SETUP YY_BREAK case 5: YY_RULE_SETUP -#line 143 "pars0lex.l" +#line 142 "pars0lex.l" { /* Quoted character string literals are handled in an explicit start state 'quoted'. This state is entered and the buffer for @@ -1305,7 +1293,7 @@ In the state 'quoted', only two actions are possible (defined below). */ case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 152 "pars0lex.l" +#line 151 "pars0lex.l" { /* Got a sequence of characters other than "'": append to string buffer */ @@ -1314,7 +1302,7 @@ YY_RULE_SETUP YY_BREAK case 7: YY_RULE_SETUP -#line 157 "pars0lex.l" +#line 156 "pars0lex.l" { /* Got a sequence of "'" characters: append half of them to string buffer, @@ -1341,7 +1329,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 181 "pars0lex.l" +#line 180 "pars0lex.l" { /* Quoted identifiers are handled in an explicit start state 'id'. This state is entered and the buffer for the scanned string is emptied @@ -1355,7 +1343,7 @@ In the state 'id', only two actions are possible (defined below). */ case 9: /* rule 9 can match eol */ YY_RULE_SETUP -#line 190 "pars0lex.l" +#line 189 "pars0lex.l" { /* Got a sequence of characters other than '"': append to string buffer */ @@ -1364,7 +1352,7 @@ YY_RULE_SETUP YY_BREAK case 10: YY_RULE_SETUP -#line 195 "pars0lex.l" +#line 194 "pars0lex.l" { /* Got a sequence of '"' characters: append half of them to string buffer, @@ -1392,7 +1380,7 @@ YY_RULE_SETUP YY_BREAK case 11: YY_RULE_SETUP -#line 220 "pars0lex.l" +#line 219 "pars0lex.l" { yylval = sym_tab_add_null_lit(pars_sym_tab_global); @@ -1401,7 +1389,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 226 "pars0lex.l" +#line 225 "pars0lex.l" { /* Implicit cursor name */ yylval = sym_tab_add_str_lit(pars_sym_tab_global, @@ -1411,581 +1399,581 @@ YY_RULE_SETUP YY_BREAK case 13: YY_RULE_SETUP -#line 233 "pars0lex.l" +#line 232 "pars0lex.l" { return(PARS_AND_TOKEN); } YY_BREAK case 14: YY_RULE_SETUP -#line 237 "pars0lex.l" +#line 236 "pars0lex.l" { return(PARS_OR_TOKEN); } YY_BREAK case 15: YY_RULE_SETUP -#line 241 "pars0lex.l" +#line 240 "pars0lex.l" { return(PARS_NOT_TOKEN); } YY_BREAK case 16: YY_RULE_SETUP -#line 245 "pars0lex.l" +#line 244 "pars0lex.l" { return(PARS_PROCEDURE_TOKEN); } YY_BREAK case 17: YY_RULE_SETUP -#line 249 "pars0lex.l" +#line 248 "pars0lex.l" { return(PARS_IN_TOKEN); } YY_BREAK case 18: YY_RULE_SETUP -#line 253 "pars0lex.l" +#line 252 "pars0lex.l" { return(PARS_OUT_TOKEN); } YY_BREAK case 19: YY_RULE_SETUP -#line 257 "pars0lex.l" +#line 256 "pars0lex.l" { return(PARS_BINARY_TOKEN); } YY_BREAK case 20: YY_RULE_SETUP -#line 261 "pars0lex.l" +#line 260 "pars0lex.l" { return(PARS_BLOB_TOKEN); } YY_BREAK case 21: YY_RULE_SETUP -#line 265 "pars0lex.l" +#line 264 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 22: YY_RULE_SETUP -#line 269 "pars0lex.l" +#line 268 "pars0lex.l" { return(PARS_INT_TOKEN); } YY_BREAK case 23: YY_RULE_SETUP -#line 273 "pars0lex.l" +#line 272 "pars0lex.l" { return(PARS_FLOAT_TOKEN); } YY_BREAK case 24: YY_RULE_SETUP -#line 277 "pars0lex.l" +#line 276 "pars0lex.l" { return(PARS_CHAR_TOKEN); } YY_BREAK case 25: YY_RULE_SETUP -#line 281 "pars0lex.l" +#line 280 "pars0lex.l" { return(PARS_IS_TOKEN); } YY_BREAK case 26: YY_RULE_SETUP -#line 285 "pars0lex.l" +#line 284 "pars0lex.l" { return(PARS_BEGIN_TOKEN); } YY_BREAK case 27: YY_RULE_SETUP -#line 289 "pars0lex.l" +#line 288 "pars0lex.l" { return(PARS_END_TOKEN); } YY_BREAK case 28: YY_RULE_SETUP -#line 293 "pars0lex.l" +#line 292 "pars0lex.l" { return(PARS_IF_TOKEN); } YY_BREAK case 29: YY_RULE_SETUP -#line 297 "pars0lex.l" +#line 296 "pars0lex.l" { return(PARS_THEN_TOKEN); } YY_BREAK case 30: YY_RULE_SETUP -#line 301 "pars0lex.l" +#line 300 "pars0lex.l" { return(PARS_ELSE_TOKEN); } YY_BREAK case 31: YY_RULE_SETUP -#line 305 "pars0lex.l" +#line 304 "pars0lex.l" { return(PARS_ELSIF_TOKEN); } YY_BREAK case 32: YY_RULE_SETUP -#line 309 "pars0lex.l" +#line 308 "pars0lex.l" { return(PARS_LOOP_TOKEN); } YY_BREAK case 33: YY_RULE_SETUP -#line 313 "pars0lex.l" +#line 312 "pars0lex.l" { return(PARS_WHILE_TOKEN); } YY_BREAK case 34: YY_RULE_SETUP -#line 317 "pars0lex.l" +#line 316 "pars0lex.l" { return(PARS_RETURN_TOKEN); } YY_BREAK case 35: YY_RULE_SETUP -#line 321 "pars0lex.l" +#line 320 "pars0lex.l" { return(PARS_SELECT_TOKEN); } YY_BREAK case 36: YY_RULE_SETUP -#line 325 "pars0lex.l" +#line 324 "pars0lex.l" { return(PARS_SUM_TOKEN); } YY_BREAK case 37: YY_RULE_SETUP -#line 329 "pars0lex.l" +#line 328 "pars0lex.l" { return(PARS_COUNT_TOKEN); } YY_BREAK case 38: YY_RULE_SETUP -#line 333 "pars0lex.l" +#line 332 "pars0lex.l" { return(PARS_DISTINCT_TOKEN); } YY_BREAK case 39: YY_RULE_SETUP -#line 337 "pars0lex.l" +#line 336 "pars0lex.l" { return(PARS_FROM_TOKEN); } YY_BREAK case 40: YY_RULE_SETUP -#line 341 "pars0lex.l" +#line 340 "pars0lex.l" { return(PARS_WHERE_TOKEN); } YY_BREAK case 41: YY_RULE_SETUP -#line 345 "pars0lex.l" +#line 344 "pars0lex.l" { return(PARS_FOR_TOKEN); } YY_BREAK case 42: YY_RULE_SETUP -#line 349 "pars0lex.l" +#line 348 "pars0lex.l" { return(PARS_READ_TOKEN); } YY_BREAK case 43: YY_RULE_SETUP -#line 353 "pars0lex.l" +#line 352 "pars0lex.l" { return(PARS_ORDER_TOKEN); } YY_BREAK case 44: YY_RULE_SETUP -#line 357 "pars0lex.l" +#line 356 "pars0lex.l" { return(PARS_BY_TOKEN); } YY_BREAK case 45: YY_RULE_SETUP -#line 361 "pars0lex.l" +#line 360 "pars0lex.l" { return(PARS_ASC_TOKEN); } YY_BREAK case 46: YY_RULE_SETUP -#line 365 "pars0lex.l" +#line 364 "pars0lex.l" { return(PARS_DESC_TOKEN); } YY_BREAK case 47: YY_RULE_SETUP -#line 369 "pars0lex.l" +#line 368 "pars0lex.l" { return(PARS_INSERT_TOKEN); } YY_BREAK case 48: YY_RULE_SETUP -#line 373 "pars0lex.l" +#line 372 "pars0lex.l" { return(PARS_INTO_TOKEN); } YY_BREAK case 49: YY_RULE_SETUP -#line 377 "pars0lex.l" +#line 376 "pars0lex.l" { return(PARS_VALUES_TOKEN); } YY_BREAK case 50: YY_RULE_SETUP -#line 381 "pars0lex.l" +#line 380 "pars0lex.l" { return(PARS_UPDATE_TOKEN); } YY_BREAK case 51: YY_RULE_SETUP -#line 385 "pars0lex.l" +#line 384 "pars0lex.l" { return(PARS_SET_TOKEN); } YY_BREAK case 52: YY_RULE_SETUP -#line 389 "pars0lex.l" +#line 388 "pars0lex.l" { return(PARS_DELETE_TOKEN); } YY_BREAK case 53: YY_RULE_SETUP -#line 393 "pars0lex.l" +#line 392 "pars0lex.l" { return(PARS_CURRENT_TOKEN); } YY_BREAK case 54: YY_RULE_SETUP -#line 397 "pars0lex.l" +#line 396 "pars0lex.l" { return(PARS_OF_TOKEN); } YY_BREAK case 55: YY_RULE_SETUP -#line 401 "pars0lex.l" +#line 400 "pars0lex.l" { return(PARS_CREATE_TOKEN); } YY_BREAK case 56: YY_RULE_SETUP -#line 405 "pars0lex.l" +#line 404 "pars0lex.l" { return(PARS_TABLE_TOKEN); } YY_BREAK case 57: YY_RULE_SETUP -#line 409 "pars0lex.l" +#line 408 "pars0lex.l" { return(PARS_COMPACT_TOKEN); } YY_BREAK case 58: YY_RULE_SETUP -#line 413 "pars0lex.l" +#line 412 "pars0lex.l" { return(PARS_BLOCK_SIZE_TOKEN); } YY_BREAK case 59: YY_RULE_SETUP -#line 417 "pars0lex.l" +#line 416 "pars0lex.l" { return(PARS_INDEX_TOKEN); } YY_BREAK case 60: YY_RULE_SETUP -#line 421 "pars0lex.l" +#line 420 "pars0lex.l" { return(PARS_UNIQUE_TOKEN); } YY_BREAK case 61: YY_RULE_SETUP -#line 425 "pars0lex.l" +#line 424 "pars0lex.l" { return(PARS_CLUSTERED_TOKEN); } YY_BREAK case 62: YY_RULE_SETUP -#line 429 "pars0lex.l" +#line 428 "pars0lex.l" { return(PARS_ON_TOKEN); } YY_BREAK case 63: YY_RULE_SETUP -#line 433 "pars0lex.l" +#line 432 "pars0lex.l" { return(PARS_DECLARE_TOKEN); } YY_BREAK case 64: YY_RULE_SETUP -#line 437 "pars0lex.l" +#line 436 "pars0lex.l" { return(PARS_CURSOR_TOKEN); } YY_BREAK case 65: YY_RULE_SETUP -#line 441 "pars0lex.l" +#line 440 "pars0lex.l" { return(PARS_OPEN_TOKEN); } YY_BREAK case 66: YY_RULE_SETUP -#line 445 "pars0lex.l" +#line 444 "pars0lex.l" { return(PARS_FETCH_TOKEN); } YY_BREAK case 67: YY_RULE_SETUP -#line 449 "pars0lex.l" +#line 448 "pars0lex.l" { return(PARS_CLOSE_TOKEN); } YY_BREAK case 68: YY_RULE_SETUP -#line 453 "pars0lex.l" +#line 452 "pars0lex.l" { return(PARS_NOTFOUND_TOKEN); } YY_BREAK case 69: YY_RULE_SETUP -#line 457 "pars0lex.l" +#line 456 "pars0lex.l" { return(PARS_TO_CHAR_TOKEN); } YY_BREAK case 70: YY_RULE_SETUP -#line 461 "pars0lex.l" +#line 460 "pars0lex.l" { return(PARS_TO_NUMBER_TOKEN); } YY_BREAK case 71: YY_RULE_SETUP -#line 465 "pars0lex.l" +#line 464 "pars0lex.l" { return(PARS_TO_BINARY_TOKEN); } YY_BREAK case 72: YY_RULE_SETUP -#line 469 "pars0lex.l" +#line 468 "pars0lex.l" { return(PARS_BINARY_TO_NUMBER_TOKEN); } YY_BREAK case 73: YY_RULE_SETUP -#line 473 "pars0lex.l" +#line 472 "pars0lex.l" { return(PARS_SUBSTR_TOKEN); } YY_BREAK case 74: YY_RULE_SETUP -#line 477 "pars0lex.l" +#line 476 "pars0lex.l" { return(PARS_REPLSTR_TOKEN); } YY_BREAK case 75: YY_RULE_SETUP -#line 481 "pars0lex.l" +#line 480 "pars0lex.l" { return(PARS_CONCAT_TOKEN); } YY_BREAK case 76: YY_RULE_SETUP -#line 485 "pars0lex.l" +#line 484 "pars0lex.l" { return(PARS_INSTR_TOKEN); } YY_BREAK case 77: YY_RULE_SETUP -#line 489 "pars0lex.l" +#line 488 "pars0lex.l" { return(PARS_LENGTH_TOKEN); } YY_BREAK case 78: YY_RULE_SETUP -#line 493 "pars0lex.l" +#line 492 "pars0lex.l" { return(PARS_SYSDATE_TOKEN); } YY_BREAK case 79: YY_RULE_SETUP -#line 497 "pars0lex.l" +#line 496 "pars0lex.l" { return(PARS_PRINTF_TOKEN); } YY_BREAK case 80: YY_RULE_SETUP -#line 501 "pars0lex.l" +#line 500 "pars0lex.l" { return(PARS_ASSERT_TOKEN); } YY_BREAK case 81: YY_RULE_SETUP -#line 505 "pars0lex.l" +#line 504 "pars0lex.l" { return(PARS_RND_TOKEN); } YY_BREAK case 82: YY_RULE_SETUP -#line 509 "pars0lex.l" +#line 508 "pars0lex.l" { return(PARS_RND_STR_TOKEN); } YY_BREAK case 83: YY_RULE_SETUP -#line 513 "pars0lex.l" +#line 512 "pars0lex.l" { return(PARS_ROW_PRINTF_TOKEN); } YY_BREAK case 84: YY_RULE_SETUP -#line 517 "pars0lex.l" +#line 516 "pars0lex.l" { return(PARS_COMMIT_TOKEN); } YY_BREAK case 85: YY_RULE_SETUP -#line 521 "pars0lex.l" +#line 520 "pars0lex.l" { return(PARS_ROLLBACK_TOKEN); } YY_BREAK case 86: YY_RULE_SETUP -#line 525 "pars0lex.l" +#line 524 "pars0lex.l" { return(PARS_WORK_TOKEN); } YY_BREAK case 87: YY_RULE_SETUP -#line 529 "pars0lex.l" +#line 528 "pars0lex.l" { return(PARS_UNSIGNED_TOKEN); } YY_BREAK case 88: YY_RULE_SETUP -#line 533 "pars0lex.l" +#line 532 "pars0lex.l" { return(PARS_EXIT_TOKEN); } YY_BREAK case 89: YY_RULE_SETUP -#line 537 "pars0lex.l" +#line 536 "pars0lex.l" { return(PARS_FUNCTION_TOKEN); } YY_BREAK case 90: YY_RULE_SETUP -#line 541 "pars0lex.l" +#line 540 "pars0lex.l" { return(PARS_LOCK_TOKEN); } YY_BREAK case 91: YY_RULE_SETUP -#line 545 "pars0lex.l" +#line 544 "pars0lex.l" { return(PARS_SHARE_TOKEN); } YY_BREAK case 92: YY_RULE_SETUP -#line 549 "pars0lex.l" +#line 548 "pars0lex.l" { return(PARS_MODE_TOKEN); } YY_BREAK case 93: YY_RULE_SETUP -#line 553 "pars0lex.l" +#line 552 "pars0lex.l" { return(PARS_LIKE_TOKEN); } YY_BREAK case 94: YY_RULE_SETUP -#line 557 "pars0lex.l" +#line 556 "pars0lex.l" { return(PARS_BIGINT_TOKEN); } YY_BREAK case 95: YY_RULE_SETUP -#line 561 "pars0lex.l" +#line 560 "pars0lex.l" { yylval = sym_tab_add_id(pars_sym_tab_global, (byte*) yytext, @@ -1995,7 +1983,7 @@ YY_RULE_SETUP YY_BREAK case 96: YY_RULE_SETUP -#line 568 "pars0lex.l" +#line 567 "pars0lex.l" { yylval = sym_tab_add_id(pars_sym_tab_global, (byte*) yytext, @@ -2005,42 +1993,42 @@ YY_RULE_SETUP YY_BREAK case 97: YY_RULE_SETUP -#line 575 "pars0lex.l" +#line 574 "pars0lex.l" { return(PARS_DDOT_TOKEN); } YY_BREAK case 98: YY_RULE_SETUP -#line 579 "pars0lex.l" +#line 578 "pars0lex.l" { return(PARS_ASSIGN_TOKEN); } YY_BREAK case 99: YY_RULE_SETUP -#line 583 "pars0lex.l" +#line 582 "pars0lex.l" { return(PARS_LE_TOKEN); } YY_BREAK case 100: YY_RULE_SETUP -#line 587 "pars0lex.l" +#line 586 "pars0lex.l" { return(PARS_GE_TOKEN); } YY_BREAK case 101: YY_RULE_SETUP -#line 591 "pars0lex.l" +#line 590 "pars0lex.l" { return(PARS_NE_TOKEN); } YY_BREAK case 102: YY_RULE_SETUP -#line 595 "pars0lex.l" +#line 594 "pars0lex.l" { return((int)(*yytext)); @@ -2048,7 +2036,7 @@ YY_RULE_SETUP YY_BREAK case 103: YY_RULE_SETUP -#line 600 "pars0lex.l" +#line 599 "pars0lex.l" { return((int)(*yytext)); @@ -2056,7 +2044,7 @@ YY_RULE_SETUP YY_BREAK case 104: YY_RULE_SETUP -#line 605 "pars0lex.l" +#line 604 "pars0lex.l" { return((int)(*yytext)); @@ -2064,7 +2052,7 @@ YY_RULE_SETUP YY_BREAK case 105: YY_RULE_SETUP -#line 610 "pars0lex.l" +#line 609 "pars0lex.l" { return((int)(*yytext)); @@ -2072,7 +2060,7 @@ YY_RULE_SETUP YY_BREAK case 106: YY_RULE_SETUP -#line 615 "pars0lex.l" +#line 614 "pars0lex.l" { return((int)(*yytext)); @@ -2080,7 +2068,7 @@ YY_RULE_SETUP YY_BREAK case 107: YY_RULE_SETUP -#line 620 "pars0lex.l" +#line 619 "pars0lex.l" { return((int)(*yytext)); @@ -2088,7 +2076,7 @@ YY_RULE_SETUP YY_BREAK case 108: YY_RULE_SETUP -#line 625 "pars0lex.l" +#line 624 "pars0lex.l" { return((int)(*yytext)); @@ -2096,7 +2084,7 @@ YY_RULE_SETUP YY_BREAK case 109: YY_RULE_SETUP -#line 630 "pars0lex.l" +#line 629 "pars0lex.l" { return((int)(*yytext)); @@ -2104,7 +2092,7 @@ YY_RULE_SETUP YY_BREAK case 110: YY_RULE_SETUP -#line 635 "pars0lex.l" +#line 634 "pars0lex.l" { return((int)(*yytext)); @@ -2112,7 +2100,7 @@ YY_RULE_SETUP YY_BREAK case 111: YY_RULE_SETUP -#line 640 "pars0lex.l" +#line 639 "pars0lex.l" { return((int)(*yytext)); @@ -2120,7 +2108,7 @@ YY_RULE_SETUP YY_BREAK case 112: YY_RULE_SETUP -#line 645 "pars0lex.l" +#line 644 "pars0lex.l" { return((int)(*yytext)); @@ -2128,7 +2116,7 @@ YY_RULE_SETUP YY_BREAK case 113: YY_RULE_SETUP -#line 650 "pars0lex.l" +#line 649 "pars0lex.l" { return((int)(*yytext)); @@ -2136,7 +2124,7 @@ YY_RULE_SETUP YY_BREAK case 114: YY_RULE_SETUP -#line 655 "pars0lex.l" +#line 654 "pars0lex.l" { return((int)(*yytext)); @@ -2144,7 +2132,7 @@ YY_RULE_SETUP YY_BREAK case 115: YY_RULE_SETUP -#line 660 "pars0lex.l" +#line 659 "pars0lex.l" { return((int)(*yytext)); @@ -2152,7 +2140,7 @@ YY_RULE_SETUP YY_BREAK case 116: YY_RULE_SETUP -#line 665 "pars0lex.l" +#line 664 "pars0lex.l" { return((int)(*yytext)); @@ -2160,35 +2148,35 @@ YY_RULE_SETUP YY_BREAK case 117: YY_RULE_SETUP -#line 670 "pars0lex.l" +#line 669 "pars0lex.l" BEGIN(comment); /* eat up comment */ YY_BREAK case 118: /* rule 118 can match eol */ YY_RULE_SETUP -#line 672 "pars0lex.l" +#line 671 "pars0lex.l" YY_BREAK case 119: /* rule 119 can match eol */ YY_RULE_SETUP -#line 673 "pars0lex.l" +#line 672 "pars0lex.l" YY_BREAK case 120: YY_RULE_SETUP -#line 674 "pars0lex.l" +#line 673 "pars0lex.l" BEGIN(INITIAL); YY_BREAK case 121: /* rule 121 can match eol */ YY_RULE_SETUP -#line 676 "pars0lex.l" +#line 675 "pars0lex.l" /* eat up whitespace */ YY_BREAK case 122: YY_RULE_SETUP -#line 679 "pars0lex.l" +#line 678 "pars0lex.l" { fprintf(stderr,"Unrecognized character: %02x\n", *yytext); @@ -2200,10 +2188,10 @@ YY_RULE_SETUP YY_BREAK case 123: YY_RULE_SETUP -#line 688 "pars0lex.l" +#line 687 "pars0lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2206 "lexyy.cc" +#line 2194 "lexyy.cc" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(comment): case YY_STATE_EOF(quoted): @@ -2285,7 +2273,7 @@ case YY_STATE_EOF(id): { (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap( ) ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -2417,7 +2405,8 @@ static int yy_get_next_buffer (void) b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ @@ -2449,7 +2438,7 @@ static int yy_get_next_buffer (void) if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); + yyrestart( yyin ); } else @@ -2466,9 +2455,12 @@ static int yy_get_next_buffer (void) if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; @@ -2501,9 +2493,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 404 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; } return yy_current_state; @@ -2529,9 +2521,9 @@ static int yy_get_next_buffer (void) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 404 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_c = yy_meta[yy_c]; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (flex_int16_t) yy_c]; + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 403); return yy_is_jam ? 0 : yy_current_state; @@ -2565,7 +2557,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (int)((yy_c_buf_p) - (yytext_ptr)); + int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2582,13 +2574,13 @@ static int yy_get_next_buffer (void) */ /* Reset buffer status. */ - yyrestart(yyin ); + yyrestart( yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap( ) ) + if ( yywrap( ) ) return 0; if ( ! (yy_did_buffer_switch_on_eof) ) @@ -2626,11 +2618,11 @@ static int yy_get_next_buffer (void) if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); + yy_create_buffer( yyin, YY_BUF_SIZE ); } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer( YY_CURRENT_BUFFER, input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. @@ -2658,7 +2650,7 @@ static int yy_get_next_buffer (void) } YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag @@ -2686,22 +2678,22 @@ static void yy_load_buffer_state (void) { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = (yy_size_t)size; + b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer( b, file ); return b; } @@ -2720,9 +2712,9 @@ static void yy_load_buffer_state (void) YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + yyfree( (void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. @@ -2734,7 +2726,7 @@ static void yy_load_buffer_state (void) { int oerrno = errno; - yy_flush_buffer(b ); + yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; @@ -2777,7 +2769,7 @@ static void yy_load_buffer_state (void) b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes @@ -2808,7 +2800,7 @@ MY_ATTRIBUTE((unused)) static void yypush_buffer_state (YY_BUFFER_STATE new_buff YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } @@ -2827,7 +2819,7 @@ MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); + yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } @@ -2837,7 +2829,7 @@ MY_ATTRIBUTE((unused)) static void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2882,9 +2874,9 @@ static void yyensure_buffer_stack (void) #define YY_EXIT_FAILURE 2 #endif -static void yynoreturn yy_fatal_error (yyconst char* msg ) +static void yynoreturn yy_fatal_error (const char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); + fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -3019,7 +3011,7 @@ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); + yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } @@ -3040,7 +3032,7 @@ MY_ATTRIBUTE((unused)) static int yylex_destroy (void) */ #ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; @@ -3050,7 +3042,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) +static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) @@ -3085,8 +3077,7 @@ static void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 688 "pars0lex.l" - +#line 687 "pars0lex.l" /********************************************************************** diff --git a/storage/innobase/pars/make_flex.sh b/storage/innobase/pars/make_flex.sh index 2ddb1460640..37b62340320 100755 --- a/storage/innobase/pars/make_flex.sh +++ b/storage/innobase/pars/make_flex.sh @@ -1,7 +1,7 @@ #!/bin/bash # # Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved. -# Copyright (c) 2017, MariaDB Corporation. +# Copyright (c) 2017, 2019, MariaDB Corporation. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software @@ -24,15 +24,14 @@ OUTFILE=lexyy.cc flex -o $TMPFILE pars0lex.l -# AIX needs its includes done in a certain order, so include "univ.i" first -# to be sure we get it right. +# The Microsoft compiler needs its includes done in a certain order. echo '#include "univ.i"' > $OUTFILE # flex assigns a pointer to an int in one place without a cast, resulting in # a warning on Win64. Add the cast. Also define some symbols as static. sed -e ' s/'"$TMPFILE"'/'"$OUTFILE"'/; -s/^void yyset_extra *(YY_EXTRA_TYPE *user_defined *);// +s/^void *yyset_extra *( *YY_EXTRA_TYPE *user_defined *) *;// s/\(int offset = \)\((yy_c_buf_p) - (yytext_ptr)\);/\1(int)(\2);/; s/\(void yy\(restart\|_\(delete\|flush\)_buffer\)\)/static \1/; s/\(void yy_switch_to_buffer\)/MY_ATTRIBUTE((unused)) static \1/; diff --git a/storage/innobase/pars/pars0lex.l b/storage/innobase/pars/pars0lex.l index e73472866fb..c4b2d584369 100644 --- a/storage/innobase/pars/pars0lex.l +++ b/storage/innobase/pars/pars0lex.l @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -65,9 +65,8 @@ Created 12/14/1997 Heikki Tuuri #define realloc(P, A) ut_realloc(P, A) #define exit(A) ut_error -/* Note: We cast &result to int* from yysize_t* */ #define YY_INPUT(buf, result, max_size) \ - (result = pars_get_lex_chars(buf, max_size)) + result = pars_get_lex_chars(buf, max_size) /* String buffer for removing quotes */ static ulint stringbuf_len_alloc = 0; /* Allocated length */ diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index d7447810912..b4b9af4baa6 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2057,16 +2058,14 @@ pars_stored_procedure_call( /*************************************************************//** Retrieves characters to the lexical analyzer. */ -int +size_t pars_get_lex_chars( /*===============*/ char* buf, /*!< in/out: buffer where to copy */ - int max_size) /*!< in: maximum number of characters which fit + size_t max_size) /*!< in: maximum number of characters which fit in the buffer */ { - int len; - - len = static_cast<int>( + size_t len = size_t( pars_sym_tab_global->string_len - pars_sym_tab_global->next_char_pos); if (len == 0) { |