Commit a039d6c3 authored by Marko Mäkelä's avatar Marko Mäkelä

Remove unused tokens from the InnoDB SQL parser.

PARS_INTEGER_TOKEN: Remove. The lexer returns only PARS_INT_TOKEN.

PARS_FIXBINARY_LIT, PARS_BLOB_LIT: Remove. These are never returned
by the lexer. In sym_tab_add_bound_lit(), use PARS_STR_LIT.
parent e5eef051
......@@ -48,104 +48,101 @@ extern int yydebug;
PARS_INT_LIT = 258,
PARS_FLOAT_LIT = 259,
PARS_STR_LIT = 260,
PARS_FIXBINARY_LIT = 261,
PARS_BLOB_LIT = 262,
PARS_NULL_LIT = 263,
PARS_ID_TOKEN = 264,
PARS_AND_TOKEN = 265,
PARS_OR_TOKEN = 266,
PARS_NOT_TOKEN = 267,
PARS_GE_TOKEN = 268,
PARS_LE_TOKEN = 269,
PARS_NE_TOKEN = 270,
PARS_PROCEDURE_TOKEN = 271,
PARS_IN_TOKEN = 272,
PARS_OUT_TOKEN = 273,
PARS_BINARY_TOKEN = 274,
PARS_BLOB_TOKEN = 275,
PARS_INT_TOKEN = 276,
PARS_INTEGER_TOKEN = 277,
PARS_FLOAT_TOKEN = 278,
PARS_CHAR_TOKEN = 279,
PARS_IS_TOKEN = 280,
PARS_BEGIN_TOKEN = 281,
PARS_END_TOKEN = 282,
PARS_IF_TOKEN = 283,
PARS_THEN_TOKEN = 284,
PARS_ELSE_TOKEN = 285,
PARS_ELSIF_TOKEN = 286,
PARS_LOOP_TOKEN = 287,
PARS_WHILE_TOKEN = 288,
PARS_RETURN_TOKEN = 289,
PARS_SELECT_TOKEN = 290,
PARS_SUM_TOKEN = 291,
PARS_COUNT_TOKEN = 292,
PARS_DISTINCT_TOKEN = 293,
PARS_FROM_TOKEN = 294,
PARS_WHERE_TOKEN = 295,
PARS_FOR_TOKEN = 296,
PARS_DDOT_TOKEN = 297,
PARS_READ_TOKEN = 298,
PARS_ORDER_TOKEN = 299,
PARS_BY_TOKEN = 300,
PARS_ASC_TOKEN = 301,
PARS_DESC_TOKEN = 302,
PARS_INSERT_TOKEN = 303,
PARS_INTO_TOKEN = 304,
PARS_VALUES_TOKEN = 305,
PARS_UPDATE_TOKEN = 306,
PARS_SET_TOKEN = 307,
PARS_DELETE_TOKEN = 308,
PARS_CURRENT_TOKEN = 309,
PARS_OF_TOKEN = 310,
PARS_CREATE_TOKEN = 311,
PARS_TABLE_TOKEN = 312,
PARS_INDEX_TOKEN = 313,
PARS_UNIQUE_TOKEN = 314,
PARS_CLUSTERED_TOKEN = 315,
PARS_ON_TOKEN = 316,
PARS_ASSIGN_TOKEN = 317,
PARS_DECLARE_TOKEN = 318,
PARS_CURSOR_TOKEN = 319,
PARS_SQL_TOKEN = 320,
PARS_OPEN_TOKEN = 321,
PARS_FETCH_TOKEN = 322,
PARS_CLOSE_TOKEN = 323,
PARS_NOTFOUND_TOKEN = 324,
PARS_TO_CHAR_TOKEN = 325,
PARS_TO_NUMBER_TOKEN = 326,
PARS_TO_BINARY_TOKEN = 327,
PARS_BINARY_TO_NUMBER_TOKEN = 328,
PARS_SUBSTR_TOKEN = 329,
PARS_REPLSTR_TOKEN = 330,
PARS_CONCAT_TOKEN = 331,
PARS_INSTR_TOKEN = 332,
PARS_LENGTH_TOKEN = 333,
PARS_SYSDATE_TOKEN = 334,
PARS_PRINTF_TOKEN = 335,
PARS_ASSERT_TOKEN = 336,
PARS_RND_TOKEN = 337,
PARS_RND_STR_TOKEN = 338,
PARS_ROW_PRINTF_TOKEN = 339,
PARS_COMMIT_TOKEN = 340,
PARS_ROLLBACK_TOKEN = 341,
PARS_WORK_TOKEN = 342,
PARS_UNSIGNED_TOKEN = 343,
PARS_EXIT_TOKEN = 344,
PARS_FUNCTION_TOKEN = 345,
PARS_LOCK_TOKEN = 346,
PARS_SHARE_TOKEN = 347,
PARS_MODE_TOKEN = 348,
PARS_LIKE_TOKEN = 349,
PARS_LIKE_TOKEN_EXACT = 350,
PARS_LIKE_TOKEN_PREFIX = 351,
PARS_LIKE_TOKEN_SUFFIX = 352,
PARS_LIKE_TOKEN_SUBSTR = 353,
PARS_TABLE_NAME_TOKEN = 354,
PARS_COMPACT_TOKEN = 355,
PARS_BLOCK_SIZE_TOKEN = 356,
PARS_BIGINT_TOKEN = 357,
NEG = 358
PARS_NULL_LIT = 261,
PARS_ID_TOKEN = 262,
PARS_AND_TOKEN = 263,
PARS_OR_TOKEN = 264,
PARS_NOT_TOKEN = 265,
PARS_GE_TOKEN = 266,
PARS_LE_TOKEN = 267,
PARS_NE_TOKEN = 268,
PARS_PROCEDURE_TOKEN = 269,
PARS_IN_TOKEN = 270,
PARS_OUT_TOKEN = 271,
PARS_BINARY_TOKEN = 272,
PARS_BLOB_TOKEN = 273,
PARS_INT_TOKEN = 274,
PARS_FLOAT_TOKEN = 275,
PARS_CHAR_TOKEN = 276,
PARS_IS_TOKEN = 277,
PARS_BEGIN_TOKEN = 278,
PARS_END_TOKEN = 279,
PARS_IF_TOKEN = 280,
PARS_THEN_TOKEN = 281,
PARS_ELSE_TOKEN = 282,
PARS_ELSIF_TOKEN = 283,
PARS_LOOP_TOKEN = 284,
PARS_WHILE_TOKEN = 285,
PARS_RETURN_TOKEN = 286,
PARS_SELECT_TOKEN = 287,
PARS_SUM_TOKEN = 288,
PARS_COUNT_TOKEN = 289,
PARS_DISTINCT_TOKEN = 290,
PARS_FROM_TOKEN = 291,
PARS_WHERE_TOKEN = 292,
PARS_FOR_TOKEN = 293,
PARS_DDOT_TOKEN = 294,
PARS_READ_TOKEN = 295,
PARS_ORDER_TOKEN = 296,
PARS_BY_TOKEN = 297,
PARS_ASC_TOKEN = 298,
PARS_DESC_TOKEN = 299,
PARS_INSERT_TOKEN = 300,
PARS_INTO_TOKEN = 301,
PARS_VALUES_TOKEN = 302,
PARS_UPDATE_TOKEN = 303,
PARS_SET_TOKEN = 304,
PARS_DELETE_TOKEN = 305,
PARS_CURRENT_TOKEN = 306,
PARS_OF_TOKEN = 307,
PARS_CREATE_TOKEN = 308,
PARS_TABLE_TOKEN = 309,
PARS_INDEX_TOKEN = 310,
PARS_UNIQUE_TOKEN = 311,
PARS_CLUSTERED_TOKEN = 312,
PARS_ON_TOKEN = 313,
PARS_ASSIGN_TOKEN = 314,
PARS_DECLARE_TOKEN = 315,
PARS_CURSOR_TOKEN = 316,
PARS_SQL_TOKEN = 317,
PARS_OPEN_TOKEN = 318,
PARS_FETCH_TOKEN = 319,
PARS_CLOSE_TOKEN = 320,
PARS_NOTFOUND_TOKEN = 321,
PARS_TO_CHAR_TOKEN = 322,
PARS_TO_NUMBER_TOKEN = 323,
PARS_TO_BINARY_TOKEN = 324,
PARS_BINARY_TO_NUMBER_TOKEN = 325,
PARS_SUBSTR_TOKEN = 326,
PARS_REPLSTR_TOKEN = 327,
PARS_CONCAT_TOKEN = 328,
PARS_INSTR_TOKEN = 329,
PARS_LENGTH_TOKEN = 330,
PARS_SYSDATE_TOKEN = 331,
PARS_PRINTF_TOKEN = 332,
PARS_ASSERT_TOKEN = 333,
PARS_RND_TOKEN = 334,
PARS_RND_STR_TOKEN = 335,
PARS_ROW_PRINTF_TOKEN = 336,
PARS_COMMIT_TOKEN = 337,
PARS_ROLLBACK_TOKEN = 338,
PARS_WORK_TOKEN = 339,
PARS_UNSIGNED_TOKEN = 340,
PARS_EXIT_TOKEN = 341,
PARS_FUNCTION_TOKEN = 342,
PARS_LOCK_TOKEN = 343,
PARS_SHARE_TOKEN = 344,
PARS_MODE_TOKEN = 345,
PARS_LIKE_TOKEN = 346,
PARS_LIKE_TOKEN_EXACT = 347,
PARS_LIKE_TOKEN_PREFIX = 348,
PARS_LIKE_TOKEN_SUFFIX = 349,
PARS_LIKE_TOKEN_SUBSTR = 350,
PARS_TABLE_NAME_TOKEN = 351,
PARS_COMPACT_TOKEN = 352,
PARS_BLOCK_SIZE_TOKEN = 353,
PARS_BIGINT_TOKEN = 354,
NEG = 355
};
#endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -48,8 +48,6 @@ yylex(void);
%token PARS_INT_LIT
%token PARS_FLOAT_LIT
%token PARS_STR_LIT
%token PARS_FIXBINARY_LIT
%token PARS_BLOB_LIT
%token PARS_NULL_LIT
%token PARS_ID_TOKEN
%token PARS_AND_TOKEN
......@@ -64,7 +62,6 @@ yylex(void);
%token PARS_BINARY_TOKEN
%token PARS_BLOB_TOKEN
%token PARS_INT_TOKEN
%token PARS_INTEGER_TOKEN
%token PARS_FLOAT_TOKEN
%token PARS_CHAR_TOKEN
%token PARS_IS_TOKEN
......@@ -200,8 +197,6 @@ exp:
| PARS_INT_LIT { $$ = $1;}
| PARS_FLOAT_LIT { $$ = $1;}
| PARS_STR_LIT { $$ = $1;}
| PARS_FIXBINARY_LIT { $$ = $1;}
| PARS_BLOB_LIT { $$ = $1;}
| PARS_NULL_LIT { $$ = $1;}
| PARS_SQL_TOKEN { $$ = $1;}
| exp '+' exp { $$ = pars_op('+', $1, $3); }
......@@ -645,7 +640,6 @@ rollback_statement:
type_name:
PARS_INT_TOKEN { $$ = &pars_int_token; }
| PARS_INTEGER_TOKEN { $$ = &pars_int_token; }
| PARS_BIGINT_TOKEN { $$ = &pars_bigint_token; }
| PARS_CHAR_TOKEN { $$ = &pars_char_token; }
| PARS_BINARY_TOKEN { $$ = &pars_binary_token; }
......
......@@ -223,25 +223,15 @@ sym_tab_add_bound_lit(
switch (blit->type) {
case DATA_FIXBINARY:
case DATA_CHAR:
ut_ad(blit->length > 0);
len = blit->length;
*lit_type = PARS_FIXBINARY_LIT;
break;
/* fall through */
case DATA_BLOB:
*lit_type = PARS_BLOB_LIT;
break;
case DATA_VARCHAR:
*lit_type = PARS_STR_LIT;
break;
case DATA_CHAR:
ut_a(blit->length > 0);
len = blit->length;
*lit_type = PARS_STR_LIT;
break;
case DATA_INT:
ut_a(blit->length > 0);
ut_a(blit->length <= 8);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment