Commit 5ea7253f authored by osku's avatar osku

Enhance InnoDB SQL parser:

 Add support for NOT NULL in column definitions.

 Support INTEGER as an alias for INT.

 Add pars/make_bison.sh to automate parser generation.
parent 490dbe09
......@@ -343,8 +343,10 @@ pars_column_def(
sym_node_t* sym_node, /* in: column node in the
symbol table */
pars_res_word_t* type, /* in: data type */
sym_node_t* len); /* in: length of column, or
sym_node_t* len, /* in: length of column, or
NULL */
void* is_not_null); /* in: if not NULL, column
is of type NOT NULL. */
/*************************************************************************
Parses a table creation operation. */
......
#!/bin/bash
#
# regenerate parser from bison input files as documented at the top of
# pars0lex.l.
set -eu
bison -d pars0grm.y
mv pars0grm.tab.c pars0grm.c
mv pars0grm.tab.h pars0grm.h
cp pars0grm.h ../include
......@@ -385,16 +385,16 @@ union yyalloc
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 95
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 711
#define YYLAST 734
/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 104
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 63
#define YYNNTS 64
/* YYNRULES -- Number of rules. */
#define YYNRULES 161
#define YYNRULES 164
/* YYNRULES -- Number of states. */
#define YYNSTATES 317
#define YYNSTATES 321
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
......@@ -460,23 +460,23 @@ static const unsigned short int yyprhs[] =
261, 264, 265, 268, 269, 271, 273, 274, 279, 288,
292, 298, 301, 305, 307, 311, 316, 321, 324, 327,
331, 334, 337, 340, 344, 349, 351, 354, 355, 358,
360, 368, 375, 386, 388, 391, 394, 399, 403, 405,
409, 410, 414, 415, 417, 425, 427, 431, 432, 434,
435, 437, 448, 451, 454, 456, 458, 460, 462, 466,
470, 471, 473, 477, 481, 482, 484, 487, 494, 495,
497, 500
360, 368, 375, 386, 388, 391, 394, 399, 404, 406,
410, 411, 415, 416, 419, 420, 422, 430, 432, 436,
437, 439, 440, 442, 453, 456, 459, 461, 463, 465,
467, 469, 473, 477, 478, 480, 484, 488, 489, 491,
494, 501, 502, 504, 507
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const short int yyrhs[] =
{
105, 0, -1, 166, 97, -1, 110, -1, 111, 97,
105, 0, -1, 167, 97, -1, 110, -1, 111, 97,
-1, 142, 97, -1, 143, 97, -1, 141, 97, -1,
144, 97, -1, 137, 97, -1, 124, 97, -1, 126,
97, -1, 136, 97, -1, 134, 97, -1, 135, 97,
-1, 131, 97, -1, 132, 97, -1, 145, 97, -1,
147, 97, -1, 146, 97, -1, 157, 97, -1, 158,
97, -1, 152, 97, -1, 156, 97, -1, 105, -1,
147, 97, -1, 146, 97, -1, 158, 97, -1, 159,
97, -1, 153, 97, -1, 157, 97, -1, 105, -1,
106, 105, -1, 7, -1, 108, 98, 115, 99, -1,
3, -1, 4, -1, 5, -1, 6, -1, 65, -1,
107, 92, 107, -1, 107, 91, 107, -1, 107, 93,
......@@ -510,18 +510,18 @@ static const short int yyrhs[] =
30, 106, 25, 30, -1, 39, 7, 15, 107, 40,
107, 30, 106, 25, 30, -1, 32, -1, 66, 7,
-1, 68, 7, -1, 67, 7, 48, 114, -1, 7,
159, 150, -1, 148, -1, 149, 101, 148, -1, -1,
98, 3, 99, -1, -1, 60, -1, 55, 56, 7,
98, 149, 99, 151, -1, 7, -1, 153, 101, 7,
-1, -1, 58, -1, -1, 59, -1, 55, 154, 155,
57, 7, 61, 7, 98, 153, 99, -1, 85, 87,
-1, 86, 87, -1, 19, -1, 22, -1, 17, -1,
18, -1, 7, 15, 159, -1, 7, 16, 159, -1,
-1, 160, -1, 161, 101, 160, -1, 7, 159, 97,
-1, -1, 162, -1, 163, 162, -1, 63, 64, 7,
23, 124, 97, -1, -1, 164, -1, 165, 164, -1,
14, 7, 98, 161, 99, 23, 163, 165, 24, 106,
25, -1
160, 150, 151, -1, 148, -1, 149, 101, 148, -1,
-1, 98, 3, 99, -1, -1, 10, 6, -1, -1,
60, -1, 55, 56, 7, 98, 149, 99, 152, -1,
7, -1, 154, 101, 7, -1, -1, 58, -1, -1,
59, -1, 55, 155, 156, 57, 7, 61, 7, 98,
154, 99, -1, 85, 87, -1, 86, 87, -1, 19,
-1, 20, -1, 22, -1, 17, -1, 18, -1, 7,
15, 160, -1, 7, 16, 160, -1, -1, 161, -1,
162, 101, 161, -1, 7, 160, 97, -1, -1, 163,
-1, 164, 163, -1, 63, 64, 7, 23, 124, 97,
-1, -1, 165, -1, 166, 165, -1, 14, 7, 98,
162, 99, 23, 164, 166, 24, 106, 25, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
......@@ -540,10 +540,10 @@ static const unsigned short int yyrline[] =
326, 328, 333, 337, 338, 343, 349, 356, 361, 366,
372, 377, 382, 387, 392, 398, 399, 404, 405, 407,
411, 418, 424, 432, 436, 442, 448, 453, 458, 459,
464, 465, 469, 470, 476, 482, 483, 488, 489, 493,
494, 498, 506, 511, 516, 517, 518, 519, 523, 526,
532, 533, 534, 539, 543, 545, 546, 550, 555, 557,
558, 562
464, 465, 470, 471, 477, 478, 484, 490, 491, 496,
497, 501, 502, 506, 514, 519, 524, 525, 526, 527,
528, 532, 535, 541, 542, 543, 548, 552, 554, 555,
559, 564, 566, 567, 571
};
#endif
......@@ -596,12 +596,13 @@ static const char *const yytname[] =
"assignment_statement", "elsif_element", "elsif_list", "else_part",
"if_statement", "while_statement", "for_statement", "return_statement",
"open_cursor_statement", "close_cursor_statement", "fetch_statement",
"column_def", "column_def_list", "opt_column_len", "not_fit_in_memory",
"create_table", "column_list", "unique_def", "clustered_def",
"create_index", "commit_statement", "rollback_statement", "type_name",
"parameter_declaration", "parameter_declaration_list",
"variable_declaration", "variable_declaration_list",
"cursor_declaration", "declaration_list", "procedure_definition", 0
"column_def", "column_def_list", "opt_column_len", "opt_not_null",
"not_fit_in_memory", "create_table", "column_list", "unique_def",
"clustered_def", "create_index", "commit_statement",
"rollback_statement", "type_name", "parameter_declaration",
"parameter_declaration_list", "variable_declaration",
"variable_declaration_list", "cursor_declaration", "declaration_list",
"procedure_definition", 0
};
#endif
......@@ -640,10 +641,10 @@ static const unsigned char yyr1[] =
126, 126, 127, 128, 128, 129, 130, 131, 132, 133,
134, 135, 136, 137, 138, 139, 139, 140, 140, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 149,
150, 150, 151, 151, 152, 153, 153, 154, 154, 155,
155, 156, 157, 158, 159, 159, 159, 159, 160, 160,
161, 161, 161, 162, 163, 163, 163, 164, 165, 165,
165, 166
150, 150, 151, 151, 152, 152, 153, 154, 154, 155,
155, 156, 156, 157, 158, 159, 160, 160, 160, 160,
160, 161, 161, 162, 162, 162, 163, 164, 164, 164,
165, 166, 166, 166, 167
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
......@@ -661,11 +662,11 @@ static const unsigned char yyr2[] =
2, 0, 2, 0, 1, 1, 0, 4, 8, 3,
5, 2, 3, 1, 3, 4, 4, 2, 2, 3,
2, 2, 2, 3, 4, 1, 2, 0, 2, 1,
7, 6, 10, 1, 2, 2, 4, 3, 1, 3,
0, 3, 0, 1, 7, 1, 3, 0, 1, 0,
1, 10, 2, 2, 1, 1, 1, 1, 3, 3,
0, 1, 3, 3, 0, 1, 2, 6, 0, 1,
2, 11
7, 6, 10, 1, 2, 2, 4, 4, 1, 3,
0, 3, 0, 2, 0, 1, 7, 1, 3, 0,
1, 0, 1, 10, 2, 2, 1, 1, 1, 1,
1, 3, 3, 0, 1, 3, 3, 0, 1, 2,
6, 0, 1, 2, 11
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
......@@ -674,22 +675,22 @@ static const unsigned char yyr2[] =
static const unsigned char yydefact[] =
{
0, 0, 0, 0, 0, 123, 81, 0, 0, 0,
0, 137, 0, 0, 0, 66, 67, 68, 0, 0,
0, 139, 0, 0, 0, 66, 67, 68, 0, 0,
0, 0, 0, 3, 0, 0, 0, 0, 0, 87,
0, 0, 87, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 28, 29, 30, 31, 26, 0, 32, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 0,
0, 0, 0, 0, 0, 0, 84, 77, 82, 86,
0, 0, 0, 0, 0, 0, 138, 139, 124, 0,
125, 112, 142, 143, 0, 1, 4, 74, 10, 0,
0, 0, 0, 0, 0, 0, 140, 141, 124, 0,
125, 112, 144, 145, 0, 1, 4, 74, 10, 0,
101, 11, 0, 107, 108, 15, 16, 110, 111, 13,
14, 12, 9, 7, 5, 6, 8, 17, 19, 18,
22, 23, 20, 21, 2, 113, 150, 0, 47, 0,
22, 23, 20, 21, 2, 113, 153, 0, 47, 0,
37, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 74, 0, 0, 0, 71,
0, 0, 0, 99, 0, 109, 0, 140, 0, 71,
61, 75, 0, 74, 0, 88, 0, 151, 0, 48,
0, 0, 0, 99, 0, 109, 0, 142, 0, 71,
61, 75, 0, 74, 0, 88, 0, 154, 0, 48,
49, 38, 45, 46, 42, 43, 44, 24, 117, 39,
40, 41, 34, 33, 35, 36, 0, 0, 0, 0,
0, 72, 85, 83, 69, 87, 0, 0, 103, 106,
......@@ -697,77 +698,79 @@ static const unsigned char yydefact[] =
0, 0, 0, 0, 0, 25, 115, 119, 0, 27,
0, 80, 0, 78, 0, 0, 0, 89, 0, 0,
0, 0, 128, 0, 0, 0, 0, 76, 100, 105,
146, 147, 144, 145, 148, 149, 154, 152, 118, 0,
116, 0, 121, 79, 73, 70, 0, 91, 0, 102,
104, 130, 132, 0, 0, 64, 63, 0, 155, 158,
0, 120, 90, 0, 96, 0, 0, 127, 133, 134,
129, 0, 0, 0, 156, 159, 0, 114, 92, 0,
98, 0, 0, 0, 153, 0, 0, 160, 0, 0,
131, 135, 0, 0, 0, 93, 122, 141, 0, 0,
161, 94, 95, 97, 136, 0, 157
149, 150, 146, 147, 148, 151, 152, 157, 155, 118,
0, 116, 0, 121, 79, 73, 70, 0, 91, 0,
102, 104, 130, 134, 0, 0, 64, 63, 0, 158,
161, 0, 120, 90, 0, 96, 0, 0, 132, 135,
136, 129, 0, 0, 0, 159, 162, 0, 114, 92,
0, 98, 0, 0, 0, 127, 0, 156, 0, 0,
163, 0, 0, 131, 133, 137, 0, 0, 0, 93,
122, 143, 0, 0, 164, 94, 95, 97, 138, 0,
160
};
/* YYDEFGOTO[NTERM-NUM]. */
static const short int yydefgoto[] =
{
-1, 177, 178, 161, 72, 204, 23, 24, 25, 195,
192, 162, 78, 79, 80, 103, 257, 274, 313, 290,
192, 162, 78, 79, 80, 103, 258, 275, 317, 291,
26, 27, 28, 198, 199, 104, 29, 30, 31, 32,
33, 34, 35, 36, 216, 217, 218, 37, 38, 39,
40, 41, 42, 43, 232, 233, 277, 279, 44, 302,
87, 158, 45, 46, 47, 244, 167, 168, 268, 269,
285, 286, 48
40, 41, 42, 43, 232, 233, 278, 295, 280, 44,
306, 87, 158, 45, 46, 47, 245, 167, 168, 269,
270, 286, 287, 48
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -197
#define YYPACT_NINF -205
static const short int yypact[] =
{
466, -49, 47, 533, 533, -197, 26, 49, 9, 51,
22, -39, 55, 56, 59, -197, -197, -197, 34, -14,
-12, 67, 76, -197, -20, -19, -16, -11, -15, 40,
-5, -3, 40, -2, 10, 13, 16, 21, 23, 24,
25, 28, 29, 30, 31, 32, 33, 39, 50, 533,
-18, -197, -197, -197, -197, 27, 533, 48, -197, -197,
-197, -197, -197, -197, -197, -197, -197, -197, -197, 533,
533, 552, 8, 264, 54, 57, -197, 588, -197, -36,
46, 78, 141, 102, 147, 149, -197, 98, -197, 111,
-197, -197, -197, -197, 62, -197, -197, 533, -197, 63,
-197, -197, 504, -197, -197, -197, -197, -197, -197, -197,
-197, -197, -197, -197, -197, -197, -197, -197, -197, -197,
-197, -197, -197, -197, -197, 588, 155, 94, 378, 95,
153, 103, 533, 533, 533, 533, 533, 466, 533, 533,
533, 533, 533, 533, 533, 533, 466, 533, -21, 161,
235, 162, 533, -197, 163, -197, 74, -197, 116, 161,
75, 588, -81, 533, 120, 588, 11, -197, -62, -197,
-197, -197, 378, 378, -7, -7, 588, -197, 151, -7,
-7, -7, -4, -4, 153, 153, -59, 296, 248, 169,
82, -197, 84, -197, -197, -31, 580, 100, -197, 85,
182, 192, 84, -197, -58, -197, 533, -55, 193, 6,
6, 181, 155, 466, 533, -197, -197, 178, 183, -197,
179, -197, 112, -197, 203, 533, 205, 175, 533, 533,
163, 6, -197, -54, 154, 113, 121, 588, -197, -197,
-197, -197, -197, -197, -197, -197, 213, -197, 466, 610,
-197, 196, -197, -197, -197, -197, 173, 184, 617, 588,
-197, 131, 170, 182, 226, -197, -197, 6, -197, 1,
466, -197, -197, 201, 191, 466, 241, -197, -197, -197,
-197, 148, 150, 185, -197, -197, -13, 466, -197, 206,
-197, 353, 152, 245, -197, 247, 466, -197, 251, 225,
-197, -197, -50, 239, 410, 7, -197, -197, 256, 34,
-197, -197, -197, -197, -197, 167, -197
454, -48, 30, 521, 521, -205, 12, 42, -18, 46,
-4, -33, 67, 69, 71, -205, -205, -205, 47, -8,
-6, 85, 93, -205, 1, -2, 2, -20, 3, 59,
5, 7, 59, 24, 27, 28, 31, 32, 33, 39,
50, 51, 55, 56, 57, 58, 60, 62, 63, 521,
22, -205, -205, -205, -205, 48, 521, 65, -205, -205,
-205, -205, -205, -205, -205, -205, -205, -205, -205, 521,
521, 252, 64, 576, 66, 68, -205, 640, -205, -40,
86, 111, 120, 105, 156, 161, -205, 110, -205, 122,
-205, -205, -205, -205, 73, -205, -205, 521, -205, 74,
-205, -205, 492, -205, -205, -205, -205, -205, -205, -205,
-205, -205, -205, -205, -205, -205, -205, -205, -205, -205,
-205, -205, -205, -205, -205, 640, 167, 106, 309, 107,
168, 23, 521, 521, 521, 521, 521, 454, 521, 521,
521, 521, 521, 521, 521, 521, 454, 521, -27, 178,
204, 179, 521, -205, 181, -205, 91, -205, 134, 178,
92, 640, -75, 521, 139, 640, 29, -205, -59, -205,
-205, -205, 309, 309, 15, 15, 640, -205, 151, 15,
15, 15, 25, 25, 168, 168, -58, 284, 535, 187,
96, -205, 95, -205, -205, -31, 568, 109, -205, 98,
193, 195, 95, -205, -49, -205, 521, -45, 197, 40,
40, 189, 167, 454, 521, -205, -205, 186, 191, -205,
190, -205, 123, -205, 214, 521, 216, 194, 521, 521,
181, 40, -205, -36, 164, 126, 130, 640, -205, -205,
-205, -205, -205, -205, -205, -205, -205, 227, -205, 454,
605, -205, 215, -205, -205, -205, -205, 192, 199, 633,
640, -205, 145, 184, 193, 238, -205, -205, 40, -205,
4, 454, -205, -205, 205, 203, 454, 245, 240, -205,
-205, -205, 153, 155, 198, -205, -205, -12, 454, -205,
210, -205, 341, 157, 249, -205, 250, -205, 251, 454,
-205, 259, 229, -205, -205, -205, -26, 244, 398, 26,
-205, -205, 261, 47, -205, -205, -205, -205, -205, 173,
-205
};
/* YYPGOTO[NTERM-NUM]. */
static const short int yypgoto[] =
{
-197, 0, -125, -1, -197, -197, -197, -197, -197, -197,
106, -129, 117, -197, -197, -28, -197, -197, -197, -197,
-17, -197, -197, 36, -197, 236, -197, -197, -197, -197,
-197, -197, -197, -197, 61, -197, -197, -197, -197, -197,
-197, -197, -197, -197, 17, -197, -197, -197, -197, -197,
-197, -197, -197, -197, -197, -196, 69, -197, 2, -197,
3, -197, -197
-205, 0, -126, -1, -205, -205, -205, -205, -205, -205,
112, -124, 135, -205, -205, -28, -205, -205, -205, -205,
-17, -205, -205, 43, -205, 257, -205, -205, -205, -205,
-205, -205, -205, -205, 76, -205, -205, -205, -205, -205,
-205, -205, -205, -205, 8, -205, -205, -205, -205, -205,
-205, -205, -205, -205, -205, -205, -204, 72, -205, 20,
-205, 10, -205, -205
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
......@@ -777,154 +780,158 @@ static const short int yypgoto[] =
#define YYTABLE_NINF -1
static const unsigned short int yytable[] =
{
22, 91, 71, 73, 107, 77, 136, 225, 267, 136,
100, 296, 149, 49, 245, 189, 186, 85, 205, 86,
206, 187, 6, 240, 241, 242, 209, 210, 243, 51,
52, 53, 54, 55, 207, 261, 56, 211, 99, 212,
219, 235, 206, 236, 238, 262, 206, 263, 125, 307,
283, 308, 311, 312, 50, 128, 81, 82, 83, 84,
74, 75, 88, 89, 283, 150, 90, 6, 130, 131,
226, 282, 190, 92, 94, 93, 95, 96, 102, 97,
126, 98, 101, 151, 141, 142, 143, 144, 248, 143,
144, 57, 105, 152, 106, 109, 58, 59, 60, 61,
62, 165, 63, 64, 65, 66, 145, 110, 67, 68,
111, 132, 133, 112, 134, 135, 136, 69, 113, 76,
114, 115, 116, 127, 70, 117, 118, 119, 120, 121,
122, 172, 173, 174, 175, 176, 123, 179, 180, 181,
182, 183, 184, 185, 129, 287, 188, 124, 153, 77,
291, 196, 147, 154, 155, 148, 156, 157, 1, 159,
160, 163, 166, 169, 170, 2, 136, 227, 191, 194,
197, 304, 200, 201, 208, 203, 222, 3, 215, 213,
214, 223, 4, 5, 6, 224, 230, 215, 229, 231,
7, 138, 139, 140, 141, 142, 143, 144, 8, 234,
239, 9, 171, 10, 246, 237, 11, 214, 251, 252,
254, 253, 255, 249, 256, 264, 265, 12, 13, 14,
267, 266, 271, 272, 165, 273, 15, 258, 259, 276,
278, 16, 17, 281, 289, 18, 19, 20, 51, 52,
53, 54, 55, 288, 292, 56, 293, 294, 215, 295,
298, 300, 301, 21, 303, 306, 132, 133, 305, 134,
135, 136, 309, 314, 316, 202, 260, 193, 108, 74,
75, 284, 132, 133, 0, 134, 135, 136, 250, 0,
280, 247, 0, 0, 0, 0, 0, 215, 0, 297,
0, 215, 315, 0, 146, 0, 0, 0, 0, 0,
57, 0, 0, 1, 215, 58, 59, 60, 61, 62,
2, 63, 64, 65, 66, 0, 0, 67, 68, 0,
0, 220, 3, 0, 0, 0, 69, 4, 5, 6,
0, 0, 0, 70, 0, 7, 138, 139, 140, 141,
142, 143, 144, 8, 0, 0, 9, 221, 10, 0,
0, 11, 138, 139, 140, 141, 142, 143, 144, 0,
1, 0, 12, 13, 14, 0, 0, 2, 0, 0,
0, 15, 0, 0, 0, 0, 16, 17, 299, 3,
18, 19, 20, 0, 4, 5, 6, 0, 0, 134,
135, 136, 7, 0, 0, 0, 0, 0, 21, 0,
8, 0, 0, 9, 0, 10, 0, 0, 11, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 12,
13, 14, 0, 0, 2, 0, 0, 0, 15, 0,
0, 0, 0, 16, 17, 310, 3, 18, 19, 20,
0, 4, 5, 6, 0, 0, 0, 0, 0, 7,
0, 0, 0, 0, 0, 21, 0, 8, 0, 0,
9, 0, 10, 0, 0, 11, 138, 139, 140, 141,
142, 143, 144, 1, 0, 0, 12, 13, 14, 0,
2, 0, 0, 0, 0, 15, 0, 0, 0, 0,
16, 17, 3, 0, 18, 19, 20, 4, 5, 6,
0, 0, 0, 0, 0, 7, 0, 51, 52, 53,
54, 55, 21, 8, 56, 0, 9, 0, 10, 0,
0, 11, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 12, 13, 14, 0, 51, 52, 53, 54,
55, 15, 0, 56, 0, 0, 16, 17, 0, 0,
18, 19, 20, 0, 0, 0, 0, 164, 0, 0,
132, 133, 0, 134, 135, 136, 0, 0, 21, 57,
0, 0, 0, 0, 58, 59, 60, 61, 62, 137,
63, 64, 65, 66, 0, 0, 67, 68, 132, 133,
0, 134, 135, 136, 0, 69, 132, 133, 57, 134,
135, 136, 70, 58, 59, 60, 61, 62, 0, 63,
64, 65, 66, 0, 0, 67, 68, 0, 132, 133,
228, 134, 135, 136, 69, 132, 133, 0, 134, 135,
136, 70, 0, 0, 0, 0, 0, 270, 0, 0,
138, 139, 140, 141, 142, 143, 144, 275, 0, 0,
22, 91, 71, 73, 107, 77, 246, 225, 149, 189,
100, 268, 299, 6, 49, 51, 52, 53, 54, 55,
187, 186, 56, 85, 205, 86, 206, 262, 136, 99,
82, 132, 133, 84, 134, 135, 136, 50, 136, 207,
211, 219, 212, 206, 209, 210, 74, 75, 125, 81,
235, 284, 236, 83, 238, 128, 206, 240, 241, 242,
243, 150, 244, 263, 283, 264, 190, 284, 130, 131,
226, 315, 316, 311, 88, 312, 89, 57, 90, 92,
6, 93, 58, 59, 60, 61, 62, 249, 63, 64,
65, 66, 94, 95, 67, 68, 97, 102, 96, 98,
101, 165, 105, 69, 106, 76, 141, 142, 143, 144,
70, 138, 139, 140, 141, 142, 143, 144, 143, 144,
126, 109, 171, 151, 110, 111, 152, 153, 112, 113,
114, 172, 173, 174, 175, 176, 115, 179, 180, 181,
182, 183, 184, 185, 127, 288, 188, 116, 117, 77,
292, 196, 118, 119, 120, 121, 154, 122, 1, 123,
124, 129, 145, 155, 147, 2, 148, 227, 156, 157,
159, 160, 163, 308, 166, 169, 170, 3, 215, 213,
214, 136, 4, 5, 6, 191, 194, 215, 197, 200,
7, 201, 203, 208, 222, 223, 224, 229, 8, 230,
231, 9, 234, 10, 239, 237, 11, 51, 52, 53,
54, 55, 247, 250, 56, 214, 252, 12, 13, 14,
253, 255, 254, 256, 165, 265, 15, 259, 260, 266,
267, 16, 17, 257, 268, 18, 19, 20, 74, 75,
274, 272, 273, 277, 279, 282, 290, 289, 293, 215,
294, 296, 297, 21, 301, 304, 303, 305, 307, 310,
132, 133, 298, 134, 135, 136, 309, 313, 318, 57,
320, 202, 281, 261, 58, 59, 60, 61, 62, 137,
63, 64, 65, 66, 248, 193, 67, 68, 215, 108,
285, 1, 215, 251, 0, 69, 319, 300, 2, 0,
0, 0, 70, 0, 0, 0, 0, 0, 215, 220,
3, 0, 0, 0, 0, 4, 5, 6, 0, 0,
134, 135, 136, 7, 0, 0, 0, 0, 0, 0,
0, 8, 0, 0, 9, 0, 10, 0, 0, 11,
138, 139, 140, 141, 142, 143, 144, 0, 1, 0,
12, 13, 14, 0, 0, 2, 0, 0, 0, 15,
0, 0, 0, 0, 16, 17, 302, 3, 18, 19,
20, 0, 4, 5, 6, 0, 0, 0, 0, 0,
7, 0, 0, 0, 0, 0, 21, 0, 8, 0,
0, 9, 0, 10, 0, 0, 11, 138, 139, 140,
141, 142, 143, 144, 0, 1, 0, 12, 13, 14,
0, 0, 2, 0, 0, 0, 15, 0, 0, 0,
0, 16, 17, 314, 3, 18, 19, 20, 0, 4,
5, 6, 0, 0, 0, 0, 0, 7, 0, 0,
0, 0, 0, 21, 0, 8, 0, 0, 9, 0,
10, 0, 0, 11, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 12, 13, 14, 0, 2, 0,
0, 0, 0, 15, 0, 0, 0, 0, 16, 17,
3, 0, 18, 19, 20, 4, 5, 6, 0, 0,
0, 0, 0, 7, 0, 51, 52, 53, 54, 55,
21, 8, 56, 0, 9, 0, 10, 0, 0, 11,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 138, 139,
140, 141, 142, 143, 144, 0, 138, 139, 140, 141,
142, 143, 144, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 138, 139,
140, 141, 142, 143, 144, 138, 139, 140, 141, 142,
143, 144
12, 13, 14, 0, 51, 52, 53, 54, 55, 15,
0, 56, 0, 0, 16, 17, 0, 0, 18, 19,
20, 0, 0, 132, 133, 164, 134, 135, 136, 0,
0, 0, 0, 0, 0, 0, 21, 57, 0, 0,
0, 0, 58, 59, 60, 61, 62, 0, 63, 64,
65, 66, 0, 0, 67, 68, 132, 133, 0, 134,
135, 136, 0, 69, 132, 133, 57, 134, 135, 136,
70, 58, 59, 60, 61, 62, 0, 63, 64, 65,
66, 0, 0, 67, 68, 0, 146, 0, 228, 0,
0, 0, 69, 132, 133, 0, 134, 135, 136, 70,
0, 0, 0, 138, 139, 140, 141, 142, 143, 144,
0, 0, 271, 0, 221, 0, 0, 0, 0, 0,
0, 132, 133, 0, 134, 135, 136, 0, 132, 133,
0, 134, 135, 136, 0, 0, 138, 139, 140, 141,
142, 143, 144, 276, 138, 139, 140, 141, 142, 143,
144, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 138, 139, 140, 141, 142, 143, 144,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 138, 139, 140, 141, 142, 143, 144, 138, 139,
140, 141, 142, 143, 144
};
static const short int yycheck[] =
{
0, 18, 3, 4, 32, 6, 13, 38, 7, 13,
27, 24, 48, 62, 210, 36, 145, 56, 99, 58,
101, 146, 33, 17, 18, 19, 15, 16, 22, 3,
4, 5, 6, 7, 163, 231, 10, 99, 49, 101,
99, 99, 101, 101, 99, 99, 101, 101, 49, 99,
63, 101, 45, 46, 7, 56, 7, 48, 7, 37,
34, 35, 7, 7, 63, 101, 7, 33, 69, 70,
101, 267, 93, 87, 7, 87, 0, 97, 38, 98,
98, 97, 97, 37, 91, 92, 93, 94, 213, 93,
94, 65, 97, 15, 97, 97, 70, 71, 72, 73,
74, 102, 76, 77, 78, 79, 98, 97, 82, 83,
97, 8, 9, 97, 11, 12, 13, 91, 97, 93,
97, 97, 97, 96, 98, 97, 97, 97, 97, 97,
0, 18, 3, 4, 32, 6, 210, 38, 48, 36,
27, 7, 24, 33, 62, 3, 4, 5, 6, 7,
146, 145, 10, 56, 99, 58, 101, 231, 13, 49,
48, 8, 9, 37, 11, 12, 13, 7, 13, 163,
99, 99, 101, 101, 15, 16, 34, 35, 49, 7,
99, 63, 101, 7, 99, 56, 101, 17, 18, 19,
20, 101, 22, 99, 268, 101, 93, 63, 69, 70,
101, 45, 46, 99, 7, 101, 7, 65, 7, 87,
33, 87, 70, 71, 72, 73, 74, 213, 76, 77,
78, 79, 7, 0, 82, 83, 98, 38, 97, 97,
97, 102, 97, 91, 97, 93, 91, 92, 93, 94,
98, 88, 89, 90, 91, 92, 93, 94, 93, 94,
98, 97, 99, 37, 97, 97, 15, 7, 97, 97,
97, 132, 133, 134, 135, 136, 97, 138, 139, 140,
141, 142, 143, 144, 96, 270, 147, 97, 7, 150,
275, 152, 98, 51, 7, 98, 7, 59, 7, 48,
98, 98, 7, 69, 69, 14, 13, 195, 7, 7,
7, 296, 98, 57, 54, 100, 7, 26, 178, 28,
29, 99, 31, 32, 33, 101, 101, 187, 88, 7,
39, 88, 89, 90, 91, 92, 93, 94, 47, 7,
7, 50, 99, 52, 23, 206, 55, 29, 25, 30,
7, 99, 7, 214, 39, 61, 103, 66, 67, 68,
7, 100, 26, 50, 225, 41, 75, 228, 229, 98,
60, 80, 81, 7, 43, 84, 85, 86, 3, 4,
5, 6, 7, 42, 3, 10, 98, 97, 248, 64,
44, 99, 7, 102, 7, 30, 8, 9, 7, 11,
12, 13, 23, 7, 97, 159, 230, 150, 32, 34,
35, 269, 8, 9, -1, 11, 12, 13, 217, -1,
263, 212, -1, -1, -1, -1, -1, 287, -1, 286,
-1, 291, 309, -1, 30, -1, -1, -1, -1, -1,
65, -1, -1, 7, 304, 70, 71, 72, 73, 74,
14, 76, 77, 78, 79, -1, -1, 82, 83, -1,
-1, 25, 26, -1, -1, -1, 91, 31, 32, 33,
-1, -1, -1, 98, -1, 39, 88, 89, 90, 91,
92, 93, 94, 47, -1, -1, 50, 99, 52, -1,
-1, 55, 88, 89, 90, 91, 92, 93, 94, -1,
7, -1, 66, 67, 68, -1, -1, 14, -1, -1,
-1, 75, -1, -1, -1, -1, 80, 81, 25, 26,
84, 85, 86, -1, 31, 32, 33, -1, -1, 11,
12, 13, 39, -1, -1, -1, -1, -1, 102, -1,
47, -1, -1, 50, -1, 52, -1, -1, 55, -1,
-1, -1, -1, -1, -1, -1, -1, 7, -1, 66,
67, 68, -1, -1, 14, -1, -1, -1, 75, -1,
-1, -1, -1, 80, 81, 25, 26, 84, 85, 86,
-1, 31, 32, 33, -1, -1, -1, -1, -1, 39,
-1, -1, -1, -1, -1, 102, -1, 47, -1, -1,
50, -1, 52, -1, -1, 55, 88, 89, 90, 91,
92, 93, 94, 7, -1, -1, 66, 67, 68, -1,
14, -1, -1, -1, -1, 75, -1, -1, -1, -1,
80, 81, 26, -1, 84, 85, 86, 31, 32, 33,
-1, -1, -1, -1, -1, 39, -1, 3, 4, 5,
6, 7, 102, 47, 10, -1, 50, -1, 52, -1,
-1, 55, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 66, 67, 68, -1, 3, 4, 5, 6,
7, 75, -1, 10, -1, -1, 80, 81, -1, -1,
84, 85, 86, -1, -1, -1, -1, 53, -1, -1,
8, 9, -1, 11, 12, 13, -1, -1, 102, 65,
-1, -1, -1, -1, 70, 71, 72, 73, 74, 27,
76, 77, 78, 79, -1, -1, 82, 83, 8, 9,
-1, 11, 12, 13, -1, 91, 8, 9, 65, 11,
12, 13, 98, 70, 71, 72, 73, 74, -1, 76,
77, 78, 79, -1, -1, 82, 83, -1, 8, 9,
40, 11, 12, 13, 91, 8, 9, -1, 11, 12,
13, 98, -1, -1, -1, -1, -1, 27, -1, -1,
88, 89, 90, 91, 92, 93, 94, 30, -1, -1,
141, 142, 143, 144, 96, 271, 147, 97, 97, 150,
276, 152, 97, 97, 97, 97, 51, 97, 7, 97,
97, 96, 98, 7, 98, 14, 98, 195, 7, 59,
48, 98, 98, 299, 7, 69, 69, 26, 178, 28,
29, 13, 31, 32, 33, 7, 7, 187, 7, 98,
39, 57, 100, 54, 7, 99, 101, 88, 47, 101,
7, 50, 7, 52, 7, 206, 55, 3, 4, 5,
6, 7, 23, 214, 10, 29, 25, 66, 67, 68,
30, 7, 99, 7, 225, 61, 75, 228, 229, 103,
100, 80, 81, 39, 7, 84, 85, 86, 34, 35,
41, 26, 50, 98, 60, 7, 43, 42, 3, 249,
10, 98, 97, 102, 44, 6, 99, 7, 7, 30,
8, 9, 64, 11, 12, 13, 7, 23, 7, 65,
97, 159, 264, 230, 70, 71, 72, 73, 74, 27,
76, 77, 78, 79, 212, 150, 82, 83, 288, 32,
270, 7, 292, 217, -1, 91, 313, 287, 14, -1,
-1, -1, 98, -1, -1, -1, -1, -1, 308, 25,
26, -1, -1, -1, -1, 31, 32, 33, -1, -1,
11, 12, 13, 39, -1, -1, -1, -1, -1, -1,
-1, 47, -1, -1, 50, -1, 52, -1, -1, 55,
88, 89, 90, 91, 92, 93, 94, -1, 7, -1,
66, 67, 68, -1, -1, 14, -1, -1, -1, 75,
-1, -1, -1, -1, 80, 81, 25, 26, 84, 85,
86, -1, 31, 32, 33, -1, -1, -1, -1, -1,
39, -1, -1, -1, -1, -1, 102, -1, 47, -1,
-1, 50, -1, 52, -1, -1, 55, 88, 89, 90,
91, 92, 93, 94, -1, 7, -1, 66, 67, 68,
-1, -1, 14, -1, -1, -1, 75, -1, -1, -1,
-1, 80, 81, 25, 26, 84, 85, 86, -1, 31,
32, 33, -1, -1, -1, -1, -1, 39, -1, -1,
-1, -1, -1, 102, -1, 47, -1, -1, 50, -1,
52, -1, -1, 55, -1, -1, -1, -1, -1, -1,
-1, 7, -1, -1, 66, 67, 68, -1, 14, -1,
-1, -1, -1, 75, -1, -1, -1, -1, 80, 81,
26, -1, 84, 85, 86, 31, 32, 33, -1, -1,
-1, -1, -1, 39, -1, 3, 4, 5, 6, 7,
102, 47, 10, -1, 50, -1, 52, -1, -1, 55,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
66, 67, 68, -1, 3, 4, 5, 6, 7, 75,
-1, 10, -1, -1, 80, 81, -1, -1, 84, 85,
86, -1, -1, 8, 9, 53, 11, 12, 13, -1,
-1, -1, -1, -1, -1, -1, 102, 65, -1, -1,
-1, -1, 70, 71, 72, 73, 74, -1, 76, 77,
78, 79, -1, -1, 82, 83, 8, 9, -1, 11,
12, 13, -1, 91, 8, 9, 65, 11, 12, 13,
98, 70, 71, 72, 73, 74, -1, 76, 77, 78,
79, -1, -1, 82, 83, -1, 30, -1, 40, -1,
-1, -1, 91, 8, 9, -1, 11, 12, 13, 98,
-1, -1, -1, 88, 89, 90, 91, 92, 93, 94,
-1, -1, 27, -1, 99, -1, -1, -1, -1, -1,
-1, 8, 9, -1, 11, 12, 13, -1, 8, 9,
-1, 11, 12, 13, -1, -1, 88, 89, 90, 91,
92, 93, 94, 30, 88, 89, 90, 91, 92, 93,
94, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 88, 89,
90, 91, 92, 93, 94, -1, 88, 89, 90, 91,
92, 93, 94, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, 88, 89,
90, 91, 92, 93, 94, 88, 89, 90, 91, 92,
93, 94
-1, -1, -1, 88, 89, 90, 91, 92, 93, 94,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 88, 89, 90, 91, 92, 93, 94, 88, 89,
90, 91, 92, 93, 94
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
......@@ -935,19 +942,19 @@ static const unsigned char yystos[] =
52, 55, 66, 67, 68, 75, 80, 81, 84, 85,
86, 102, 105, 110, 111, 112, 124, 125, 126, 130,
131, 132, 133, 134, 135, 136, 137, 141, 142, 143,
144, 145, 146, 147, 152, 156, 157, 158, 166, 62,
144, 145, 146, 147, 153, 157, 158, 159, 167, 62,
7, 3, 4, 5, 6, 7, 10, 65, 70, 71,
72, 73, 74, 76, 77, 78, 79, 82, 83, 91,
98, 107, 108, 107, 34, 35, 93, 107, 116, 117,
118, 7, 48, 7, 37, 56, 58, 154, 7, 7,
118, 7, 48, 7, 37, 56, 58, 155, 7, 7,
7, 124, 87, 87, 7, 0, 97, 98, 97, 49,
124, 97, 38, 119, 129, 97, 97, 119, 129, 97,
97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
97, 97, 97, 97, 97, 107, 98, 96, 107, 96,
107, 107, 8, 9, 11, 12, 13, 27, 88, 89,
90, 91, 92, 93, 94, 98, 30, 98, 98, 48,
101, 37, 15, 7, 51, 7, 7, 59, 155, 48,
98, 107, 115, 98, 53, 107, 7, 160, 161, 69,
101, 37, 15, 7, 51, 7, 7, 59, 156, 48,
98, 107, 115, 98, 53, 107, 7, 161, 162, 69,
69, 99, 107, 107, 107, 107, 107, 105, 106, 107,
107, 107, 107, 107, 107, 107, 115, 106, 107, 36,
93, 7, 114, 116, 7, 113, 107, 7, 127, 128,
......@@ -955,14 +962,15 @@ static const unsigned char yystos[] =
16, 99, 101, 28, 29, 105, 138, 139, 140, 99,
25, 99, 7, 99, 101, 38, 101, 119, 40, 88,
101, 7, 148, 149, 7, 99, 101, 107, 99, 7,
17, 18, 19, 22, 159, 159, 23, 160, 106, 107,
138, 25, 30, 99, 7, 7, 39, 120, 107, 107,
127, 159, 99, 101, 61, 103, 100, 7, 162, 163,
27, 26, 50, 41, 121, 30, 98, 150, 60, 151,
148, 7, 159, 63, 162, 164, 165, 106, 42, 43,
123, 106, 3, 98, 97, 64, 24, 164, 44, 25,
99, 7, 153, 7, 106, 7, 30, 99, 101, 23,
25, 45, 46, 122, 7, 124, 97
17, 18, 19, 20, 22, 160, 160, 23, 161, 106,
107, 138, 25, 30, 99, 7, 7, 39, 120, 107,
107, 127, 160, 99, 101, 61, 103, 100, 7, 163,
164, 27, 26, 50, 41, 121, 30, 98, 150, 60,
152, 148, 7, 160, 63, 163, 165, 166, 106, 42,
43, 123, 106, 3, 10, 151, 98, 97, 64, 24,
165, 44, 25, 99, 6, 7, 154, 7, 106, 7,
30, 99, 101, 23, 25, 45, 46, 122, 7, 124,
97
};
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
......@@ -2090,7 +2098,7 @@ yyparse ()
case 127:
#line 454 "pars0grm.y"
{ yyval = pars_column_def(yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
{ yyval = pars_column_def(yyvsp[-3], yyvsp[-2], yyvsp[-1], yyvsp[0]); ;}
break;
case 128:
......@@ -2114,125 +2122,141 @@ yyparse ()
break;
case 132:
#line 469 "pars0grm.y"
#line 470 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 133:
#line 471 "pars0grm.y"
#line 472 "pars0grm.y"
{ yyval = &pars_int_token;
/* pass any non-NULL pointer */ ;}
break;
case 134:
#line 478 "pars0grm.y"
{ yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ;}
#line 477 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 135:
#line 482 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
#line 479 "pars0grm.y"
{ yyval = &pars_int_token;
/* pass any non-NULL pointer */ ;}
break;
case 136:
#line 484 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
#line 486 "pars0grm.y"
{ yyval = pars_create_table(yyvsp[-4], yyvsp[-2], yyvsp[0]); ;}
break;
case 137:
#line 488 "pars0grm.y"
{ yyval = NULL; ;}
#line 490 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 138:
#line 489 "pars0grm.y"
{ yyval = &pars_unique_token; ;}
#line 492 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 139:
#line 493 "pars0grm.y"
#line 496 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 140:
#line 494 "pars0grm.y"
{ yyval = &pars_clustered_token; ;}
#line 497 "pars0grm.y"
{ yyval = &pars_unique_token; ;}
break;
case 141:
#line 501 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 142:
#line 502 "pars0grm.y"
{ yyval = &pars_clustered_token; ;}
break;
case 143:
#line 510 "pars0grm.y"
{ yyval = pars_create_index(yyvsp[-8], yyvsp[-7], yyvsp[-5], yyvsp[-3], yyvsp[-1]); ;}
break;
case 142:
#line 507 "pars0grm.y"
case 144:
#line 515 "pars0grm.y"
{ yyval = pars_commit_statement(); ;}
break;
case 143:
#line 512 "pars0grm.y"
case 145:
#line 520 "pars0grm.y"
{ yyval = pars_rollback_statement(); ;}
break;
case 144:
#line 516 "pars0grm.y"
case 146:
#line 524 "pars0grm.y"
{ yyval = &pars_int_token; ;}
break;
case 145:
#line 517 "pars0grm.y"
case 147:
#line 525 "pars0grm.y"
{ yyval = &pars_int_token; ;}
break;
case 148:
#line 526 "pars0grm.y"
{ yyval = &pars_char_token; ;}
break;
case 146:
#line 518 "pars0grm.y"
case 149:
#line 527 "pars0grm.y"
{ yyval = &pars_binary_token; ;}
break;
case 147:
#line 519 "pars0grm.y"
case 150:
#line 528 "pars0grm.y"
{ yyval = &pars_blob_token; ;}
break;
case 148:
#line 524 "pars0grm.y"
case 151:
#line 533 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_INPUT, yyvsp[0]); ;}
break;
case 149:
#line 527 "pars0grm.y"
case 152:
#line 536 "pars0grm.y"
{ yyval = pars_parameter_declaration(yyvsp[-2],
PARS_OUTPUT, yyvsp[0]); ;}
break;
case 150:
#line 532 "pars0grm.y"
case 153:
#line 541 "pars0grm.y"
{ yyval = NULL; ;}
break;
case 151:
#line 533 "pars0grm.y"
case 154:
#line 542 "pars0grm.y"
{ yyval = que_node_list_add_last(NULL, yyvsp[0]); ;}
break;
case 152:
#line 535 "pars0grm.y"
case 155:
#line 544 "pars0grm.y"
{ yyval = que_node_list_add_last(yyvsp[-2], yyvsp[0]); ;}
break;
case 153:
#line 540 "pars0grm.y"
case 156:
#line 549 "pars0grm.y"
{ yyval = pars_variable_declaration(yyvsp[-2], yyvsp[-1]); ;}
break;
case 157:
#line 552 "pars0grm.y"
case 160:
#line 561 "pars0grm.y"
{ yyval = pars_cursor_declaration(yyvsp[-3], yyvsp[-1]); ;}
break;
case 161:
#line 568 "pars0grm.y"
case 164:
#line 577 "pars0grm.y"
{ yyval = pars_procedure_definition(yyvsp[-9], yyvsp[-7],
yyvsp[-1]); ;}
break;
......@@ -2241,7 +2265,7 @@ yyparse ()
}
/* Line 1010 of yacc.c. */
#line 2245 "pars0grm.tab.c"
#line 2269 "pars0grm.tab.c"
yyvsp -= yylen;
yyssp -= yylen;
......@@ -2466,6 +2490,6 @@ yyparse ()
}
#line 572 "pars0grm.y"
#line 581 "pars0grm.y"
......@@ -450,8 +450,8 @@ fetch_statement:
;
column_def:
PARS_ID_TOKEN type_name opt_column_len
{ $$ = pars_column_def($1, $2, $3); }
PARS_ID_TOKEN type_name opt_column_len opt_not_null
{ $$ = pars_column_def($1, $2, $3, $4); }
;
column_def_list:
......@@ -464,6 +464,14 @@ opt_column_len:
/* Nothing */ { $$ = NULL; }
| '(' PARS_INT_LIT ')'
{ $$ = $2; }
;
opt_not_null:
/* Nothing */ { $$ = NULL; }
| PARS_NOT_TOKEN PARS_NULL_LIT
{ $$ = &pars_int_token;
/* pass any non-NULL pointer */ }
;
not_fit_in_memory:
/* Nothing */ { $$ = NULL; }
......@@ -514,6 +522,7 @@ rollback_statement:
type_name:
PARS_INT_TOKEN { $$ = &pars_int_token; }
| PARS_INTEGER_TOKEN { $$ = &pars_int_token; }
| PARS_CHAR_TOKEN { $$ = &pars_char_token; }
| PARS_BINARY_TOKEN { $$ = &pars_binary_token; }
| PARS_BLOB_TOKEN { $$ = &pars_blob_token; }
......
......@@ -1081,15 +1081,24 @@ void
pars_set_dfield_type(
/*=================*/
dfield_t* dfield, /* in: dfield */
pars_res_word_t* type, /* in: pointer to a type token */
ulint len) /* in: length, or 0 */
pars_res_word_t* type, /* in: pointer to a type
token */
ulint len, /* in: length, or 0 */
ibool is_not_null) /* in: if TRUE, column is
NOT NULL. */
{
ulint flags = 0;
if (is_not_null) {
flags |= DATA_NOT_NULL;
}
if (type == &pars_int_token) {
if (len != 0) {
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_INT, 0, 4, 0);
dtype_set(dfield_get_type(dfield), DATA_INT, flags, 4, 0);
} else if (type == &pars_char_token) {
if (len != 0) {
......@@ -1097,7 +1106,21 @@ pars_set_dfield_type(
}
dtype_set(dfield_get_type(dfield), DATA_VARCHAR,
DATA_ENGLISH, 0, 0);
DATA_ENGLISH | flags, 0, 0);
} else if (type == &pars_binary_token) {
if (len == 0) {
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_FIXBINARY,
DATA_BINARY_TYPE | flags, len, 0);
} else if (type == &pars_blob_token) {
if (len != 0) {
ut_error;
}
dtype_set(dfield_get_type(dfield), DATA_BLOB,
DATA_BINARY_TYPE | flags, 0, 0);
} else if (type == &pars_binary_token) {
if (len == 0) {
ut_error;
......@@ -1134,7 +1157,7 @@ pars_variable_declaration(
node->param_type = PARS_NOT_PARAM;
pars_set_dfield_type(que_node_get_val(node), type, 0);
pars_set_dfield_type(que_node_get_val(node), type, 0, FALSE);
return(node);
}
......@@ -1503,8 +1526,10 @@ pars_column_def(
sym_node_t* sym_node, /* in: column node in the
symbol table */
pars_res_word_t* type, /* in: data type */
sym_node_t* len) /* in: length of column, or
sym_node_t* len, /* in: length of column, or
NULL */
void* is_not_null) /* in: if not NULL, column
is of type NOT NULL. */
{
ulint len2;
......@@ -1514,7 +1539,8 @@ pars_column_def(
len2 = 0;
}
pars_set_dfield_type(que_node_get_val(sym_node), type, len2);
pars_set_dfield_type(que_node_get_val(sym_node), type, len2,
is_not_null != NULL);
return(sym_node);
}
......
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