提交 7be46585 编写于 作者: H hjxilinx

[tbase-1205] [tbase-955]

上级 a900d4a2
......@@ -26,7 +26,6 @@
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "tsql.h"
#include "tutil.h"
}
......@@ -113,7 +112,7 @@ cmd ::= DROP TABLE ifexists(Y) ids(X) cpxName(Z). {
}
cmd ::= DROP DATABASE ifexists(Y) ids(X). { setDCLSQLElems(pInfo, DROP_DATABASE, 2, &X, &Y); }
cmd ::= DROP DNODE IP(X). { setDCLSQLElems(pInfo, DROP_DNODE, 1, &X); }
cmd ::= DROP DNODE IPTOKEN(X). { setDCLSQLElems(pInfo, DROP_DNODE, 1, &X); }
cmd ::= DROP USER ids(X). { setDCLSQLElems(pInfo, DROP_USER, 1, &X); }
cmd ::= DROP ACCOUNT ids(X). { setDCLSQLElems(pInfo, DROP_ACCOUNT, 1, &X); }
......@@ -129,8 +128,8 @@ cmd ::= DESCRIBE ids(X) cpxName(Y). {
/////////////////////////////////THE ALTER STATEMENT////////////////////////////////////////
cmd ::= ALTER USER ids(X) PASS ids(Y). { setDCLSQLElems(pInfo, ALTER_USER_PASSWD, 2, &X, &Y); }
cmd ::= ALTER USER ids(X) PRIVILEGE ids(Y). { setDCLSQLElems(pInfo, ALTER_USER_PRIVILEGES, 2, &X, &Y);}
cmd ::= ALTER DNODE IP(X) ids(Y). { setDCLSQLElems(pInfo, ALTER_DNODE, 2, &X, &Y); }
cmd ::= ALTER DNODE IP(X) ids(Y) ids(Z). { setDCLSQLElems(pInfo, ALTER_DNODE, 3, &X, &Y, &Z); }
cmd ::= ALTER DNODE IPTOKEN(X) ids(Y). { setDCLSQLElems(pInfo, ALTER_DNODE, 2, &X, &Y); }
cmd ::= ALTER DNODE IPTOKEN(X) ids(Y) ids(Z). { setDCLSQLElems(pInfo, ALTER_DNODE, 3, &X, &Y, &Z); }
cmd ::= ALTER LOCAL ids(X). { setDCLSQLElems(pInfo, ALTER_LOCAL, 1, &X); }
cmd ::= ALTER LOCAL ids(X) ids(Y). { setDCLSQLElems(pInfo, ALTER_LOCAL, 2, &X, &Y); }
cmd ::= ALTER DATABASE ids(X) alter_db_optr(Y). { SSQLToken t = {0}; setCreateDBSQL(pInfo, ALTER_DATABASE, &X, &Y, &t);}
......@@ -642,12 +641,12 @@ cmd ::= ALTER TABLE ids(X) cpxName(F) SET TAG ids(Y) EQ tagitem(Z). {
}
////////////////////////////////////////kill statement///////////////////////////////////////
cmd ::= KILL CONNECTION IP(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); setDCLSQLElems(pInfo, KILL_CONNECTION, 1, &X);}
cmd ::= KILL STREAM IP(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X.n += (Z.n + Y.n + K.n + F.n); setDCLSQLElems(pInfo, KILL_STREAM, 1, &X);}
cmd ::= KILL QUERY IP(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X.n += (Z.n + Y.n + K.n + F.n); setDCLSQLElems(pInfo, KILL_QUERY, 1, &X);}
cmd ::= KILL CONNECTION IPTOKEN(X) COLON(Z) INTEGER(Y). {X.n += (Z.n + Y.n); setDCLSQLElems(pInfo, KILL_CONNECTION, 1, &X);}
cmd ::= KILL STREAM IPTOKEN(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X.n += (Z.n + Y.n + K.n + F.n); setDCLSQLElems(pInfo, KILL_STREAM, 1, &X);}
cmd ::= KILL QUERY IPTOKEN(X) COLON(Z) INTEGER(Y) COLON(K) INTEGER(F). {X.n += (Z.n + Y.n + K.n + F.n); setDCLSQLElems(pInfo, KILL_QUERY, 1, &X);}
%fallback ID ABORT AFTER ASC ATTACH BEFORE BEGIN CASCADE CLUSTER CONFLICT COPY DATABASE DEFERRED
DELIMITERS DESC DETACH EACH END EXPLAIN FAIL FOR GLOB IGNORE IMMEDIATE INITIALLY INSTEAD
LIKE MATCH KEY OF OFFSET RAISE REPLACE RESTRICT ROW STATEMENT TRIGGER VIEW ALL
COUNT SUM AVG MIN MAX FIRST LAST TOP BOTTOM STDDEV PERCENTILE APERCENTILE LEASTSQUARES HISTOGRAM DIFF
SPREAD TWA INTERP LAST_ROW NOW IP SEMI NONE PREV LINEAR IMPORT METRIC TBNAME JOIN METRICS STABLE.
\ No newline at end of file
SPREAD TWA INTERP LAST_ROW NOW IPTOKEN SEMI NONE PREV LINEAR IMPORT METRIC TBNAME JOIN METRICS STABLE NULL.
\ No newline at end of file
......@@ -31,6 +31,7 @@ extern "C" {
#define TK_OCT 204 // oct number
#define TK_BIN 205 // bin format data 0b111
#define TK_FILE 206
#define TK_QUESTION 207 // denoting the placeholder of "?",when invoking statement bind query
#define TSQL_SO_ASC 1
#define TSQL_SO_DESC 0
......
......@@ -80,7 +80,7 @@
#define TK_TABLE 62
#define TK_DATABASE 63
#define TK_DNODE 64
#define TK_IP 65
#define TK_IPTOKEN 65
#define TK_USER 66
#define TK_ACCOUNT 67
#define TK_USE 68
......@@ -210,7 +210,6 @@
#define TK_JOIN 192
#define TK_METRICS 193
#define TK_STABLE 194
#define TK_QUESTION 195
#endif
......
......@@ -30,7 +30,6 @@
#include <string.h>
#include <assert.h>
#include <stdbool.h>
#include "tsql.h"
#include "tutil.h"
/**************** End of %include directives **********************************/
......@@ -79,13 +78,15 @@
** defined, then do no error processing.
** YYNSTATE the combined number of states.
** YYNRULE the number of rules in the grammar
** YYNTOKEN Number of terminal symbols
** YY_MAX_SHIFT Maximum value for shift actions
** YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
** YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
** YY_MIN_REDUCE Maximum value for reduce actions
** YY_ERROR_ACTION The yy_action[] code for syntax error
** YY_ACCEPT_ACTION The yy_action[] code for accept
** YY_NO_ACTION The yy_action[] code for no-op
** YY_MIN_REDUCE Minimum value for reduce actions
** YY_MAX_REDUCE Maximum value for reduce actions
*/
#ifndef INTERFACE
# define INTERFACE 1
......@@ -123,20 +124,17 @@ typedef union {
#define YYFALLBACK 1
#define YYNSTATE 251
#define YYNRULE 213
#define YYNTOKEN 195
#define YY_MAX_SHIFT 250
#define YY_MIN_SHIFTREDUCE 401
#define YY_MAX_SHIFTREDUCE 613
#define YY_MIN_REDUCE 614
#define YY_MAX_REDUCE 826
#define YY_ERROR_ACTION 827
#define YY_ACCEPT_ACTION 828
#define YY_NO_ACTION 829
#define YY_ERROR_ACTION 614
#define YY_ACCEPT_ACTION 615
#define YY_NO_ACTION 616
#define YY_MIN_REDUCE 617
#define YY_MAX_REDUCE 829
/************* End control #defines *******************************************/
/* The yyzerominor constant is used to initialize instances of
** YYMINORTYPE objects to zero. */
static const YYMINORTYPE yyzerominor = { 0 };
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
......@@ -164,9 +162,6 @@ static const YYMINORTYPE yyzerominor = { 0 };
** N between YY_MIN_SHIFTREDUCE Shift to an arbitrary state then
** and YY_MAX_SHIFTREDUCE reduce by rule N-YY_MIN_SHIFTREDUCE.
**
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE
** N == YY_ERROR_ACTION A syntax error has occurred.
**
** N == YY_ACCEPT_ACTION The parser accepts its input.
......@@ -174,21 +169,22 @@ static const YYMINORTYPE yyzerominor = { 0 };
** N == YY_NO_ACTION No such action. Denotes unused
** slots in the yy_action[] table.
**
** N between YY_MIN_REDUCE Reduce by rule N-YY_MIN_REDUCE
** and YY_MAX_REDUCE
**
** The action table is constructed as a single large table named yy_action[].
** Given state S and lookahead X, the action is computed as
** Given state S and lookahead X, the action is computed as either:
**
** yy_action[ yy_shift_ofst[S] + X ]
** (A) N = yy_action[ yy_shift_ofst[S] + X ]
** (B) N = yy_default[S]
**
** If the index value yy_shift_ofst[S]+X is out of range or if the value
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X or if yy_shift_ofst[S]
** is equal to YY_SHIFT_USE_DFLT, it means that the action is not in the table
** and that yy_default[S] should be used instead.
** The (A) formula is preferred. The B formula is used instead if
** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
**
** The formula above is for computing the action when the lookahead is
** The formulas above are for computing the action when the lookahead is
** a terminal symbol. If the lookahead is a non-terminal (as occurs after
** a reduce action) then the yy_reduce_ofst[] array is used in place of
** the yy_shift_ofst[] array and YY_REDUCE_USE_DFLT is used in place of
** YY_SHIFT_USE_DFLT.
** the yy_shift_ofst[] array.
**
** The following are the tables generated in this section:
**
......@@ -202,196 +198,214 @@ static const YYMINORTYPE yyzerominor = { 0 };
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (529)
#define YY_ACTTAB_COUNT (530)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 439, 36, 35, 153, 249, 34, 33, 32, 440, 34,
/* 10 */ 33, 32, 43, 45, 49, 37, 38, 74, 78, 244,
/* 20 */ 31, 85, 77, 205, 41, 39, 42, 40, 80, 133,
/* 30 */ 101, 50, 36, 35, 527, 171, 34, 33, 32, 43,
/* 40 */ 45, 154, 37, 38, 114, 115, 224, 31, 65, 68,
/* 50 */ 205, 41, 39, 42, 40, 76, 133, 828, 250, 36,
/* 60 */ 35, 241, 241, 34, 33, 32, 43, 45, 155, 37,
/* 70 */ 38, 128, 126, 245, 31, 89, 88, 205, 41, 39,
/* 80 */ 42, 40, 202, 524, 59, 135, 36, 35, 439, 21,
/* 90 */ 34, 33, 32, 520, 159, 596, 440, 10, 57, 172,
/* 100 */ 135, 135, 227, 226, 101, 45, 439, 37, 38, 158,
/* 110 */ 596, 595, 31, 156, 440, 205, 41, 39, 42, 40,
/* 120 */ 232, 167, 564, 507, 36, 35, 166, 21, 34, 33,
/* 130 */ 32, 510, 402, 403, 404, 405, 406, 407, 408, 409,
/* 140 */ 410, 411, 412, 413, 510, 37, 38, 243, 132, 508,
/* 150 */ 31, 220, 101, 205, 41, 39, 42, 40, 551, 168,
/* 160 */ 200, 507, 36, 35, 97, 134, 34, 33, 32, 510,
/* 170 */ 21, 139, 101, 17, 219, 242, 218, 217, 216, 215,
/* 180 */ 214, 213, 212, 211, 492, 21, 481, 482, 483, 484,
/* 190 */ 485, 486, 487, 488, 489, 490, 491, 163, 577, 11,
/* 200 */ 243, 568, 228, 571, 507, 574, 550, 163, 577, 498,
/* 210 */ 21, 568, 509, 571, 193, 574, 148, 233, 7, 507,
/* 220 */ 561, 62, 111, 87, 86, 142, 60, 178, 242, 160,
/* 230 */ 161, 147, 437, 204, 186, 124, 183, 230, 229, 160,
/* 240 */ 161, 163, 577, 525, 506, 568, 570, 571, 573, 574,
/* 250 */ 41, 39, 42, 40, 495, 61, 494, 27, 36, 35,
/* 260 */ 545, 546, 34, 33, 32, 514, 28, 600, 511, 162,
/* 270 */ 512, 29, 513, 160, 161, 192, 446, 566, 188, 124,
/* 280 */ 248, 247, 422, 438, 522, 150, 124, 18, 601, 536,
/* 290 */ 537, 44, 29, 47, 15, 594, 169, 170, 578, 14,
/* 300 */ 576, 44, 14, 569, 518, 572, 519, 2, 52, 516,
/* 310 */ 576, 517, 504, 567, 503, 575, 47, 592, 22, 591,
/* 320 */ 209, 73, 72, 53, 22, 575, 9, 8, 84, 83,
/* 330 */ 590, 151, 152, 140, 501, 44, 610, 141, 560, 143,
/* 340 */ 144, 145, 146, 137, 576, 131, 138, 136, 164, 557,
/* 350 */ 556, 165, 526, 231, 110, 98, 112, 113, 448, 575,
/* 360 */ 543, 542, 210, 129, 515, 25, 223, 225, 609, 70,
/* 370 */ 189, 608, 606, 116, 466, 26, 23, 130, 435, 79,
/* 380 */ 433, 81, 431, 191, 430, 173, 125, 428, 427, 426,
/* 390 */ 424, 91, 532, 194, 198, 54, 417, 127, 51, 521,
/* 400 */ 421, 203, 419, 46, 102, 95, 201, 530, 103, 531,
/* 410 */ 544, 195, 199, 197, 30, 27, 222, 235, 75, 234,
/* 420 */ 236, 207, 238, 55, 237, 239, 240, 246, 149, 613,
/* 430 */ 63, 66, 174, 429, 175, 176, 90, 92, 177, 423,
/* 440 */ 119, 612, 118, 467, 117, 120, 121, 179, 122, 123,
/* 450 */ 1, 505, 108, 104, 105, 106, 107, 109, 24, 180,
/* 460 */ 181, 182, 611, 184, 185, 604, 12, 13, 187, 190,
/* 470 */ 96, 533, 99, 157, 58, 538, 196, 100, 19, 4,
/* 480 */ 579, 3, 16, 20, 64, 5, 206, 6, 208, 479,
/* 490 */ 478, 477, 476, 475, 474, 473, 472, 470, 47, 221,
/* 500 */ 443, 67, 445, 22, 500, 48, 499, 497, 464, 56,
/* 510 */ 462, 454, 69, 460, 456, 71, 458, 452, 450, 471,
/* 520 */ 469, 82, 441, 425, 415, 93, 614, 616, 94,
/* 0 */ 97, 439, 135, 101, 101, 156, 615, 250, 135, 440,
/* 10 */ 135, 159, 812, 43, 45, 21, 37, 38, 811, 158,
/* 20 */ 812, 31, 439, 726, 205, 41, 39, 42, 40, 10,
/* 30 */ 440, 153, 249, 36, 35, 743, 725, 34, 33, 32,
/* 40 */ 43, 45, 736, 37, 38, 166, 132, 167, 31, 723,
/* 50 */ 193, 205, 41, 39, 42, 40, 202, 767, 59, 200,
/* 60 */ 36, 35, 21, 726, 34, 33, 32, 43, 45, 134,
/* 70 */ 37, 38, 74, 78, 244, 31, 85, 77, 205, 41,
/* 80 */ 39, 42, 40, 80, 740, 220, 498, 36, 35, 439,
/* 90 */ 21, 34, 33, 32, 168, 101, 723, 440, 101, 57,
/* 100 */ 114, 115, 224, 726, 65, 68, 45, 7, 37, 38,
/* 110 */ 62, 111, 241, 31, 230, 229, 205, 41, 39, 42,
/* 120 */ 40, 232, 228, 564, 723, 36, 35, 21, 139, 34,
/* 130 */ 33, 32, 21, 402, 403, 404, 405, 406, 407, 408,
/* 140 */ 409, 410, 411, 412, 413, 808, 37, 38, 243, 766,
/* 150 */ 724, 31, 60, 178, 205, 41, 39, 42, 40, 233,
/* 160 */ 186, 723, 183, 36, 35, 807, 722, 34, 33, 32,
/* 170 */ 653, 171, 806, 124, 17, 219, 242, 218, 217, 216,
/* 180 */ 215, 214, 213, 212, 211, 708, 151, 697, 698, 699,
/* 190 */ 700, 701, 702, 703, 704, 705, 706, 707, 163, 577,
/* 200 */ 11, 133, 568, 133, 571, 76, 574, 662, 163, 577,
/* 210 */ 124, 241, 568, 154, 571, 155, 574, 148, 34, 33,
/* 220 */ 32, 248, 247, 422, 87, 86, 142, 243, 545, 546,
/* 230 */ 160, 161, 147, 522, 204, 172, 18, 152, 227, 226,
/* 240 */ 160, 161, 163, 577, 525, 711, 568, 710, 571, 140,
/* 250 */ 574, 41, 39, 42, 40, 242, 141, 61, 27, 36,
/* 260 */ 35, 73, 72, 34, 33, 32, 514, 654, 28, 511,
/* 270 */ 124, 512, 143, 513, 160, 161, 192, 36, 35, 188,
/* 280 */ 600, 34, 33, 32, 29, 570, 150, 573, 566, 128,
/* 290 */ 126, 245, 44, 89, 88, 601, 536, 169, 170, 29,
/* 300 */ 47, 576, 44, 162, 537, 594, 578, 144, 15, 14,
/* 310 */ 14, 576, 569, 49, 572, 504, 575, 52, 503, 47,
/* 320 */ 145, 209, 22, 146, 567, 22, 575, 518, 826, 519,
/* 330 */ 50, 516, 53, 517, 84, 83, 44, 9, 8, 717,
/* 340 */ 137, 2, 131, 138, 136, 576, 777, 742, 776, 164,
/* 350 */ 773, 772, 165, 231, 98, 759, 758, 112, 113, 664,
/* 360 */ 575, 110, 189, 210, 129, 515, 25, 223, 91, 225,
/* 370 */ 825, 70, 824, 822, 116, 682, 26, 23, 130, 651,
/* 380 */ 532, 79, 649, 54, 81, 647, 646, 173, 125, 644,
/* 390 */ 643, 642, 640, 633, 127, 637, 191, 635, 737, 194,
/* 400 */ 198, 95, 746, 747, 760, 51, 102, 46, 203, 103,
/* 410 */ 201, 199, 197, 195, 30, 27, 222, 75, 234, 235,
/* 420 */ 207, 55, 236, 240, 238, 237, 239, 63, 66, 149,
/* 430 */ 246, 613, 175, 174, 176, 645, 612, 90, 639, 119,
/* 440 */ 123, 177, 683, 117, 118, 120, 106, 104, 721, 122,
/* 450 */ 92, 121, 108, 105, 107, 109, 1, 24, 180, 179,
/* 460 */ 181, 182, 611, 184, 185, 604, 58, 12, 13, 99,
/* 470 */ 190, 187, 96, 533, 157, 538, 196, 100, 19, 64,
/* 480 */ 479, 579, 3, 20, 4, 16, 206, 6, 208, 478,
/* 490 */ 477, 476, 475, 5, 474, 473, 472, 470, 47, 443,
/* 500 */ 67, 445, 22, 221, 500, 48, 499, 497, 56, 464,
/* 510 */ 462, 454, 460, 69, 456, 71, 458, 452, 450, 471,
/* 520 */ 469, 82, 441, 425, 93, 415, 617, 616, 616, 94,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 1, 33, 34, 198, 199, 37, 38, 39, 9, 37,
/* 10 */ 38, 39, 13, 14, 100, 16, 17, 62, 63, 64,
/* 20 */ 21, 66, 67, 24, 25, 26, 27, 28, 73, 247,
/* 30 */ 199, 117, 33, 34, 199, 61, 37, 38, 39, 13,
/* 40 */ 14, 259, 16, 17, 62, 63, 64, 21, 66, 67,
/* 50 */ 24, 25, 26, 27, 28, 71, 247, 196, 197, 33,
/* 60 */ 34, 77, 77, 37, 38, 39, 13, 14, 259, 16,
/* 70 */ 17, 62, 63, 64, 21, 66, 67, 24, 25, 26,
/* 80 */ 27, 28, 251, 248, 253, 247, 33, 34, 1, 199,
/* 90 */ 37, 38, 39, 232, 256, 257, 9, 247, 99, 125,
/* 100 */ 247, 247, 128, 129, 199, 14, 1, 16, 17, 256,
/* 110 */ 257, 257, 21, 216, 9, 24, 25, 26, 27, 28,
/* 120 */ 199, 231, 96, 233, 33, 34, 216, 199, 37, 38,
/* 130 */ 39, 234, 45, 46, 47, 48, 49, 50, 51, 52,
/* 140 */ 53, 54, 55, 56, 234, 16, 17, 58, 247, 228,
/* 150 */ 21, 216, 199, 24, 25, 26, 27, 28, 253, 231,
/* 160 */ 255, 233, 33, 34, 199, 247, 37, 38, 39, 234,
/* 170 */ 199, 247, 199, 84, 85, 86, 87, 88, 89, 90,
/* 180 */ 91, 92, 93, 94, 215, 199, 217, 218, 219, 220,
/* 190 */ 221, 222, 223, 224, 225, 226, 227, 1, 2, 44,
/* 200 */ 58, 5, 231, 7, 233, 9, 253, 1, 2, 5,
/* 210 */ 199, 5, 234, 7, 249, 9, 61, 231, 95, 233,
/* 220 */ 229, 98, 99, 68, 69, 70, 253, 124, 86, 33,
/* 230 */ 34, 76, 203, 37, 131, 206, 133, 33, 34, 33,
/* 240 */ 34, 1, 2, 37, 233, 5, 5, 7, 7, 9,
/* 250 */ 25, 26, 27, 28, 217, 235, 219, 102, 33, 34,
/* 260 */ 110, 111, 37, 38, 39, 2, 246, 96, 5, 57,
/* 270 */ 7, 100, 9, 33, 34, 120, 203, 1, 123, 206,
/* 280 */ 58, 59, 60, 203, 100, 130, 206, 103, 96, 96,
/* 290 */ 96, 95, 100, 100, 100, 96, 33, 34, 96, 100,
/* 300 */ 104, 95, 100, 5, 5, 7, 7, 95, 100, 5,
/* 310 */ 104, 7, 96, 37, 96, 119, 100, 247, 100, 247,
/* 320 */ 96, 126, 127, 115, 100, 119, 126, 127, 71, 72,
/* 330 */ 247, 247, 247, 247, 230, 95, 234, 247, 229, 247,
/* 340 */ 247, 247, 247, 247, 104, 247, 247, 247, 229, 229,
/* 350 */ 229, 229, 199, 229, 236, 199, 199, 199, 199, 119,
/* 360 */ 254, 254, 199, 199, 101, 199, 199, 199, 199, 199,
/* 370 */ 122, 199, 199, 199, 199, 199, 199, 199, 199, 199,
/* 380 */ 199, 199, 199, 258, 199, 199, 199, 199, 199, 199,
/* 390 */ 199, 57, 104, 250, 250, 114, 199, 199, 116, 245,
/* 400 */ 199, 108, 199, 113, 244, 200, 112, 200, 243, 200,
/* 410 */ 200, 105, 107, 106, 118, 102, 74, 49, 83, 82,
/* 420 */ 79, 200, 53, 200, 81, 80, 78, 74, 200, 5,
/* 430 */ 204, 204, 132, 200, 5, 132, 201, 201, 65, 200,
/* 440 */ 208, 5, 212, 214, 213, 211, 209, 132, 210, 207,
/* 450 */ 205, 232, 238, 242, 241, 240, 239, 237, 202, 5,
/* 460 */ 132, 65, 5, 132, 65, 85, 95, 95, 124, 122,
/* 470 */ 121, 96, 95, 1, 100, 96, 95, 95, 100, 109,
/* 480 */ 96, 95, 95, 100, 71, 109, 97, 95, 97, 9,
/* 490 */ 5, 5, 5, 5, 1, 5, 5, 5, 100, 15,
/* 500 */ 75, 71, 65, 100, 5, 16, 5, 96, 5, 95,
/* 510 */ 5, 5, 127, 5, 5, 127, 5, 5, 5, 5,
/* 520 */ 5, 65, 75, 65, 57, 21, 0, 260, 21,
/* 0 */ 199, 1, 247, 199, 199, 216, 196, 197, 247, 9,
/* 10 */ 247, 256, 257, 13, 14, 199, 16, 17, 257, 256,
/* 20 */ 257, 21, 1, 234, 24, 25, 26, 27, 28, 247,
/* 30 */ 9, 198, 199, 33, 34, 199, 234, 37, 38, 39,
/* 40 */ 13, 14, 232, 16, 17, 216, 247, 231, 21, 233,
/* 50 */ 249, 24, 25, 26, 27, 28, 251, 253, 253, 255,
/* 60 */ 33, 34, 199, 234, 37, 38, 39, 13, 14, 247,
/* 70 */ 16, 17, 62, 63, 64, 21, 66, 67, 24, 25,
/* 80 */ 26, 27, 28, 73, 248, 216, 5, 33, 34, 1,
/* 90 */ 199, 37, 38, 39, 231, 199, 233, 9, 199, 99,
/* 100 */ 62, 63, 64, 234, 66, 67, 14, 95, 16, 17,
/* 110 */ 98, 99, 77, 21, 33, 34, 24, 25, 26, 27,
/* 120 */ 28, 199, 231, 96, 233, 33, 34, 199, 247, 37,
/* 130 */ 38, 39, 199, 45, 46, 47, 48, 49, 50, 51,
/* 140 */ 52, 53, 54, 55, 56, 247, 16, 17, 58, 253,
/* 150 */ 228, 21, 253, 124, 24, 25, 26, 27, 28, 231,
/* 160 */ 131, 233, 133, 33, 34, 247, 233, 37, 38, 39,
/* 170 */ 203, 61, 247, 206, 84, 85, 86, 87, 88, 89,
/* 180 */ 90, 91, 92, 93, 94, 215, 247, 217, 218, 219,
/* 190 */ 220, 221, 222, 223, 224, 225, 226, 227, 1, 2,
/* 200 */ 44, 247, 5, 247, 7, 71, 9, 203, 1, 2,
/* 210 */ 206, 77, 5, 259, 7, 259, 9, 61, 37, 38,
/* 220 */ 39, 58, 59, 60, 68, 69, 70, 58, 110, 111,
/* 230 */ 33, 34, 76, 100, 37, 125, 103, 247, 128, 129,
/* 240 */ 33, 34, 1, 2, 37, 217, 5, 219, 7, 247,
/* 250 */ 9, 25, 26, 27, 28, 86, 247, 235, 102, 33,
/* 260 */ 34, 126, 127, 37, 38, 39, 2, 203, 246, 5,
/* 270 */ 206, 7, 247, 9, 33, 34, 120, 33, 34, 123,
/* 280 */ 96, 37, 38, 39, 100, 5, 130, 7, 1, 62,
/* 290 */ 63, 64, 95, 66, 67, 96, 96, 33, 34, 100,
/* 300 */ 100, 104, 95, 57, 96, 96, 96, 247, 100, 100,
/* 310 */ 100, 104, 5, 100, 7, 96, 119, 100, 96, 100,
/* 320 */ 247, 96, 100, 247, 37, 100, 119, 5, 234, 7,
/* 330 */ 117, 5, 115, 7, 71, 72, 95, 126, 127, 230,
/* 340 */ 247, 95, 247, 247, 247, 104, 229, 199, 229, 229,
/* 350 */ 229, 229, 229, 229, 199, 254, 254, 199, 199, 199,
/* 360 */ 119, 236, 122, 199, 199, 101, 199, 199, 57, 199,
/* 370 */ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
/* 380 */ 104, 199, 199, 114, 199, 199, 199, 199, 199, 199,
/* 390 */ 199, 199, 199, 199, 199, 199, 258, 199, 245, 250,
/* 400 */ 250, 200, 200, 200, 200, 116, 244, 113, 108, 243,
/* 410 */ 112, 107, 106, 105, 118, 102, 74, 83, 82, 49,
/* 420 */ 200, 200, 79, 78, 53, 81, 80, 204, 204, 200,
/* 430 */ 74, 5, 5, 132, 132, 200, 5, 201, 200, 208,
/* 440 */ 207, 65, 214, 213, 212, 211, 240, 242, 232, 210,
/* 450 */ 201, 209, 238, 241, 239, 237, 205, 202, 5, 132,
/* 460 */ 132, 65, 5, 132, 65, 85, 100, 95, 95, 95,
/* 470 */ 122, 124, 121, 96, 1, 96, 95, 95, 100, 71,
/* 480 */ 9, 96, 95, 100, 109, 95, 97, 95, 97, 5,
/* 490 */ 5, 5, 5, 109, 1, 5, 5, 5, 100, 75,
/* 500 */ 71, 65, 100, 15, 5, 16, 5, 96, 95, 5,
/* 510 */ 5, 5, 5, 127, 5, 127, 5, 5, 5, 5,
/* 520 */ 5, 65, 75, 65, 21, 57, 0, 260, 260, 21,
/* 530 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 540 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 550 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 560 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 570 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 580 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 590 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 600 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 610 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 620 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 630 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 640 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 650 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 660 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 670 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 680 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 690 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 700 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 710 */ 260, 260, 260, 260, 260, 260, 260, 260, 260, 260,
/* 720 */ 260, 260, 260, 260, 260,
};
#define YY_SHIFT_USE_DFLT (-87)
#define YY_SHIFT_COUNT (250)
#define YY_SHIFT_MIN (-86)
#define YY_SHIFT_MAX (526)
static const short yy_shift_ofst[] = {
/* 0 */ 155, 89, 196, 240, 105, 105, 105, 105, 105, 105,
/* 10 */ -1, 87, 240, 240, 240, 263, 263, 263, 105, 105,
/* 20 */ 105, 105, 105, -16, 142, -15, -15, -87, 206, 240,
/* 30 */ 240, 240, 240, 240, 240, 240, 240, 240, 240, 240,
/* 40 */ 240, 240, 240, 240, 240, 240, 240, 263, 263, 204,
/* 50 */ 204, 204, 204, 204, 204, 123, 204, 105, 105, 150,
/* 60 */ 150, 184, 105, 105, 105, 105, 105, 105, 105, 105,
/* 70 */ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
/* 80 */ 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
/* 90 */ 105, 105, 105, 105, 105, 248, 334, 334, 334, 288,
/* 100 */ 288, 334, 281, 282, 290, 293, 294, 305, 307, 306,
/* 110 */ 296, 313, 334, 334, 342, 342, 334, 335, 337, 368,
/* 120 */ 341, 343, 369, 345, 348, 334, 353, 334, 353, -87,
/* 130 */ -87, 26, 53, 53, 53, 53, 53, 91, 129, 225,
/* 140 */ 225, 225, -45, -32, -32, -32, -32, -18, 9, -26,
/* 150 */ 103, -28, -28, 222, 171, 192, 193, 194, 199, 202,
/* 160 */ 241, 298, 276, 212, -86, 208, 216, 218, 224, 299,
/* 170 */ 304, 195, 200, 257, 424, 300, 429, 303, 373, 436,
/* 180 */ 315, 454, 328, 396, 457, 331, 399, 380, 344, 371,
/* 190 */ 372, 347, 349, 374, 375, 377, 472, 381, 379, 382,
/* 200 */ 378, 370, 383, 376, 384, 386, 387, 389, 392, 391,
/* 210 */ 413, 480, 485, 486, 487, 488, 493, 490, 491, 492,
/* 220 */ 398, 425, 484, 430, 437, 489, 385, 388, 403, 499,
/* 230 */ 501, 411, 414, 403, 503, 505, 506, 508, 509, 511,
/* 240 */ 512, 513, 514, 515, 456, 458, 447, 504, 507, 467,
#define YY_SHIFT_COUNT (250)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (526)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 156, 90, 197, 241, 21, 21, 21, 21, 21, 21,
/* 10 */ 0, 88, 241, 241, 241, 264, 264, 264, 21, 21,
/* 20 */ 21, 21, 21, 134, 169, 35, 35, 530, 207, 241,
/* 30 */ 241, 241, 241, 241, 241, 241, 241, 241, 241, 241,
/* 40 */ 241, 241, 241, 241, 241, 241, 241, 264, 264, 81,
/* 50 */ 81, 81, 81, 81, 81, 12, 81, 21, 21, 118,
/* 60 */ 118, 133, 21, 21, 21, 21, 21, 21, 21, 21,
/* 70 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 80 */ 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
/* 90 */ 21, 21, 21, 21, 21, 240, 311, 311, 311, 276,
/* 100 */ 276, 311, 269, 289, 294, 300, 298, 304, 306, 308,
/* 110 */ 296, 313, 311, 311, 342, 342, 311, 334, 336, 370,
/* 120 */ 343, 344, 371, 346, 345, 311, 356, 311, 356, 530,
/* 130 */ 530, 27, 54, 54, 54, 54, 54, 92, 130, 226,
/* 140 */ 226, 226, 10, 244, 244, 244, 244, 38, 227, 110,
/* 150 */ 29, 181, 181, 163, 184, 199, 200, 208, 209, 210,
/* 160 */ 280, 307, 287, 246, 213, 217, 219, 222, 225, 322,
/* 170 */ 326, 135, 211, 263, 426, 301, 427, 302, 376, 431,
/* 180 */ 327, 453, 328, 396, 457, 331, 399, 380, 347, 372,
/* 190 */ 373, 348, 351, 366, 377, 374, 473, 381, 379, 382,
/* 200 */ 378, 375, 383, 384, 385, 387, 390, 389, 392, 391,
/* 210 */ 408, 471, 484, 485, 486, 487, 493, 490, 491, 492,
/* 220 */ 398, 424, 488, 429, 436, 489, 386, 388, 402, 499,
/* 230 */ 501, 411, 413, 402, 504, 505, 506, 507, 509, 511,
/* 240 */ 512, 513, 514, 515, 456, 458, 447, 503, 508, 468,
/* 250 */ 526,
};
#define YY_REDUCE_USE_DFLT (-219)
#define YY_REDUCE_COUNT (130)
#define YY_REDUCE_MIN (-218)
#define YY_REDUCE_MAX (256)
#define YY_REDUCE_MIN (-245)
#define YY_REDUCE_MAX (255)
static const short yy_reduce_ofst[] = {
/* 0 */ -139, -31, -162, -147, -95, -169, -110, -72, -29, -14,
/* 10 */ -165, -195, -218, -191, -146, -103, -90, -65, -35, -47,
/* 20 */ -27, -79, 11, 29, 37, 73, 80, 20, -150, -99,
/* 30 */ -82, -76, 70, 72, 83, 84, 85, 86, 90, 92,
/* 40 */ 93, 94, 95, 96, 98, 99, 100, -22, 102, -9,
/* 50 */ 109, 119, 120, 121, 122, 104, 124, 153, 156, 106,
/* 60 */ 107, 118, 157, 158, 159, 163, 164, 166, 167, 168,
/* 70 */ 169, 170, 172, 173, 174, 175, 176, 177, 178, 179,
/* 80 */ 180, 181, 182, 183, 185, 186, 187, 188, 189, 190,
/* 90 */ 191, 197, 198, 201, 203, 125, 205, 207, 209, 143,
/* 100 */ 144, 210, 154, 160, 165, 211, 213, 215, 217, 214,
/* 110 */ 220, 219, 221, 223, 226, 227, 228, 229, 231, 230,
/* 120 */ 232, 234, 237, 238, 242, 233, 235, 239, 236, 245,
/* 130 */ 256,
/* 0 */ -190, -30, -245, -237, -196, -195, -184, -137, -109, -72,
/* 10 */ -164, -167, -46, -44, -239, -211, -171, -131, -199, -104,
/* 20 */ -101, -78, -67, -33, 28, 4, 64, 22, -218, -201,
/* 30 */ -178, -119, -102, -82, -75, -61, -10, 2, 9, 25,
/* 40 */ 60, 73, 76, 93, 95, 96, 97, -198, 94, 117,
/* 50 */ 119, 120, 121, 122, 123, 109, 124, 148, 155, 101,
/* 60 */ 102, 125, 158, 159, 160, 164, 165, 167, 168, 170,
/* 70 */ 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
/* 80 */ 182, 183, 185, 186, 187, 188, 189, 190, 191, 192,
/* 90 */ 193, 194, 195, 196, 198, 138, 201, 202, 203, 149,
/* 100 */ 150, 204, 153, 162, 166, 205, 212, 206, 215, 214,
/* 110 */ 218, 216, 220, 221, 223, 224, 229, 228, 230, 232,
/* 120 */ 231, 234, 242, 239, 233, 235, 236, 238, 249, 251,
/* 130 */ 255,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 827, 660, 811, 811, 827, 827, 827, 827, 827, 827,
/* 10 */ 741, 627, 827, 827, 811, 827, 827, 827, 827, 827,
/* 20 */ 827, 827, 827, 662, 649, 662, 662, 736, 827, 827,
/* 30 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 40 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 50 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 760,
/* 60 */ 760, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 70 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 647,
/* 80 */ 827, 645, 827, 827, 827, 827, 827, 827, 827, 827,
/* 90 */ 827, 827, 827, 827, 827, 827, 629, 629, 629, 827,
/* 100 */ 827, 629, 767, 771, 765, 753, 761, 752, 748, 747,
/* 110 */ 775, 827, 629, 629, 657, 657, 629, 678, 676, 674,
/* 120 */ 666, 672, 668, 670, 664, 629, 655, 629, 655, 693,
/* 130 */ 706, 827, 815, 816, 776, 810, 766, 794, 793, 806,
/* 140 */ 800, 799, 827, 798, 797, 796, 795, 827, 827, 827,
/* 150 */ 827, 802, 801, 827, 827, 827, 827, 827, 827, 827,
/* 160 */ 827, 827, 827, 778, 772, 768, 827, 827, 827, 827,
/* 170 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 180 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 190 */ 827, 812, 827, 742, 827, 827, 827, 827, 827, 827,
/* 200 */ 762, 827, 754, 827, 827, 827, 827, 827, 827, 715,
/* 210 */ 827, 827, 827, 827, 827, 827, 827, 827, 827, 827,
/* 220 */ 681, 827, 827, 827, 827, 827, 827, 827, 820, 827,
/* 230 */ 827, 827, 709, 818, 827, 827, 827, 827, 827, 827,
/* 240 */ 827, 827, 827, 827, 827, 827, 827, 633, 631, 827,
/* 250 */ 827,
/* 0 */ 614, 663, 814, 814, 614, 614, 614, 614, 614, 614,
/* 10 */ 744, 630, 614, 614, 814, 614, 614, 614, 614, 614,
/* 20 */ 614, 614, 614, 665, 652, 665, 665, 739, 614, 614,
/* 30 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 40 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 50 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 763,
/* 60 */ 763, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 70 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 650,
/* 80 */ 614, 648, 614, 614, 614, 614, 614, 614, 614, 614,
/* 90 */ 614, 614, 614, 614, 614, 614, 632, 632, 632, 614,
/* 100 */ 614, 632, 770, 774, 768, 756, 764, 755, 751, 750,
/* 110 */ 778, 614, 632, 632, 660, 660, 632, 681, 679, 677,
/* 120 */ 669, 675, 671, 673, 667, 632, 658, 632, 658, 696,
/* 130 */ 709, 614, 818, 819, 779, 813, 769, 797, 796, 809,
/* 140 */ 803, 802, 614, 801, 800, 799, 798, 614, 614, 614,
/* 150 */ 614, 805, 804, 614, 614, 614, 614, 614, 614, 614,
/* 160 */ 614, 614, 614, 781, 775, 771, 614, 614, 614, 614,
/* 170 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 180 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 190 */ 614, 815, 614, 745, 614, 614, 614, 614, 614, 614,
/* 200 */ 765, 614, 757, 614, 614, 614, 614, 614, 614, 718,
/* 210 */ 614, 614, 614, 614, 614, 614, 614, 614, 614, 614,
/* 220 */ 684, 614, 614, 614, 614, 614, 614, 614, 823, 614,
/* 230 */ 614, 614, 712, 821, 614, 614, 614, 614, 614, 614,
/* 240 */ 614, 614, 614, 614, 614, 614, 614, 636, 634, 614,
/* 250 */ 614,
};
/********** End of lemon-generated parsing tables *****************************/
......@@ -476,7 +490,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* TABLE => nothing */
1, /* DATABASE => ID */
0, /* DNODE => nothing */
1, /* IP => ID */
1, /* IPTOKEN => ID */
0, /* USER => nothing */
0, /* ACCOUNT => nothing */
0, /* USE => nothing */
......@@ -512,7 +526,7 @@ static const YYCODETYPE yyFallback[] = {
0, /* USING => nothing */
0, /* AS => nothing */
0, /* COMMA => nothing */
0, /* NULL => nothing */
1, /* NULL => ID */
0, /* SELECT => nothing */
0, /* FROM => nothing */
0, /* VARIABLE => nothing */
......@@ -637,17 +651,21 @@ typedef struct yyStackEntry yyStackEntry;
/* The state of the parser is completely contained in an instance of
** the following structure */
struct yyParser {
int yyidx; /* Index of top element in stack */
yyStackEntry *yytos; /* Pointer to top element of the stack */
#ifdef YYTRACKMAXSTACKDEPTH
int yyidxMax; /* Maximum value of yyidx */
int yyhwm; /* High-water mark of the stack */
#endif
#ifndef YYNOERRORRECOVERY
int yyerrcnt; /* Shifts left before out of the error */
#endif
ParseARG_SDECL /* A place to hold %extra_argument */
#if YYSTACKDEPTH<=0
int yystksz; /* Current side of the stack */
yyStackEntry *yystack; /* The parser's stack */
yyStackEntry yystk0; /* First stack entry */
#else
yyStackEntry yystack[YYSTACKDEPTH]; /* The parser's stack */
yyStackEntry *yystackEnd; /* Last entry in the stack */
#endif
};
typedef struct yyParser yyParser;
......@@ -684,77 +702,272 @@ void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
}
#endif /* NDEBUG */
#ifndef NDEBUG
#if defined(YYCOVERAGE) || !defined(NDEBUG)
/* For tracing shifts, the names of all terminals and nonterminals
** are required. The following table supplies these names */
static const char *const yyTokenName[] = {
"$", "ID", "BOOL", "TINYINT",
"SMALLINT", "INTEGER", "BIGINT", "FLOAT",
"DOUBLE", "STRING", "TIMESTAMP", "BINARY",
"NCHAR", "OR", "AND", "NOT",
"EQ", "NE", "ISNULL", "NOTNULL",
"IS", "LIKE", "GLOB", "BETWEEN",
"IN", "GT", "GE", "LT",
"LE", "BITAND", "BITOR", "LSHIFT",
"RSHIFT", "PLUS", "MINUS", "DIVIDE",
"TIMES", "STAR", "SLASH", "REM",
"CONCAT", "UMINUS", "UPLUS", "BITNOT",
"SHOW", "DATABASES", "MNODES", "DNODES",
"ACCOUNTS", "USERS", "MODULES", "QUERIES",
"CONNECTIONS", "STREAMS", "CONFIGS", "SCORES",
"GRANTS", "DOT", "TABLES", "STABLES",
"VGROUPS", "DROP", "TABLE", "DATABASE",
"DNODE", "IP", "USER", "ACCOUNT",
"USE", "DESCRIBE", "ALTER", "PASS",
"PRIVILEGE", "LOCAL", "IF", "EXISTS",
"CREATE", "PPS", "TSERIES", "DBS",
"STORAGE", "QTIME", "CONNS", "STATE",
"KEEP", "CACHE", "REPLICA", "DAYS",
"ROWS", "ABLOCKS", "TBLOCKS", "CTIME",
"CLOG", "COMP", "PRECISION", "LP",
"RP", "TAGS", "USING", "AS",
"COMMA", "NULL", "SELECT", "FROM",
"VARIABLE", "INTERVAL", "FILL", "SLIDING",
"ORDER", "BY", "ASC", "DESC",
"GROUP", "HAVING", "LIMIT", "OFFSET",
"SLIMIT", "SOFFSET", "WHERE", "NOW",
"INSERT", "INTO", "VALUES", "RESET",
"QUERY", "ADD", "COLUMN", "TAG",
"CHANGE", "SET", "KILL", "CONNECTION",
"COLON", "STREAM", "ABORT", "AFTER",
"ATTACH", "BEFORE", "BEGIN", "CASCADE",
"CLUSTER", "CONFLICT", "COPY", "DEFERRED",
"DELIMITERS", "DETACH", "EACH", "END",
"EXPLAIN", "FAIL", "FOR", "IGNORE",
"IMMEDIATE", "INITIALLY", "INSTEAD", "MATCH",
"KEY", "OF", "RAISE", "REPLACE",
"RESTRICT", "ROW", "STATEMENT", "TRIGGER",
"VIEW", "ALL", "COUNT", "SUM",
"AVG", "MIN", "MAX", "FIRST",
"LAST", "TOP", "BOTTOM", "STDDEV",
"PERCENTILE", "APERCENTILE", "LEASTSQUARES", "HISTOGRAM",
"DIFF", "SPREAD", "TWA", "INTERP",
"LAST_ROW", "SEMI", "NONE", "PREV",
"LINEAR", "IMPORT", "METRIC", "TBNAME",
"JOIN", "METRICS", "STABLE", "error",
"program", "cmd", "dbPrefix", "ids",
"cpxName", "ifexists", "alter_db_optr", "acct_optr",
"ifnotexists", "db_optr", "pps", "tseries",
"dbs", "streams", "storage", "qtime",
"users", "conns", "state", "keep",
"tagitemlist", "tables", "cache", "replica",
"days", "rows", "ablocks", "tblocks",
"ctime", "clog", "comp", "prec",
"typename", "signed", "create_table_args", "columnlist",
"select", "column", "tagitem", "selcollist",
"from", "where_opt", "interval_opt", "fill_opt",
"sliding_opt", "groupby_opt", "orderby_opt", "having_opt",
"slimit_opt", "limit_opt", "sclp", "expr",
"as", "tablelist", "tmvar", "sortlist",
"sortitem", "item", "sortorder", "grouplist",
"exprlist", "expritem", "insert_value_list", "itemlist",
/* 0 */ "$",
/* 1 */ "ID",
/* 2 */ "BOOL",
/* 3 */ "TINYINT",
/* 4 */ "SMALLINT",
/* 5 */ "INTEGER",
/* 6 */ "BIGINT",
/* 7 */ "FLOAT",
/* 8 */ "DOUBLE",
/* 9 */ "STRING",
/* 10 */ "TIMESTAMP",
/* 11 */ "BINARY",
/* 12 */ "NCHAR",
/* 13 */ "OR",
/* 14 */ "AND",
/* 15 */ "NOT",
/* 16 */ "EQ",
/* 17 */ "NE",
/* 18 */ "ISNULL",
/* 19 */ "NOTNULL",
/* 20 */ "IS",
/* 21 */ "LIKE",
/* 22 */ "GLOB",
/* 23 */ "BETWEEN",
/* 24 */ "IN",
/* 25 */ "GT",
/* 26 */ "GE",
/* 27 */ "LT",
/* 28 */ "LE",
/* 29 */ "BITAND",
/* 30 */ "BITOR",
/* 31 */ "LSHIFT",
/* 32 */ "RSHIFT",
/* 33 */ "PLUS",
/* 34 */ "MINUS",
/* 35 */ "DIVIDE",
/* 36 */ "TIMES",
/* 37 */ "STAR",
/* 38 */ "SLASH",
/* 39 */ "REM",
/* 40 */ "CONCAT",
/* 41 */ "UMINUS",
/* 42 */ "UPLUS",
/* 43 */ "BITNOT",
/* 44 */ "SHOW",
/* 45 */ "DATABASES",
/* 46 */ "MNODES",
/* 47 */ "DNODES",
/* 48 */ "ACCOUNTS",
/* 49 */ "USERS",
/* 50 */ "MODULES",
/* 51 */ "QUERIES",
/* 52 */ "CONNECTIONS",
/* 53 */ "STREAMS",
/* 54 */ "CONFIGS",
/* 55 */ "SCORES",
/* 56 */ "GRANTS",
/* 57 */ "DOT",
/* 58 */ "TABLES",
/* 59 */ "STABLES",
/* 60 */ "VGROUPS",
/* 61 */ "DROP",
/* 62 */ "TABLE",
/* 63 */ "DATABASE",
/* 64 */ "DNODE",
/* 65 */ "IPTOKEN",
/* 66 */ "USER",
/* 67 */ "ACCOUNT",
/* 68 */ "USE",
/* 69 */ "DESCRIBE",
/* 70 */ "ALTER",
/* 71 */ "PASS",
/* 72 */ "PRIVILEGE",
/* 73 */ "LOCAL",
/* 74 */ "IF",
/* 75 */ "EXISTS",
/* 76 */ "CREATE",
/* 77 */ "PPS",
/* 78 */ "TSERIES",
/* 79 */ "DBS",
/* 80 */ "STORAGE",
/* 81 */ "QTIME",
/* 82 */ "CONNS",
/* 83 */ "STATE",
/* 84 */ "KEEP",
/* 85 */ "CACHE",
/* 86 */ "REPLICA",
/* 87 */ "DAYS",
/* 88 */ "ROWS",
/* 89 */ "ABLOCKS",
/* 90 */ "TBLOCKS",
/* 91 */ "CTIME",
/* 92 */ "CLOG",
/* 93 */ "COMP",
/* 94 */ "PRECISION",
/* 95 */ "LP",
/* 96 */ "RP",
/* 97 */ "TAGS",
/* 98 */ "USING",
/* 99 */ "AS",
/* 100 */ "COMMA",
/* 101 */ "NULL",
/* 102 */ "SELECT",
/* 103 */ "FROM",
/* 104 */ "VARIABLE",
/* 105 */ "INTERVAL",
/* 106 */ "FILL",
/* 107 */ "SLIDING",
/* 108 */ "ORDER",
/* 109 */ "BY",
/* 110 */ "ASC",
/* 111 */ "DESC",
/* 112 */ "GROUP",
/* 113 */ "HAVING",
/* 114 */ "LIMIT",
/* 115 */ "OFFSET",
/* 116 */ "SLIMIT",
/* 117 */ "SOFFSET",
/* 118 */ "WHERE",
/* 119 */ "NOW",
/* 120 */ "INSERT",
/* 121 */ "INTO",
/* 122 */ "VALUES",
/* 123 */ "RESET",
/* 124 */ "QUERY",
/* 125 */ "ADD",
/* 126 */ "COLUMN",
/* 127 */ "TAG",
/* 128 */ "CHANGE",
/* 129 */ "SET",
/* 130 */ "KILL",
/* 131 */ "CONNECTION",
/* 132 */ "COLON",
/* 133 */ "STREAM",
/* 134 */ "ABORT",
/* 135 */ "AFTER",
/* 136 */ "ATTACH",
/* 137 */ "BEFORE",
/* 138 */ "BEGIN",
/* 139 */ "CASCADE",
/* 140 */ "CLUSTER",
/* 141 */ "CONFLICT",
/* 142 */ "COPY",
/* 143 */ "DEFERRED",
/* 144 */ "DELIMITERS",
/* 145 */ "DETACH",
/* 146 */ "EACH",
/* 147 */ "END",
/* 148 */ "EXPLAIN",
/* 149 */ "FAIL",
/* 150 */ "FOR",
/* 151 */ "IGNORE",
/* 152 */ "IMMEDIATE",
/* 153 */ "INITIALLY",
/* 154 */ "INSTEAD",
/* 155 */ "MATCH",
/* 156 */ "KEY",
/* 157 */ "OF",
/* 158 */ "RAISE",
/* 159 */ "REPLACE",
/* 160 */ "RESTRICT",
/* 161 */ "ROW",
/* 162 */ "STATEMENT",
/* 163 */ "TRIGGER",
/* 164 */ "VIEW",
/* 165 */ "ALL",
/* 166 */ "COUNT",
/* 167 */ "SUM",
/* 168 */ "AVG",
/* 169 */ "MIN",
/* 170 */ "MAX",
/* 171 */ "FIRST",
/* 172 */ "LAST",
/* 173 */ "TOP",
/* 174 */ "BOTTOM",
/* 175 */ "STDDEV",
/* 176 */ "PERCENTILE",
/* 177 */ "APERCENTILE",
/* 178 */ "LEASTSQUARES",
/* 179 */ "HISTOGRAM",
/* 180 */ "DIFF",
/* 181 */ "SPREAD",
/* 182 */ "TWA",
/* 183 */ "INTERP",
/* 184 */ "LAST_ROW",
/* 185 */ "SEMI",
/* 186 */ "NONE",
/* 187 */ "PREV",
/* 188 */ "LINEAR",
/* 189 */ "IMPORT",
/* 190 */ "METRIC",
/* 191 */ "TBNAME",
/* 192 */ "JOIN",
/* 193 */ "METRICS",
/* 194 */ "STABLE",
/* 195 */ "error",
/* 196 */ "program",
/* 197 */ "cmd",
/* 198 */ "dbPrefix",
/* 199 */ "ids",
/* 200 */ "cpxName",
/* 201 */ "ifexists",
/* 202 */ "alter_db_optr",
/* 203 */ "acct_optr",
/* 204 */ "ifnotexists",
/* 205 */ "db_optr",
/* 206 */ "pps",
/* 207 */ "tseries",
/* 208 */ "dbs",
/* 209 */ "streams",
/* 210 */ "storage",
/* 211 */ "qtime",
/* 212 */ "users",
/* 213 */ "conns",
/* 214 */ "state",
/* 215 */ "keep",
/* 216 */ "tagitemlist",
/* 217 */ "tables",
/* 218 */ "cache",
/* 219 */ "replica",
/* 220 */ "days",
/* 221 */ "rows",
/* 222 */ "ablocks",
/* 223 */ "tblocks",
/* 224 */ "ctime",
/* 225 */ "clog",
/* 226 */ "comp",
/* 227 */ "prec",
/* 228 */ "typename",
/* 229 */ "signed",
/* 230 */ "create_table_args",
/* 231 */ "columnlist",
/* 232 */ "select",
/* 233 */ "column",
/* 234 */ "tagitem",
/* 235 */ "selcollist",
/* 236 */ "from",
/* 237 */ "where_opt",
/* 238 */ "interval_opt",
/* 239 */ "fill_opt",
/* 240 */ "sliding_opt",
/* 241 */ "groupby_opt",
/* 242 */ "orderby_opt",
/* 243 */ "having_opt",
/* 244 */ "slimit_opt",
/* 245 */ "limit_opt",
/* 246 */ "sclp",
/* 247 */ "expr",
/* 248 */ "as",
/* 249 */ "tablelist",
/* 250 */ "tmvar",
/* 251 */ "sortlist",
/* 252 */ "sortitem",
/* 253 */ "item",
/* 254 */ "sortorder",
/* 255 */ "grouplist",
/* 256 */ "exprlist",
/* 257 */ "expritem",
/* 258 */ "insert_value_list",
/* 259 */ "itemlist",
};
#endif /* NDEBUG */
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
#ifndef NDEBUG
/* For tracing reduce actions, the names of all rules are required.
......@@ -784,15 +997,15 @@ static const char *const yyRuleName[] = {
/* 21 */ "cmd ::= SHOW dbPrefix VGROUPS",
/* 22 */ "cmd ::= DROP TABLE ifexists ids cpxName",
/* 23 */ "cmd ::= DROP DATABASE ifexists ids",
/* 24 */ "cmd ::= DROP DNODE IP",
/* 24 */ "cmd ::= DROP DNODE IPTOKEN",
/* 25 */ "cmd ::= DROP USER ids",
/* 26 */ "cmd ::= DROP ACCOUNT ids",
/* 27 */ "cmd ::= USE ids",
/* 28 */ "cmd ::= DESCRIBE ids cpxName",
/* 29 */ "cmd ::= ALTER USER ids PASS ids",
/* 30 */ "cmd ::= ALTER USER ids PRIVILEGE ids",
/* 31 */ "cmd ::= ALTER DNODE IP ids",
/* 32 */ "cmd ::= ALTER DNODE IP ids ids",
/* 31 */ "cmd ::= ALTER DNODE IPTOKEN ids",
/* 32 */ "cmd ::= ALTER DNODE IPTOKEN ids ids",
/* 33 */ "cmd ::= ALTER LOCAL ids",
/* 34 */ "cmd ::= ALTER LOCAL ids ids",
/* 35 */ "cmd ::= ALTER DATABASE ids alter_db_optr",
......@@ -804,7 +1017,7 @@ static const char *const yyRuleName[] = {
/* 41 */ "ifexists ::=",
/* 42 */ "ifnotexists ::= IF NOT EXISTS",
/* 43 */ "ifnotexists ::=",
/* 44 */ "cmd ::= CREATE DNODE IP",
/* 44 */ "cmd ::= CREATE DNODE IPTOKEN",
/* 45 */ "cmd ::= CREATE ACCOUNT ids PASS ids acct_optr",
/* 46 */ "cmd ::= CREATE DATABASE ifnotexists ids db_optr",
/* 47 */ "cmd ::= CREATE USER ids PASS ids",
......@@ -970,33 +1183,43 @@ static const char *const yyRuleName[] = {
/* 207 */ "cmd ::= ALTER TABLE ids cpxName DROP TAG ids",
/* 208 */ "cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids",
/* 209 */ "cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem",
/* 210 */ "cmd ::= KILL CONNECTION IP COLON INTEGER",
/* 211 */ "cmd ::= KILL STREAM IP COLON INTEGER COLON INTEGER",
/* 212 */ "cmd ::= KILL QUERY IP COLON INTEGER COLON INTEGER",
/* 210 */ "cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER",
/* 211 */ "cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER",
/* 212 */ "cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER",
};
#endif /* NDEBUG */
#if YYSTACKDEPTH<=0
/*
** Try to increase the size of the parser stack.
** Try to increase the size of the parser stack. Return the number
** of errors. Return 0 on success.
*/
static void yyGrowStack(yyParser *p){
static int yyGrowStack(yyParser *p){
int newSize;
int idx;
yyStackEntry *pNew;
newSize = p->yystksz*2 + 100;
pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
if( p->yystack==&p->yystk0 ){
pNew = malloc(newSize*sizeof(pNew[0]));
if( pNew ) pNew[0] = p->yystk0;
}else{
pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
}
if( pNew ){
p->yystack = pNew;
p->yystksz = newSize;
p->yytos = &p->yystack[idx];
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack grows to %d entries!\n",
yyTracePrompt, p->yystksz);
fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
yyTracePrompt, p->yystksz, newSize);
}
#endif
p->yystksz = newSize;
}
return pNew==0;
}
#endif
......@@ -1009,6 +1232,34 @@ static void yyGrowStack(yyParser *p){
# define YYMALLOCARGTYPE size_t
#endif
/* Initialize a new parser that has already been allocated.
*/
void ParseInit(void *yypParser){
yyParser *pParser = (yyParser*)yypParser;
#ifdef YYTRACKMAXSTACKDEPTH
pParser->yyhwm = 0;
#endif
#if YYSTACKDEPTH<=0
pParser->yytos = NULL;
pParser->yystack = NULL;
pParser->yystksz = 0;
if( yyGrowStack(pParser) ){
pParser->yystack = &pParser->yystk0;
pParser->yystksz = 1;
}
#endif
#ifndef YYNOERRORRECOVERY
pParser->yyerrcnt = -1;
#endif
pParser->yytos = pParser->yystack;
pParser->yystack[0].stateno = 0;
pParser->yystack[0].major = 0;
#if YYSTACKDEPTH>0
pParser->yystackEnd = &pParser->yystack[YYSTACKDEPTH-1];
#endif
}
#ifndef Parse_ENGINEALWAYSONSTACK
/*
** This function allocates a new parser.
** The only argument is a pointer to a function which works like
......@@ -1024,19 +1275,11 @@ static void yyGrowStack(yyParser *p){
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE)){
yyParser *pParser;
pParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
if( pParser ){
pParser->yyidx = -1;
#ifdef YYTRACKMAXSTACKDEPTH
pParser->yyidxMax = 0;
#endif
#if YYSTACKDEPTH<=0
pParser->yystack = NULL;
pParser->yystksz = 0;
yyGrowStack(pParser);
#endif
}
if( pParser ) ParseInit(pParser);
return pParser;
}
#endif /* Parse_ENGINEALWAYSONSTACK */
/* The following function deletes the "minor type" or semantic value
** associated with a symbol. The symbol can be either a terminal
......@@ -1118,8 +1361,9 @@ tVariantDestroy(&(yypminor->yy186));
*/
static void yy_pop_parser_stack(yyParser *pParser){
yyStackEntry *yytos;
assert( pParser->yyidx>=0 );
yytos = &pParser->yystack[pParser->yyidx--];
assert( pParser->yytos!=0 );
assert( pParser->yytos > pParser->yystack );
yytos = pParser->yytos--;
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sPopping %s\n",
......@@ -1130,6 +1374,18 @@ static void yy_pop_parser_stack(yyParser *pParser){
yy_destructor(pParser, yytos->major, &yytos->minor);
}
/*
** Clear all secondary memory allocations from the parser
*/
void ParseFinalize(void *p){
yyParser *pParser = (yyParser*)p;
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
#endif
}
#ifndef Parse_ENGINEALWAYSONSTACK
/*
** Deallocate and destroy a parser. Destructors are called for
** all stack elements before shutting the parser down.
......@@ -1142,16 +1398,13 @@ void ParseFree(
void *p, /* The parser to be deleted */
void (*freeProc)(void*) /* Function used to reclaim memory */
){
yyParser *pParser = (yyParser*)p;
#ifndef YYPARSEFREENEVERNULL
if( pParser==0 ) return;
#endif
while( pParser->yyidx>=0 ) yy_pop_parser_stack(pParser);
#if YYSTACKDEPTH<=0
free(pParser->yystack);
if( p==0 ) return;
#endif
(*freeProc)((void*)pParser);
ParseFinalize(p);
(*freeProc)(p);
}
#endif /* Parse_ENGINEALWAYSONSTACK */
/*
** Return the peak depth of the stack for a parser.
......@@ -1159,7 +1412,44 @@ void ParseFree(
#ifdef YYTRACKMAXSTACKDEPTH
int ParseStackPeak(void *p){
yyParser *pParser = (yyParser*)p;
return pParser->yyidxMax;
return pParser->yyhwm;
}
#endif
/* This array of booleans keeps track of the parser statement
** coverage. The element yycoverage[X][Y] is set when the parser
** is in state X and has a lookahead token Y. In a well-tested
** systems, every element of this matrix should end up being set.
*/
#if defined(YYCOVERAGE)
static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
#endif
/*
** Write into out a description of every state/lookahead combination that
**
** (1) has not been used by the parser, and
** (2) is not a syntax error.
**
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
int ParseCoverage(FILE *out){
int stateno, iLookAhead, i;
int nMissed = 0;
for(stateno=0; stateno<YYNSTATE; stateno++){
i = yy_shift_ofst[stateno];
for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
if( out ){
fprintf(out,"State %d lookahead %s %s\n", stateno,
yyTokenName[iLookAhead],
yycoverage[stateno][iLookAhead] ? "ok" : "missed");
}
}
}
return nMissed;
}
#endif
......@@ -1167,61 +1457,63 @@ int ParseStackPeak(void *p){
** Find the appropriate action for a parser given the terminal
** look-ahead token iLookAhead.
*/
static int yy_find_shift_action(
static unsigned int yy_find_shift_action(
yyParser *pParser, /* The parser */
YYCODETYPE iLookAhead /* The look-ahead token */
){
int i;
int stateno = pParser->yystack[pParser->yyidx].stateno;
int stateno = pParser->yytos->stateno;
if( stateno>=YY_MIN_REDUCE ) return stateno;
if( stateno>YY_MAX_SHIFT ) return stateno;
assert( stateno <= YY_SHIFT_COUNT );
#if defined(YYCOVERAGE)
yycoverage[stateno][iLookAhead] = 1;
#endif
do{
i = yy_shift_ofst[stateno];
if( i==YY_SHIFT_USE_DFLT ) return yy_default[stateno];
assert( i>=0 && i+YYNTOKEN<=sizeof(yy_lookahead)/sizeof(yy_lookahead[0]) );
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
if( iLookAhead>0 ){
if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
&& (iFallback = yyFallback[iLookAhead])!=0 ){
YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])
&& (iFallback = yyFallback[iLookAhead])!=0 ){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
}
#endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
}
#endif
assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
if(
{
int j = i - iLookAhead + YYWILDCARD;
if(
#if YY_SHIFT_MIN+YYWILDCARD<0
j>=0 &&
j>=0 &&
#endif
#if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT
j<YY_ACTTAB_COUNT &&
j<YY_ACTTAB_COUNT &&
#endif
yy_lookahead[j]==YYWILDCARD
){
yy_lookahead[j]==YYWILDCARD && iLookAhead>0
){
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead],
yyTokenName[YYWILDCARD]);
}
#endif /* NDEBUG */
return yy_action[j];
if( yyTraceFILE ){
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
yyTracePrompt, yyTokenName[iLookAhead],
yyTokenName[YYWILDCARD]);
}
#endif /* NDEBUG */
return yy_action[j];
}
#endif /* YYWILDCARD */
}
#endif /* YYWILDCARD */
return yy_default[stateno];
}else{
return yy_action[i];
......@@ -1246,7 +1538,6 @@ static int yy_find_reduce_action(
assert( stateno<=YY_REDUCE_COUNT );
#endif
i = yy_reduce_ofst[stateno];
assert( i!=YY_REDUCE_USE_DFLT );
assert( iLookAhead!=YYNOCODE );
i += iLookAhead;
#ifdef YYERRORSYMBOL
......@@ -1263,15 +1554,14 @@ static int yy_find_reduce_action(
/*
** The following routine is called if the stack overflows.
*/
static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
static void yyStackOverflow(yyParser *yypParser){
ParseARG_FETCH;
yypParser->yyidx--;
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
}
#endif
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will execute if the parser
** stack every overflows */
/******** Begin %stack_overflow code ******************************************/
......@@ -1283,20 +1573,21 @@ static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){
** Print tracing information for a SHIFT action
*/
#ifndef NDEBUG
static void yyTraceShift(yyParser *yypParser, int yyNewState){
static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
if( yyTraceFILE ){
if( yyNewState<YYNSTATE ){
fprintf(yyTraceFILE,"%sShift '%s', go to state %d\n",
yyTracePrompt,yyTokenName[yypParser->yystack[yypParser->yyidx].major],
fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState);
}else{
fprintf(yyTraceFILE,"%sShift '%s'\n",
yyTracePrompt,yyTokenName[yypParser->yystack[yypParser->yyidx].major]);
fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
yyNewState - YY_MIN_REDUCE);
}
}
}
#else
# define yyTraceShift(X,Y)
# define yyTraceShift(X,Y,Z)
#endif
/*
......@@ -1306,256 +1597,261 @@ static void yy_shift(
yyParser *yypParser, /* The parser to be shifted */
int yyNewState, /* The new state to shift in */
int yyMajor, /* The major token to shift in */
YYMINORTYPE *yypMinor /* Pointer to the minor token to shift in */
ParseTOKENTYPE yyMinor /* The minor token to shift in */
){
yyStackEntry *yytos;
yypParser->yyidx++;
yypParser->yytos++;
#ifdef YYTRACKMAXSTACKDEPTH
if( yypParser->yyidx>yypParser->yyidxMax ){
yypParser->yyidxMax = yypParser->yyidx;
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
}
#endif
#if YYSTACKDEPTH>0
if( yypParser->yyidx>=YYSTACKDEPTH ){
yyStackOverflow(yypParser, yypMinor);
if( yypParser->yytos>yypParser->yystackEnd ){
yypParser->yytos--;
yyStackOverflow(yypParser);
return;
}
#else
if( yypParser->yyidx>=yypParser->yystksz ){
yyGrowStack(yypParser);
if( yypParser->yyidx>=yypParser->yystksz ){
yyStackOverflow(yypParser, yypMinor);
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
if( yyGrowStack(yypParser) ){
yypParser->yytos--;
yyStackOverflow(yypParser);
return;
}
}
#endif
yytos = &yypParser->yystack[yypParser->yyidx];
if( yyNewState > YY_MAX_SHIFT ){
yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
}
yytos = yypParser->yytos;
yytos->stateno = (YYACTIONTYPE)yyNewState;
yytos->major = (YYCODETYPE)yyMajor;
yytos->minor = *yypMinor;
yyTraceShift(yypParser, yyNewState);
yytos->minor.yy0 = yyMinor;
yyTraceShift(yypParser, yyNewState, "Shift");
}
/* The following table contains information about every rule that
** is used during the reduce.
*/
static const struct {
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
unsigned char nrhs; /* Number of right-hand side symbols in the rule */
YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
signed char nrhs; /* Negative of the number of RHS symbols in the rule */
} yyRuleInfo[] = {
{ 196, 1 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 197, 2 },
{ 198, 0 },
{ 198, 2 },
{ 200, 0 },
{ 200, 2 },
{ 197, 3 },
{ 197, 5 },
{ 197, 3 },
{ 197, 5 },
{ 197, 3 },
{ 197, 5 },
{ 197, 4 },
{ 197, 3 },
{ 197, 3 },
{ 197, 3 },
{ 197, 2 },
{ 197, 3 },
{ 197, 5 },
{ 197, 5 },
{ 197, 4 },
{ 197, 5 },
{ 197, 3 },
{ 197, 4 },
{ 197, 4 },
{ 197, 4 },
{ 197, 6 },
{ 199, 1 },
{ 199, 1 },
{ 201, 2 },
{ 201, 0 },
{ 204, 3 },
{ 204, 0 },
{ 197, 3 },
{ 197, 6 },
{ 197, 5 },
{ 197, 5 },
{ 206, 0 },
{ 206, 2 },
{ 207, 0 },
{ 207, 2 },
{ 208, 0 },
{ 208, 2 },
{ 209, 0 },
{ 209, 2 },
{ 210, 0 },
{ 210, 2 },
{ 211, 0 },
{ 211, 2 },
{ 212, 0 },
{ 212, 2 },
{ 213, 0 },
{ 213, 2 },
{ 214, 0 },
{ 214, 2 },
{ 203, 9 },
{ 215, 2 },
{ 217, 2 },
{ 218, 2 },
{ 219, 2 },
{ 220, 2 },
{ 221, 2 },
{ 222, 2 },
{ 223, 2 },
{ 224, 2 },
{ 225, 2 },
{ 226, 2 },
{ 227, 2 },
{ 205, 0 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 205, 2 },
{ 202, 0 },
{ 202, 2 },
{ 202, 2 },
{ 228, 1 },
{ 228, 4 },
{ 229, 1 },
{ 229, 2 },
{ 229, 2 },
{ 197, 6 },
{ 230, 3 },
{ 230, 7 },
{ 230, 7 },
{ 230, 2 },
{ 231, 3 },
{ 231, 1 },
{ 233, 2 },
{ 216, 3 },
{ 216, 1 },
{ 234, 1 },
{ 234, 1 },
{ 234, 1 },
{ 234, 1 },
{ 234, 1 },
{ 234, 2 },
{ 234, 2 },
{ 234, 2 },
{ 234, 2 },
{ 197, 1 },
{ 232, 12 },
{ 246, 2 },
{ 246, 0 },
{ 235, 3 },
{ 235, 2 },
{ 248, 2 },
{ 248, 1 },
{ 248, 0 },
{ 236, 2 },
{ 249, 2 },
{ 249, 4 },
{ 250, 1 },
{ 238, 4 },
{ 238, 0 },
{ 239, 0 },
{ 239, 6 },
{ 239, 4 },
{ 240, 4 },
{ 240, 0 },
{ 242, 0 },
{ 242, 3 },
{ 251, 4 },
{ 251, 2 },
{ 253, 2 },
{ 254, 1 },
{ 254, 1 },
{ 254, 0 },
{ 241, 0 },
{ 241, 3 },
{ 255, 3 },
{ 255, 1 },
{ 243, 0 },
{ 243, 2 },
{ 245, 0 },
{ 245, 2 },
{ 245, 4 },
{ 245, 4 },
{ 244, 0 },
{ 244, 2 },
{ 244, 4 },
{ 244, 4 },
{ 237, 0 },
{ 237, 2 },
{ 247, 3 },
{ 247, 1 },
{ 247, 3 },
{ 247, 3 },
{ 247, 1 },
{ 247, 2 },
{ 247, 2 },
{ 247, 1 },
{ 247, 2 },
{ 247, 2 },
{ 247, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 1 },
{ 247, 4 },
{ 247, 4 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 3 },
{ 247, 5 },
{ 256, 3 },
{ 256, 1 },
{ 257, 1 },
{ 257, 0 },
{ 197, 4 },
{ 258, 4 },
{ 258, 5 },
{ 259, 3 },
{ 259, 1 },
{ 197, 3 },
{ 197, 7 },
{ 197, 7 },
{ 197, 7 },
{ 197, 7 },
{ 197, 8 },
{ 197, 9 },
{ 197, 5 },
{ 197, 7 },
{ 197, 7 },
{ 196, -1 }, /* (0) program ::= cmd */
{ 197, -2 }, /* (1) cmd ::= SHOW DATABASES */
{ 197, -2 }, /* (2) cmd ::= SHOW MNODES */
{ 197, -2 }, /* (3) cmd ::= SHOW DNODES */
{ 197, -2 }, /* (4) cmd ::= SHOW ACCOUNTS */
{ 197, -2 }, /* (5) cmd ::= SHOW USERS */
{ 197, -2 }, /* (6) cmd ::= SHOW MODULES */
{ 197, -2 }, /* (7) cmd ::= SHOW QUERIES */
{ 197, -2 }, /* (8) cmd ::= SHOW CONNECTIONS */
{ 197, -2 }, /* (9) cmd ::= SHOW STREAMS */
{ 197, -2 }, /* (10) cmd ::= SHOW CONFIGS */
{ 197, -2 }, /* (11) cmd ::= SHOW SCORES */
{ 197, -2 }, /* (12) cmd ::= SHOW GRANTS */
{ 198, 0 }, /* (13) dbPrefix ::= */
{ 198, -2 }, /* (14) dbPrefix ::= ids DOT */
{ 200, 0 }, /* (15) cpxName ::= */
{ 200, -2 }, /* (16) cpxName ::= DOT ids */
{ 197, -3 }, /* (17) cmd ::= SHOW dbPrefix TABLES */
{ 197, -5 }, /* (18) cmd ::= SHOW dbPrefix TABLES LIKE ids */
{ 197, -3 }, /* (19) cmd ::= SHOW dbPrefix STABLES */
{ 197, -5 }, /* (20) cmd ::= SHOW dbPrefix STABLES LIKE ids */
{ 197, -3 }, /* (21) cmd ::= SHOW dbPrefix VGROUPS */
{ 197, -5 }, /* (22) cmd ::= DROP TABLE ifexists ids cpxName */
{ 197, -4 }, /* (23) cmd ::= DROP DATABASE ifexists ids */
{ 197, -3 }, /* (24) cmd ::= DROP DNODE IPTOKEN */
{ 197, -3 }, /* (25) cmd ::= DROP USER ids */
{ 197, -3 }, /* (26) cmd ::= DROP ACCOUNT ids */
{ 197, -2 }, /* (27) cmd ::= USE ids */
{ 197, -3 }, /* (28) cmd ::= DESCRIBE ids cpxName */
{ 197, -5 }, /* (29) cmd ::= ALTER USER ids PASS ids */
{ 197, -5 }, /* (30) cmd ::= ALTER USER ids PRIVILEGE ids */
{ 197, -4 }, /* (31) cmd ::= ALTER DNODE IPTOKEN ids */
{ 197, -5 }, /* (32) cmd ::= ALTER DNODE IPTOKEN ids ids */
{ 197, -3 }, /* (33) cmd ::= ALTER LOCAL ids */
{ 197, -4 }, /* (34) cmd ::= ALTER LOCAL ids ids */
{ 197, -4 }, /* (35) cmd ::= ALTER DATABASE ids alter_db_optr */
{ 197, -4 }, /* (36) cmd ::= ALTER ACCOUNT ids acct_optr */
{ 197, -6 }, /* (37) cmd ::= ALTER ACCOUNT ids PASS ids acct_optr */
{ 199, -1 }, /* (38) ids ::= ID */
{ 199, -1 }, /* (39) ids ::= STRING */
{ 201, -2 }, /* (40) ifexists ::= IF EXISTS */
{ 201, 0 }, /* (41) ifexists ::= */
{ 204, -3 }, /* (42) ifnotexists ::= IF NOT EXISTS */
{ 204, 0 }, /* (43) ifnotexists ::= */
{ 197, -3 }, /* (44) cmd ::= CREATE DNODE IPTOKEN */
{ 197, -6 }, /* (45) cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
{ 197, -5 }, /* (46) cmd ::= CREATE DATABASE ifnotexists ids db_optr */
{ 197, -5 }, /* (47) cmd ::= CREATE USER ids PASS ids */
{ 206, 0 }, /* (48) pps ::= */
{ 206, -2 }, /* (49) pps ::= PPS INTEGER */
{ 207, 0 }, /* (50) tseries ::= */
{ 207, -2 }, /* (51) tseries ::= TSERIES INTEGER */
{ 208, 0 }, /* (52) dbs ::= */
{ 208, -2 }, /* (53) dbs ::= DBS INTEGER */
{ 209, 0 }, /* (54) streams ::= */
{ 209, -2 }, /* (55) streams ::= STREAMS INTEGER */
{ 210, 0 }, /* (56) storage ::= */
{ 210, -2 }, /* (57) storage ::= STORAGE INTEGER */
{ 211, 0 }, /* (58) qtime ::= */
{ 211, -2 }, /* (59) qtime ::= QTIME INTEGER */
{ 212, 0 }, /* (60) users ::= */
{ 212, -2 }, /* (61) users ::= USERS INTEGER */
{ 213, 0 }, /* (62) conns ::= */
{ 213, -2 }, /* (63) conns ::= CONNS INTEGER */
{ 214, 0 }, /* (64) state ::= */
{ 214, -2 }, /* (65) state ::= STATE ids */
{ 203, -9 }, /* (66) acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{ 215, -2 }, /* (67) keep ::= KEEP tagitemlist */
{ 217, -2 }, /* (68) tables ::= TABLES INTEGER */
{ 218, -2 }, /* (69) cache ::= CACHE INTEGER */
{ 219, -2 }, /* (70) replica ::= REPLICA INTEGER */
{ 220, -2 }, /* (71) days ::= DAYS INTEGER */
{ 221, -2 }, /* (72) rows ::= ROWS INTEGER */
{ 222, -2 }, /* (73) ablocks ::= ABLOCKS ID */
{ 223, -2 }, /* (74) tblocks ::= TBLOCKS INTEGER */
{ 224, -2 }, /* (75) ctime ::= CTIME INTEGER */
{ 225, -2 }, /* (76) clog ::= CLOG INTEGER */
{ 226, -2 }, /* (77) comp ::= COMP INTEGER */
{ 227, -2 }, /* (78) prec ::= PRECISION STRING */
{ 205, 0 }, /* (79) db_optr ::= */
{ 205, -2 }, /* (80) db_optr ::= db_optr tables */
{ 205, -2 }, /* (81) db_optr ::= db_optr cache */
{ 205, -2 }, /* (82) db_optr ::= db_optr replica */
{ 205, -2 }, /* (83) db_optr ::= db_optr days */
{ 205, -2 }, /* (84) db_optr ::= db_optr rows */
{ 205, -2 }, /* (85) db_optr ::= db_optr ablocks */
{ 205, -2 }, /* (86) db_optr ::= db_optr tblocks */
{ 205, -2 }, /* (87) db_optr ::= db_optr ctime */
{ 205, -2 }, /* (88) db_optr ::= db_optr clog */
{ 205, -2 }, /* (89) db_optr ::= db_optr comp */
{ 205, -2 }, /* (90) db_optr ::= db_optr prec */
{ 205, -2 }, /* (91) db_optr ::= db_optr keep */
{ 202, 0 }, /* (92) alter_db_optr ::= */
{ 202, -2 }, /* (93) alter_db_optr ::= alter_db_optr replica */
{ 202, -2 }, /* (94) alter_db_optr ::= alter_db_optr tables */
{ 228, -1 }, /* (95) typename ::= ids */
{ 228, -4 }, /* (96) typename ::= ids LP signed RP */
{ 229, -1 }, /* (97) signed ::= INTEGER */
{ 229, -2 }, /* (98) signed ::= PLUS INTEGER */
{ 229, -2 }, /* (99) signed ::= MINUS INTEGER */
{ 197, -6 }, /* (100) cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{ 230, -3 }, /* (101) create_table_args ::= LP columnlist RP */
{ 230, -7 }, /* (102) create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
{ 230, -7 }, /* (103) create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
{ 230, -2 }, /* (104) create_table_args ::= AS select */
{ 231, -3 }, /* (105) columnlist ::= columnlist COMMA column */
{ 231, -1 }, /* (106) columnlist ::= column */
{ 233, -2 }, /* (107) column ::= ids typename */
{ 216, -3 }, /* (108) tagitemlist ::= tagitemlist COMMA tagitem */
{ 216, -1 }, /* (109) tagitemlist ::= tagitem */
{ 234, -1 }, /* (110) tagitem ::= INTEGER */
{ 234, -1 }, /* (111) tagitem ::= FLOAT */
{ 234, -1 }, /* (112) tagitem ::= STRING */
{ 234, -1 }, /* (113) tagitem ::= BOOL */
{ 234, -1 }, /* (114) tagitem ::= NULL */
{ 234, -2 }, /* (115) tagitem ::= MINUS INTEGER */
{ 234, -2 }, /* (116) tagitem ::= MINUS FLOAT */
{ 234, -2 }, /* (117) tagitem ::= PLUS INTEGER */
{ 234, -2 }, /* (118) tagitem ::= PLUS FLOAT */
{ 197, -1 }, /* (119) cmd ::= select */
{ 232, -12 }, /* (120) select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{ 246, -2 }, /* (121) sclp ::= selcollist COMMA */
{ 246, 0 }, /* (122) sclp ::= */
{ 235, -3 }, /* (123) selcollist ::= sclp expr as */
{ 235, -2 }, /* (124) selcollist ::= sclp STAR */
{ 248, -2 }, /* (125) as ::= AS ids */
{ 248, -1 }, /* (126) as ::= ids */
{ 248, 0 }, /* (127) as ::= */
{ 236, -2 }, /* (128) from ::= FROM tablelist */
{ 249, -2 }, /* (129) tablelist ::= ids cpxName */
{ 249, -4 }, /* (130) tablelist ::= tablelist COMMA ids cpxName */
{ 250, -1 }, /* (131) tmvar ::= VARIABLE */
{ 238, -4 }, /* (132) interval_opt ::= INTERVAL LP tmvar RP */
{ 238, 0 }, /* (133) interval_opt ::= */
{ 239, 0 }, /* (134) fill_opt ::= */
{ 239, -6 }, /* (135) fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{ 239, -4 }, /* (136) fill_opt ::= FILL LP ID RP */
{ 240, -4 }, /* (137) sliding_opt ::= SLIDING LP tmvar RP */
{ 240, 0 }, /* (138) sliding_opt ::= */
{ 242, 0 }, /* (139) orderby_opt ::= */
{ 242, -3 }, /* (140) orderby_opt ::= ORDER BY sortlist */
{ 251, -4 }, /* (141) sortlist ::= sortlist COMMA item sortorder */
{ 251, -2 }, /* (142) sortlist ::= item sortorder */
{ 253, -2 }, /* (143) item ::= ids cpxName */
{ 254, -1 }, /* (144) sortorder ::= ASC */
{ 254, -1 }, /* (145) sortorder ::= DESC */
{ 254, 0 }, /* (146) sortorder ::= */
{ 241, 0 }, /* (147) groupby_opt ::= */
{ 241, -3 }, /* (148) groupby_opt ::= GROUP BY grouplist */
{ 255, -3 }, /* (149) grouplist ::= grouplist COMMA item */
{ 255, -1 }, /* (150) grouplist ::= item */
{ 243, 0 }, /* (151) having_opt ::= */
{ 243, -2 }, /* (152) having_opt ::= HAVING expr */
{ 245, 0 }, /* (153) limit_opt ::= */
{ 245, -2 }, /* (154) limit_opt ::= LIMIT signed */
{ 245, -4 }, /* (155) limit_opt ::= LIMIT signed OFFSET signed */
{ 245, -4 }, /* (156) limit_opt ::= LIMIT signed COMMA signed */
{ 244, 0 }, /* (157) slimit_opt ::= */
{ 244, -2 }, /* (158) slimit_opt ::= SLIMIT signed */
{ 244, -4 }, /* (159) slimit_opt ::= SLIMIT signed SOFFSET signed */
{ 244, -4 }, /* (160) slimit_opt ::= SLIMIT signed COMMA signed */
{ 237, 0 }, /* (161) where_opt ::= */
{ 237, -2 }, /* (162) where_opt ::= WHERE expr */
{ 247, -3 }, /* (163) expr ::= LP expr RP */
{ 247, -1 }, /* (164) expr ::= ID */
{ 247, -3 }, /* (165) expr ::= ID DOT ID */
{ 247, -3 }, /* (166) expr ::= ID DOT STAR */
{ 247, -1 }, /* (167) expr ::= INTEGER */
{ 247, -2 }, /* (168) expr ::= MINUS INTEGER */
{ 247, -2 }, /* (169) expr ::= PLUS INTEGER */
{ 247, -1 }, /* (170) expr ::= FLOAT */
{ 247, -2 }, /* (171) expr ::= MINUS FLOAT */
{ 247, -2 }, /* (172) expr ::= PLUS FLOAT */
{ 247, -1 }, /* (173) expr ::= STRING */
{ 247, -1 }, /* (174) expr ::= NOW */
{ 247, -1 }, /* (175) expr ::= VARIABLE */
{ 247, -1 }, /* (176) expr ::= BOOL */
{ 247, -4 }, /* (177) expr ::= ID LP exprlist RP */
{ 247, -4 }, /* (178) expr ::= ID LP STAR RP */
{ 247, -3 }, /* (179) expr ::= expr AND expr */
{ 247, -3 }, /* (180) expr ::= expr OR expr */
{ 247, -3 }, /* (181) expr ::= expr LT expr */
{ 247, -3 }, /* (182) expr ::= expr GT expr */
{ 247, -3 }, /* (183) expr ::= expr LE expr */
{ 247, -3 }, /* (184) expr ::= expr GE expr */
{ 247, -3 }, /* (185) expr ::= expr NE expr */
{ 247, -3 }, /* (186) expr ::= expr EQ expr */
{ 247, -3 }, /* (187) expr ::= expr PLUS expr */
{ 247, -3 }, /* (188) expr ::= expr MINUS expr */
{ 247, -3 }, /* (189) expr ::= expr STAR expr */
{ 247, -3 }, /* (190) expr ::= expr SLASH expr */
{ 247, -3 }, /* (191) expr ::= expr REM expr */
{ 247, -3 }, /* (192) expr ::= expr LIKE expr */
{ 247, -5 }, /* (193) expr ::= expr IN LP exprlist RP */
{ 256, -3 }, /* (194) exprlist ::= exprlist COMMA expritem */
{ 256, -1 }, /* (195) exprlist ::= expritem */
{ 257, -1 }, /* (196) expritem ::= expr */
{ 257, 0 }, /* (197) expritem ::= */
{ 197, -4 }, /* (198) cmd ::= INSERT INTO cpxName insert_value_list */
{ 258, -4 }, /* (199) insert_value_list ::= VALUES LP itemlist RP */
{ 258, -5 }, /* (200) insert_value_list ::= insert_value_list VALUES LP itemlist RP */
{ 259, -3 }, /* (201) itemlist ::= itemlist COMMA expr */
{ 259, -1 }, /* (202) itemlist ::= expr */
{ 197, -3 }, /* (203) cmd ::= RESET QUERY CACHE */
{ 197, -7 }, /* (204) cmd ::= ALTER TABLE ids cpxName ADD COLUMN columnlist */
{ 197, -7 }, /* (205) cmd ::= ALTER TABLE ids cpxName DROP COLUMN ids */
{ 197, -7 }, /* (206) cmd ::= ALTER TABLE ids cpxName ADD TAG columnlist */
{ 197, -7 }, /* (207) cmd ::= ALTER TABLE ids cpxName DROP TAG ids */
{ 197, -8 }, /* (208) cmd ::= ALTER TABLE ids cpxName CHANGE TAG ids ids */
{ 197, -9 }, /* (209) cmd ::= ALTER TABLE ids cpxName SET TAG ids EQ tagitem */
{ 197, -5 }, /* (210) cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */
{ 197, -7 }, /* (211) cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */
{ 197, -7 }, /* (212) cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */
};
static void yy_accept(yyParser*); /* Forward Declaration */
......@@ -1563,27 +1859,66 @@ static void yy_accept(yyParser*); /* Forward Declaration */
/*
** Perform a reduce action and the shift that must immediately
** follow the reduce.
**
** The yyLookahead and yyLookaheadToken parameters provide reduce actions
** access to the lookahead token (if any). The yyLookahead will be YYNOCODE
** if the lookahead token has already been consumed. As this procedure is
** only called from one place, optimizing compilers will in-line it, which
** means that the extra parameters have no performance impact.
*/
static void yy_reduce(
yyParser *yypParser, /* The parser */
int yyruleno /* Number of the rule by which to reduce */
unsigned int yyruleno, /* Number of the rule by which to reduce */
int yyLookahead, /* Lookahead token, or YYNOCODE if none */
ParseTOKENTYPE yyLookaheadToken /* Value of the lookahead token */
){
int yygoto; /* The next state */
int yyact; /* The next action */
YYMINORTYPE yygotominor; /* The LHS of the rule reduced */
yyStackEntry *yymsp; /* The top of the parser's stack */
int yysize; /* Amount to pop the stack */
ParseARG_FETCH;
yymsp = &yypParser->yystack[yypParser->yyidx];
(void)yyLookahead;
(void)yyLookaheadToken;
yymsp = yypParser->yytos;
#ifndef NDEBUG
if( yyTraceFILE && yyruleno>=0
&& yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
yysize = yyRuleInfo[yyruleno].nrhs;
fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt,
yyRuleName[yyruleno], yymsp[-yysize].stateno);
if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
yyTracePrompt,
yyruleno, yyRuleName[yyruleno], yymsp[yysize].stateno);
}else{
fprintf(yyTraceFILE, "%sReduce %d [%s].\n",
yyTracePrompt, yyruleno, yyRuleName[yyruleno]);
}
}
#endif /* NDEBUG */
yygotominor = yyzerominor;
/* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */
if( yyRuleInfo[yyruleno].nrhs==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
}
#endif
#if YYSTACKDEPTH>0
if( yypParser->yytos>=yypParser->yystackEnd ){
yyStackOverflow(yypParser);
return;
}
#else
if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
if( yyGrowStack(yypParser) ){
yyStackOverflow(yypParser);
return;
}
yymsp = yypParser->yytos;
}
#endif
}
switch( yyruleno ){
/* Beginning here are the reduction cases. A typical example
......@@ -1595,7 +1930,9 @@ static void yy_reduce(
** break;
*/
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* program ::= cmd */
case 79: /* db_optr ::= */ yytestcase(yyruleno==79);
{}
break;
case 1: /* cmd ::= SHOW DATABASES */
......@@ -1637,16 +1974,17 @@ static void yy_reduce(
case 13: /* dbPrefix ::= */
case 41: /* ifexists ::= */ yytestcase(yyruleno==41);
case 43: /* ifnotexists ::= */ yytestcase(yyruleno==43);
{yygotominor.yy0.n = 0;}
{yymsp[1].minor.yy0.n = 0;}
break;
case 14: /* dbPrefix ::= ids DOT */
{yygotominor.yy0 = yymsp[-1].minor.yy0; }
{yylhsminor.yy0 = yymsp[-1].minor.yy0; }
yymsp[-1].minor.yy0 = yylhsminor.yy0;
break;
case 15: /* cpxName ::= */
{yygotominor.yy0.n = 0; }
{yymsp[1].minor.yy0.n = 0; }
break;
case 16: /* cpxName ::= DOT ids */
{yygotominor.yy0 = yymsp[0].minor.yy0; yygotominor.yy0.n += 1; }
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n += 1; }
break;
case 17: /* cmd ::= SHOW dbPrefix TABLES */
{
......@@ -1686,7 +2024,7 @@ static void yy_reduce(
case 23: /* cmd ::= DROP DATABASE ifexists ids */
{ setDCLSQLElems(pInfo, DROP_DATABASE, 2, &yymsp[0].minor.yy0, &yymsp[-1].minor.yy0); }
break;
case 24: /* cmd ::= DROP DNODE IP */
case 24: /* cmd ::= DROP DNODE IPTOKEN */
{ setDCLSQLElems(pInfo, DROP_DNODE, 1, &yymsp[0].minor.yy0); }
break;
case 25: /* cmd ::= DROP USER ids */
......@@ -1710,10 +2048,10 @@ static void yy_reduce(
case 30: /* cmd ::= ALTER USER ids PRIVILEGE ids */
{ setDCLSQLElems(pInfo, ALTER_USER_PRIVILEGES, 2, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);}
break;
case 31: /* cmd ::= ALTER DNODE IP ids */
case 31: /* cmd ::= ALTER DNODE IPTOKEN ids */
{ setDCLSQLElems(pInfo, ALTER_DNODE, 2, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 32: /* cmd ::= ALTER DNODE IP ids ids */
case 32: /* cmd ::= ALTER DNODE IPTOKEN ids ids */
{ setDCLSQLElems(pInfo, ALTER_DNODE, 3, &yymsp[-2].minor.yy0, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 33: /* cmd ::= ALTER LOCAL ids */
......@@ -1733,13 +2071,16 @@ static void yy_reduce(
break;
case 38: /* ids ::= ID */
case 39: /* ids ::= STRING */ yytestcase(yyruleno==39);
{yygotominor.yy0 = yymsp[0].minor.yy0; }
{yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 40: /* ifexists ::= IF EXISTS */
case 42: /* ifnotexists ::= IF NOT EXISTS */ yytestcase(yyruleno==42);
{yygotominor.yy0.n = 1;}
{yymsp[-1].minor.yy0.n = 1;}
break;
case 42: /* ifnotexists ::= IF NOT EXISTS */
{yymsp[-2].minor.yy0.n = 1;}
break;
case 44: /* cmd ::= CREATE DNODE IP */
case 44: /* cmd ::= CREATE DNODE IPTOKEN */
{ setDCLSQLElems(pInfo, CREATE_DNODE, 1, &yymsp[0].minor.yy0);}
break;
case 45: /* cmd ::= CREATE ACCOUNT ids PASS ids acct_optr */
......@@ -1762,7 +2103,7 @@ static void yy_reduce(
case 64: /* state ::= */ yytestcase(yyruleno==64);
case 133: /* interval_opt ::= */ yytestcase(yyruleno==133);
case 138: /* sliding_opt ::= */ yytestcase(yyruleno==138);
{yygotominor.yy0.n = 0; }
{yymsp[1].minor.yy0.n = 0; }
break;
case 49: /* pps ::= PPS INTEGER */
case 51: /* tseries ::= TSERIES INTEGER */ yytestcase(yyruleno==51);
......@@ -1773,23 +2114,24 @@ static void yy_reduce(
case 61: /* users ::= USERS INTEGER */ yytestcase(yyruleno==61);
case 63: /* conns ::= CONNS INTEGER */ yytestcase(yyruleno==63);
case 65: /* state ::= STATE ids */ yytestcase(yyruleno==65);
{yygotominor.yy0 = yymsp[0].minor.yy0; }
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 66: /* acct_optr ::= pps tseries storage streams qtime dbs users conns state */
{
yygotominor.yy279.users = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yygotominor.yy279.dbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yygotominor.yy279.tseries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yygotominor.yy279.streams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yygotominor.yy279.pps = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yygotominor.yy279.storage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yygotominor.yy279.qtime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yygotominor.yy279.conns = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yygotominor.yy279.stat = yymsp[0].minor.yy0;
yylhsminor.yy279.users = (yymsp[-2].minor.yy0.n>0)?atoi(yymsp[-2].minor.yy0.z):-1;
yylhsminor.yy279.dbs = (yymsp[-3].minor.yy0.n>0)?atoi(yymsp[-3].minor.yy0.z):-1;
yylhsminor.yy279.tseries = (yymsp[-7].minor.yy0.n>0)?atoi(yymsp[-7].minor.yy0.z):-1;
yylhsminor.yy279.streams = (yymsp[-5].minor.yy0.n>0)?atoi(yymsp[-5].minor.yy0.z):-1;
yylhsminor.yy279.pps = (yymsp[-8].minor.yy0.n>0)?atoi(yymsp[-8].minor.yy0.z):-1;
yylhsminor.yy279.storage = (yymsp[-6].minor.yy0.n>0)?strtoll(yymsp[-6].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy279.qtime = (yymsp[-4].minor.yy0.n>0)?strtoll(yymsp[-4].minor.yy0.z, NULL, 10):-1;
yylhsminor.yy279.conns = (yymsp[-1].minor.yy0.n>0)?atoi(yymsp[-1].minor.yy0.z):-1;
yylhsminor.yy279.stat = yymsp[0].minor.yy0;
}
yymsp[-8].minor.yy279 = yylhsminor.yy279;
break;
case 67: /* keep ::= KEEP tagitemlist */
{ yygotominor.yy56 = yymsp[0].minor.yy56; }
{ yymsp[-1].minor.yy56 = yymsp[0].minor.yy56; }
break;
case 68: /* tables ::= TABLES INTEGER */
case 69: /* cache ::= CACHE INTEGER */ yytestcase(yyruleno==69);
......@@ -1802,65 +2144,81 @@ static void yy_reduce(
case 76: /* clog ::= CLOG INTEGER */ yytestcase(yyruleno==76);
case 77: /* comp ::= COMP INTEGER */ yytestcase(yyruleno==77);
case 78: /* prec ::= PRECISION STRING */ yytestcase(yyruleno==78);
case 79: /* db_optr ::= */ yytestcase(yyruleno==79);
{ yygotominor.yy0 = yymsp[0].minor.yy0; }
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 80: /* db_optr ::= db_optr tables */
case 94: /* alter_db_optr ::= alter_db_optr tables */ yytestcase(yyruleno==94);
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.tablesPerVnode = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.tablesPerVnode = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 81: /* db_optr ::= db_optr cache */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.cacheBlockSize = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 82: /* db_optr ::= db_optr replica */
case 93: /* alter_db_optr ::= alter_db_optr replica */ yytestcase(yyruleno==93);
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.replica = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 83: /* db_optr ::= db_optr days */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.daysPerFile = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 84: /* db_optr ::= db_optr rows */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.rowPerFileBlock = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.rowPerFileBlock = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 85: /* db_optr ::= db_optr ablocks */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.numOfAvgCacheBlocks = strtod(yymsp[0].minor.yy0.z, NULL); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.numOfAvgCacheBlocks = strtod(yymsp[0].minor.yy0.z, NULL); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 86: /* db_optr ::= db_optr tblocks */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.numOfBlocksPerTable = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.numOfBlocksPerTable = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 87: /* db_optr ::= db_optr ctime */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.commitTime = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 88: /* db_optr ::= db_optr clog */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.commitLog = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.commitLog = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 89: /* db_optr ::= db_optr comp */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.compressionLevel = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 90: /* db_optr ::= db_optr prec */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.precision = yymsp[0].minor.yy0; }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.precision = yymsp[0].minor.yy0; }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 91: /* db_optr ::= db_optr keep */
{ yygotominor.yy398 = yymsp[-1].minor.yy398; yygotominor.yy398.keep = yymsp[0].minor.yy56; }
{ yylhsminor.yy398 = yymsp[-1].minor.yy398; yylhsminor.yy398.keep = yymsp[0].minor.yy56; }
yymsp[-1].minor.yy398 = yylhsminor.yy398;
break;
case 92: /* alter_db_optr ::= */
{ memset(&yygotominor.yy398, 0, sizeof(SCreateDBInfo));}
{ memset(&yymsp[1].minor.yy398, 0, sizeof(SCreateDBInfo));}
break;
case 95: /* typename ::= ids */
{ tSQLSetColumnType (&yygotominor.yy223, &yymsp[0].minor.yy0); }
{ tSQLSetColumnType (&yylhsminor.yy223, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy223 = yylhsminor.yy223;
break;
case 96: /* typename ::= ids LP signed RP */
{
yymsp[-3].minor.yy0.type = -yymsp[-1].minor.yy389; // negative value of name length
tSQLSetColumnType(&yygotominor.yy223, &yymsp[-3].minor.yy0);
tSQLSetColumnType(&yylhsminor.yy223, &yymsp[-3].minor.yy0);
}
yymsp[-3].minor.yy223 = yylhsminor.yy223;
break;
case 97: /* signed ::= INTEGER */
case 98: /* signed ::= PLUS INTEGER */ yytestcase(yyruleno==98);
{ yygotominor.yy389 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
{ yylhsminor.yy389 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
yymsp[0].minor.yy389 = yylhsminor.yy389;
break;
case 98: /* signed ::= PLUS INTEGER */
{ yymsp[-1].minor.yy389 = strtol(yymsp[0].minor.yy0.z, NULL, 10); }
break;
case 99: /* signed ::= MINUS INTEGER */
{ yygotominor.yy389 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
{ yymsp[-1].minor.yy389 = -strtol(yymsp[0].minor.yy0.z, NULL, 10);}
break;
case 100: /* cmd ::= CREATE TABLE ifnotexists ids cpxName create_table_args */
{
......@@ -1870,54 +2228,61 @@ static void yy_reduce(
break;
case 101: /* create_table_args ::= LP columnlist RP */
{
yygotominor.yy158 = tSetCreateSQLElems(yymsp[-1].minor.yy471, NULL, NULL, NULL, NULL, TSQL_CREATE_NORMAL_METER);
setSQLInfo(pInfo, yygotominor.yy158, NULL, TSQL_CREATE_NORMAL_METER);
yymsp[-2].minor.yy158 = tSetCreateSQLElems(yymsp[-1].minor.yy471, NULL, NULL, NULL, NULL, TSQL_CREATE_NORMAL_METER);
setSQLInfo(pInfo, yymsp[-2].minor.yy158, NULL, TSQL_CREATE_NORMAL_METER);
}
break;
case 102: /* create_table_args ::= LP columnlist RP TAGS LP columnlist RP */
{
yygotominor.yy158 = tSetCreateSQLElems(yymsp[-5].minor.yy471, yymsp[-1].minor.yy471, NULL, NULL, NULL, TSQL_CREATE_NORMAL_METRIC);
setSQLInfo(pInfo, yygotominor.yy158, NULL, TSQL_CREATE_NORMAL_METRIC);
yymsp[-6].minor.yy158 = tSetCreateSQLElems(yymsp[-5].minor.yy471, yymsp[-1].minor.yy471, NULL, NULL, NULL, TSQL_CREATE_NORMAL_METRIC);
setSQLInfo(pInfo, yymsp[-6].minor.yy158, NULL, TSQL_CREATE_NORMAL_METRIC);
}
break;
case 103: /* create_table_args ::= USING ids cpxName TAGS LP tagitemlist RP */
{
yymsp[-5].minor.yy0.n += yymsp[-4].minor.yy0.n;
yygotominor.yy158 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy56, NULL, TSQL_CREATE_METER_FROM_METRIC);
setSQLInfo(pInfo, yygotominor.yy158, NULL, TSQL_CREATE_METER_FROM_METRIC);
yymsp[-6].minor.yy158 = tSetCreateSQLElems(NULL, NULL, &yymsp[-5].minor.yy0, yymsp[-1].minor.yy56, NULL, TSQL_CREATE_METER_FROM_METRIC);
setSQLInfo(pInfo, yymsp[-6].minor.yy158, NULL, TSQL_CREATE_METER_FROM_METRIC);
}
break;
case 104: /* create_table_args ::= AS select */
{
yygotominor.yy158 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy24, TSQL_CREATE_STREAM);
setSQLInfo(pInfo, yygotominor.yy158, NULL, TSQL_CREATE_STREAM);
yymsp[-1].minor.yy158 = tSetCreateSQLElems(NULL, NULL, NULL, NULL, yymsp[0].minor.yy24, TSQL_CREATE_STREAM);
setSQLInfo(pInfo, yymsp[-1].minor.yy158, NULL, TSQL_CREATE_STREAM);
}
break;
case 105: /* columnlist ::= columnlist COMMA column */
{yygotominor.yy471 = tFieldListAppend(yymsp[-2].minor.yy471, &yymsp[0].minor.yy223); }
{yylhsminor.yy471 = tFieldListAppend(yymsp[-2].minor.yy471, &yymsp[0].minor.yy223); }
yymsp[-2].minor.yy471 = yylhsminor.yy471;
break;
case 106: /* columnlist ::= column */
{yygotominor.yy471 = tFieldListAppend(NULL, &yymsp[0].minor.yy223);}
{yylhsminor.yy471 = tFieldListAppend(NULL, &yymsp[0].minor.yy223);}
yymsp[0].minor.yy471 = yylhsminor.yy471;
break;
case 107: /* column ::= ids typename */
{
tSQLSetColumnInfo(&yygotominor.yy223, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy223);
tSQLSetColumnInfo(&yylhsminor.yy223, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy223);
}
yymsp[-1].minor.yy223 = yylhsminor.yy223;
break;
case 108: /* tagitemlist ::= tagitemlist COMMA tagitem */
{ yygotominor.yy56 = tVariantListAppend(yymsp[-2].minor.yy56, &yymsp[0].minor.yy186, -1); }
{ yylhsminor.yy56 = tVariantListAppend(yymsp[-2].minor.yy56, &yymsp[0].minor.yy186, -1); }
yymsp[-2].minor.yy56 = yylhsminor.yy56;
break;
case 109: /* tagitemlist ::= tagitem */
{ yygotominor.yy56 = tVariantListAppend(NULL, &yymsp[0].minor.yy186, -1); }
{ yylhsminor.yy56 = tVariantListAppend(NULL, &yymsp[0].minor.yy186, -1); }
yymsp[0].minor.yy56 = yylhsminor.yy56;
break;
case 110: /* tagitem ::= INTEGER */
case 111: /* tagitem ::= FLOAT */ yytestcase(yyruleno==111);
case 112: /* tagitem ::= STRING */ yytestcase(yyruleno==112);
case 113: /* tagitem ::= BOOL */ yytestcase(yyruleno==113);
{toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yygotominor.yy186, &yymsp[0].minor.yy0); }
{toTSDBType(yymsp[0].minor.yy0.type); tVariantCreate(&yylhsminor.yy186, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy186 = yylhsminor.yy186;
break;
case 114: /* tagitem ::= NULL */
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yygotominor.yy186, &yymsp[0].minor.yy0); }
{ yymsp[0].minor.yy0.type = 0; tVariantCreate(&yylhsminor.yy186, &yymsp[0].minor.yy0); }
yymsp[0].minor.yy186 = yylhsminor.yy186;
break;
case 115: /* tagitem ::= MINUS INTEGER */
case 116: /* tagitem ::= MINUS FLOAT */ yytestcase(yyruleno==116);
......@@ -1927,8 +2292,9 @@ static void yy_reduce(
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
yymsp[-1].minor.yy0.type = yymsp[0].minor.yy0.type;
toTSDBType(yymsp[-1].minor.yy0.type);
tVariantCreate(&yygotominor.yy186, &yymsp[-1].minor.yy0);
tVariantCreate(&yylhsminor.yy186, &yymsp[-1].minor.yy0);
}
yymsp[-1].minor.yy186 = yylhsminor.yy186;
break;
case 119: /* cmd ::= select */
{
......@@ -1937,53 +2303,61 @@ static void yy_reduce(
break;
case 120: /* select ::= SELECT selcollist from where_opt interval_opt fill_opt sliding_opt groupby_opt orderby_opt having_opt slimit_opt limit_opt */
{
yygotominor.yy24 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy498, yymsp[-9].minor.yy56, yymsp[-8].minor.yy90, yymsp[-4].minor.yy56, yymsp[-3].minor.yy56, &yymsp[-7].minor.yy0, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy56, &yymsp[0].minor.yy294, &yymsp[-1].minor.yy294);
yylhsminor.yy24 = tSetQuerySQLElems(&yymsp[-11].minor.yy0, yymsp[-10].minor.yy498, yymsp[-9].minor.yy56, yymsp[-8].minor.yy90, yymsp[-4].minor.yy56, yymsp[-3].minor.yy56, &yymsp[-7].minor.yy0, &yymsp[-5].minor.yy0, yymsp[-6].minor.yy56, &yymsp[0].minor.yy294, &yymsp[-1].minor.yy294);
}
yymsp[-11].minor.yy24 = yylhsminor.yy24;
break;
case 121: /* sclp ::= selcollist COMMA */
{yygotominor.yy498 = yymsp[-1].minor.yy498;}
{yylhsminor.yy498 = yymsp[-1].minor.yy498;}
yymsp[-1].minor.yy498 = yylhsminor.yy498;
break;
case 122: /* sclp ::= */
{yygotominor.yy498 = 0;}
{yymsp[1].minor.yy498 = 0;}
break;
case 123: /* selcollist ::= sclp expr as */
{
yygotominor.yy498 = tSQLExprListAppend(yymsp[-2].minor.yy498, yymsp[-1].minor.yy90, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
yylhsminor.yy498 = tSQLExprListAppend(yymsp[-2].minor.yy498, yymsp[-1].minor.yy90, yymsp[0].minor.yy0.n?&yymsp[0].minor.yy0:0);
}
yymsp[-2].minor.yy498 = yylhsminor.yy498;
break;
case 124: /* selcollist ::= sclp STAR */
{
tSQLExpr *pNode = tSQLExprIdValueCreate(NULL, TK_ALL);
yygotominor.yy498 = tSQLExprListAppend(yymsp[-1].minor.yy498, pNode, 0);
yylhsminor.yy498 = tSQLExprListAppend(yymsp[-1].minor.yy498, pNode, 0);
}
yymsp[-1].minor.yy498 = yylhsminor.yy498;
break;
case 125: /* as ::= AS ids */
case 126: /* as ::= ids */ yytestcase(yyruleno==126);
{ yygotominor.yy0 = yymsp[0].minor.yy0; }
{ yymsp[-1].minor.yy0 = yymsp[0].minor.yy0; }
break;
case 126: /* as ::= ids */
{ yylhsminor.yy0 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 127: /* as ::= */
{ yygotominor.yy0.n = 0; }
{ yymsp[1].minor.yy0.n = 0; }
break;
case 128: /* from ::= FROM tablelist */
case 140: /* orderby_opt ::= ORDER BY sortlist */ yytestcase(yyruleno==140);
case 148: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==148);
{yygotominor.yy56 = yymsp[0].minor.yy56;}
{yymsp[-1].minor.yy56 = yymsp[0].minor.yy56;}
break;
case 129: /* tablelist ::= ids cpxName */
{ toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yygotominor.yy56 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);}
{ toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy56 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);}
yymsp[-1].minor.yy56 = yylhsminor.yy56;
break;
case 130: /* tablelist ::= tablelist COMMA ids cpxName */
{ toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yygotominor.yy56 = tVariantListAppendToken(yymsp[-3].minor.yy56, &yymsp[-1].minor.yy0, -1); }
{ toTSDBType(yymsp[-1].minor.yy0.type); yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yylhsminor.yy56 = tVariantListAppendToken(yymsp[-3].minor.yy56, &yymsp[-1].minor.yy0, -1); }
yymsp[-3].minor.yy56 = yylhsminor.yy56;
break;
case 131: /* tmvar ::= VARIABLE */
{yygotominor.yy0 = yymsp[0].minor.yy0;}
{yylhsminor.yy0 = yymsp[0].minor.yy0;}
yymsp[0].minor.yy0 = yylhsminor.yy0;
break;
case 132: /* interval_opt ::= INTERVAL LP tmvar RP */
case 137: /* sliding_opt ::= SLIDING LP tmvar RP */ yytestcase(yyruleno==137);
{yygotominor.yy0 = yymsp[-1].minor.yy0; }
{yymsp[-3].minor.yy0 = yymsp[-1].minor.yy0; }
break;
case 134: /* fill_opt ::= */
{yygotominor.yy56 = 0; }
{yymsp[1].minor.yy56 = 0; }
break;
case 135: /* fill_opt ::= FILL LP ID COMMA tagitemlist RP */
{
......@@ -1992,182 +2366,224 @@ static void yy_reduce(
tVariantCreate(&A, &yymsp[-3].minor.yy0);
tVariantListInsert(yymsp[-1].minor.yy56, &A, -1, 0);
yygotominor.yy56 = yymsp[-1].minor.yy56;
yymsp[-5].minor.yy56 = yymsp[-1].minor.yy56;
}
break;
case 136: /* fill_opt ::= FILL LP ID RP */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yygotominor.yy56 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
yymsp[-3].minor.yy56 = tVariantListAppendToken(NULL, &yymsp[-1].minor.yy0, -1);
}
break;
case 139: /* orderby_opt ::= */
case 147: /* groupby_opt ::= */ yytestcase(yyruleno==147);
{yygotominor.yy56 = 0;}
{yymsp[1].minor.yy56 = 0;}
break;
case 140: /* orderby_opt ::= ORDER BY sortlist */
case 148: /* groupby_opt ::= GROUP BY grouplist */ yytestcase(yyruleno==148);
{yymsp[-2].minor.yy56 = yymsp[0].minor.yy56;}
break;
case 141: /* sortlist ::= sortlist COMMA item sortorder */
{
yygotominor.yy56 = tVariantListAppend(yymsp[-3].minor.yy56, &yymsp[-1].minor.yy186, yymsp[0].minor.yy332);
yylhsminor.yy56 = tVariantListAppend(yymsp[-3].minor.yy56, &yymsp[-1].minor.yy186, yymsp[0].minor.yy332);
}
yymsp[-3].minor.yy56 = yylhsminor.yy56;
break;
case 142: /* sortlist ::= item sortorder */
{
yygotominor.yy56 = tVariantListAppend(NULL, &yymsp[-1].minor.yy186, yymsp[0].minor.yy332);
yylhsminor.yy56 = tVariantListAppend(NULL, &yymsp[-1].minor.yy186, yymsp[0].minor.yy332);
}
yymsp[-1].minor.yy56 = yylhsminor.yy56;
break;
case 143: /* item ::= ids cpxName */
{
toTSDBType(yymsp[-1].minor.yy0.type);
yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n;
tVariantCreate(&yygotominor.yy186, &yymsp[-1].minor.yy0);
tVariantCreate(&yylhsminor.yy186, &yymsp[-1].minor.yy0);
}
yymsp[-1].minor.yy186 = yylhsminor.yy186;
break;
case 144: /* sortorder ::= ASC */
{yygotominor.yy332 = TSQL_SO_ASC; }
{yymsp[0].minor.yy332 = TSQL_SO_ASC; }
break;
case 145: /* sortorder ::= DESC */
{yygotominor.yy332 = TSQL_SO_DESC;}
{yymsp[0].minor.yy332 = TSQL_SO_DESC;}
break;
case 146: /* sortorder ::= */
{yygotominor.yy332 = TSQL_SO_ASC;}
{yymsp[1].minor.yy332 = TSQL_SO_ASC;}
break;
case 149: /* grouplist ::= grouplist COMMA item */
{
yygotominor.yy56 = tVariantListAppend(yymsp[-2].minor.yy56, &yymsp[0].minor.yy186, -1);
yylhsminor.yy56 = tVariantListAppend(yymsp[-2].minor.yy56, &yymsp[0].minor.yy186, -1);
}
yymsp[-2].minor.yy56 = yylhsminor.yy56;
break;
case 150: /* grouplist ::= item */
{
yygotominor.yy56 = tVariantListAppend(NULL, &yymsp[0].minor.yy186, -1);
yylhsminor.yy56 = tVariantListAppend(NULL, &yymsp[0].minor.yy186, -1);
}
yymsp[0].minor.yy56 = yylhsminor.yy56;
break;
case 151: /* having_opt ::= */
case 161: /* where_opt ::= */ yytestcase(yyruleno==161);
case 197: /* expritem ::= */ yytestcase(yyruleno==197);
{yygotominor.yy90 = 0;}
{yymsp[1].minor.yy90 = 0;}
break;
case 152: /* having_opt ::= HAVING expr */
case 162: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==162);
case 196: /* expritem ::= expr */ yytestcase(yyruleno==196);
{yygotominor.yy90 = yymsp[0].minor.yy90;}
{yymsp[-1].minor.yy90 = yymsp[0].minor.yy90;}
break;
case 153: /* limit_opt ::= */
case 157: /* slimit_opt ::= */ yytestcase(yyruleno==157);
{yygotominor.yy294.limit = -1; yygotominor.yy294.offset = 0;}
{yymsp[1].minor.yy294.limit = -1; yymsp[1].minor.yy294.offset = 0;}
break;
case 154: /* limit_opt ::= LIMIT signed */
case 158: /* slimit_opt ::= SLIMIT signed */ yytestcase(yyruleno==158);
{yygotominor.yy294.limit = yymsp[0].minor.yy389; yygotominor.yy294.offset = 0;}
{yymsp[-1].minor.yy294.limit = yymsp[0].minor.yy389; yymsp[-1].minor.yy294.offset = 0;}
break;
case 155: /* limit_opt ::= LIMIT signed OFFSET signed */
case 159: /* slimit_opt ::= SLIMIT signed SOFFSET signed */ yytestcase(yyruleno==159);
{yygotominor.yy294.limit = yymsp[-2].minor.yy389; yygotominor.yy294.offset = yymsp[0].minor.yy389;}
{yymsp[-3].minor.yy294.limit = yymsp[-2].minor.yy389; yymsp[-3].minor.yy294.offset = yymsp[0].minor.yy389;}
break;
case 156: /* limit_opt ::= LIMIT signed COMMA signed */
case 160: /* slimit_opt ::= SLIMIT signed COMMA signed */ yytestcase(yyruleno==160);
{yygotominor.yy294.limit = yymsp[0].minor.yy389; yygotominor.yy294.offset = yymsp[-2].minor.yy389;}
{yymsp[-3].minor.yy294.limit = yymsp[0].minor.yy389; yymsp[-3].minor.yy294.offset = yymsp[-2].minor.yy389;}
break;
case 163: /* expr ::= LP expr RP */
{yygotominor.yy90 = yymsp[-1].minor.yy90; }
{yymsp[-2].minor.yy90 = yymsp[-1].minor.yy90; }
break;
case 164: /* expr ::= ID */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_ID);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 165: /* expr ::= ID DOT ID */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ID);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 166: /* expr ::= ID DOT STAR */
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
{yymsp[-2].minor.yy0.n += (1+yymsp[0].minor.yy0.n); yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[-2].minor.yy0, TK_ALL);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 167: /* expr ::= INTEGER */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_INTEGER);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 168: /* expr ::= MINUS INTEGER */
case 169: /* expr ::= PLUS INTEGER */ yytestcase(yyruleno==169);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_INTEGER; yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_INTEGER);}
yymsp[-1].minor.yy90 = yylhsminor.yy90;
break;
case 170: /* expr ::= FLOAT */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_FLOAT);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 171: /* expr ::= MINUS FLOAT */
case 172: /* expr ::= PLUS FLOAT */ yytestcase(yyruleno==172);
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
{yymsp[-1].minor.yy0.n += yymsp[0].minor.yy0.n; yymsp[-1].minor.yy0.type = TK_FLOAT; yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[-1].minor.yy0, TK_FLOAT);}
yymsp[-1].minor.yy90 = yylhsminor.yy90;
break;
case 173: /* expr ::= STRING */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_STRING);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 174: /* expr ::= NOW */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_NOW); }
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 175: /* expr ::= VARIABLE */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_VARIABLE);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 176: /* expr ::= BOOL */
{yygotominor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
{yylhsminor.yy90 = tSQLExprIdValueCreate(&yymsp[0].minor.yy0, TK_BOOL);}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 177: /* expr ::= ID LP exprlist RP */
{
yygotominor.yy90 = tSQLExprCreateFunction(yymsp[-1].minor.yy498, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type);
yylhsminor.yy90 = tSQLExprCreateFunction(yymsp[-1].minor.yy498, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type);
}
yymsp[-3].minor.yy90 = yylhsminor.yy90;
break;
case 178: /* expr ::= ID LP STAR RP */
{
yygotominor.yy90 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type);
yylhsminor.yy90 = tSQLExprCreateFunction(NULL, &yymsp[-3].minor.yy0, &yymsp[0].minor.yy0, yymsp[-3].minor.yy0.type);
}
yymsp[-3].minor.yy90 = yylhsminor.yy90;
break;
case 179: /* expr ::= expr AND expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_AND);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_AND);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 180: /* expr ::= expr OR expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_OR); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_OR); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 181: /* expr ::= expr LT expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LT);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LT);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 182: /* expr ::= expr GT expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_GT);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_GT);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 183: /* expr ::= expr LE expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LE);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LE);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 184: /* expr ::= expr GE expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_GE);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_GE);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 185: /* expr ::= expr NE expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_NE);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_NE);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 186: /* expr ::= expr EQ expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_EQ);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_EQ);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 187: /* expr ::= expr PLUS expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_PLUS); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_PLUS); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 188: /* expr ::= expr MINUS expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_MINUS); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_MINUS); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 189: /* expr ::= expr STAR expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_STAR); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_STAR); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 190: /* expr ::= expr SLASH expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_DIVIDE);}
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_DIVIDE);}
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 191: /* expr ::= expr REM expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_REM); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_REM); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 192: /* expr ::= expr LIKE expr */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LIKE); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-2].minor.yy90, yymsp[0].minor.yy90, TK_LIKE); }
yymsp[-2].minor.yy90 = yylhsminor.yy90;
break;
case 193: /* expr ::= expr IN LP exprlist RP */
{yygotominor.yy90 = tSQLExprCreate(yymsp[-4].minor.yy90, (tSQLExpr*)yymsp[-1].minor.yy498, TK_IN); }
{yylhsminor.yy90 = tSQLExprCreate(yymsp[-4].minor.yy90, (tSQLExpr*)yymsp[-1].minor.yy498, TK_IN); }
yymsp[-4].minor.yy90 = yylhsminor.yy90;
break;
case 194: /* exprlist ::= exprlist COMMA expritem */
case 201: /* itemlist ::= itemlist COMMA expr */ yytestcase(yyruleno==201);
{yygotominor.yy498 = tSQLExprListAppend(yymsp[-2].minor.yy498,yymsp[0].minor.yy90,0);}
{yylhsminor.yy498 = tSQLExprListAppend(yymsp[-2].minor.yy498,yymsp[0].minor.yy90,0);}
yymsp[-2].minor.yy498 = yylhsminor.yy498;
break;
case 195: /* exprlist ::= expritem */
case 202: /* itemlist ::= expr */ yytestcase(yyruleno==202);
{yygotominor.yy498 = tSQLExprListAppend(0,yymsp[0].minor.yy90,0);}
{yylhsminor.yy498 = tSQLExprListAppend(0,yymsp[0].minor.yy90,0);}
yymsp[0].minor.yy498 = yylhsminor.yy498;
break;
case 196: /* expritem ::= expr */
{yylhsminor.yy90 = yymsp[0].minor.yy90;}
yymsp[0].minor.yy90 = yylhsminor.yy90;
break;
case 198: /* cmd ::= INSERT INTO cpxName insert_value_list */
{
......@@ -2175,10 +2591,11 @@ static void yy_reduce(
}
break;
case 199: /* insert_value_list ::= VALUES LP itemlist RP */
{yygotominor.yy74 = tSQLListListAppend(NULL, yymsp[-1].minor.yy498);}
{yymsp[-3].minor.yy74 = tSQLListListAppend(NULL, yymsp[-1].minor.yy498);}
break;
case 200: /* insert_value_list ::= insert_value_list VALUES LP itemlist RP */
{yygotominor.yy74 = tSQLListListAppend(yymsp[-4].minor.yy74, yymsp[-1].minor.yy498);}
{yylhsminor.yy74 = tSQLListListAppend(yymsp[-4].minor.yy74, yymsp[-1].minor.yy498);}
yymsp[-4].minor.yy74 = yylhsminor.yy74;
break;
case 203: /* cmd ::= RESET QUERY CACHE */
{ setDCLSQLElems(pInfo, RESET_QUERY_CACHE, 0);}
......@@ -2245,44 +2662,36 @@ static void yy_reduce(
setSQLInfo(pInfo, pAlterTable, NULL, ALTER_TABLE_TAGS_SET);
}
break;
case 210: /* cmd ::= KILL CONNECTION IP COLON INTEGER */
case 210: /* cmd ::= KILL CONNECTION IPTOKEN COLON INTEGER */
{yymsp[-2].minor.yy0.n += (yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setDCLSQLElems(pInfo, KILL_CONNECTION, 1, &yymsp[-2].minor.yy0);}
break;
case 211: /* cmd ::= KILL STREAM IP COLON INTEGER COLON INTEGER */
case 211: /* cmd ::= KILL STREAM IPTOKEN COLON INTEGER COLON INTEGER */
{yymsp[-4].minor.yy0.n += (yymsp[-3].minor.yy0.n + yymsp[-2].minor.yy0.n + yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setDCLSQLElems(pInfo, KILL_STREAM, 1, &yymsp[-4].minor.yy0);}
break;
case 212: /* cmd ::= KILL QUERY IP COLON INTEGER COLON INTEGER */
case 212: /* cmd ::= KILL QUERY IPTOKEN COLON INTEGER COLON INTEGER */
{yymsp[-4].minor.yy0.n += (yymsp[-3].minor.yy0.n + yymsp[-2].minor.yy0.n + yymsp[-1].minor.yy0.n + yymsp[0].minor.yy0.n); setDCLSQLElems(pInfo, KILL_QUERY, 1, &yymsp[-4].minor.yy0);}
break;
default:
break;
/********** End reduce actions ************************************************/
};
assert( yyruleno>=0 && yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
yygoto = yyRuleInfo[yyruleno].lhs;
yysize = yyRuleInfo[yyruleno].nrhs;
yypParser->yyidx -= yysize;
yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto);
if( yyact <= YY_MAX_SHIFTREDUCE ){
if( yyact>YY_MAX_SHIFT ) yyact += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
/* If the reduce action popped at least
** one element off the stack, then we can push the new element back
** onto the stack here, and skip the stack overflow test in yy_shift().
** That gives a significant speed improvement. */
if( yysize ){
yypParser->yyidx++;
yymsp -= yysize-1;
yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto;
yymsp->minor = yygotominor;
yyTraceShift(yypParser, yyact);
}else{
yy_shift(yypParser,yyact,yygoto,&yygotominor);
}
}else{
assert( yyact == YY_ACCEPT_ACTION );
yy_accept(yypParser);
}
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table
** generator has simplified them to pure REDUCE actions. */
assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
/* It is not possible for a REDUCE to be followed by an error */
assert( yyact!=YY_ERROR_ACTION );
yymsp += yysize+1;
yypParser->yytos = yymsp;
yymsp->stateno = (YYACTIONTYPE)yyact;
yymsp->major = (YYCODETYPE)yygoto;
yyTraceShift(yypParser, yyact, "... then shift");
}
/*
......@@ -2298,7 +2707,7 @@ static void yy_parse_failed(
fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
}
#endif
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
/* Here code is inserted which will be executed whenever the
** parser fails */
/************ Begin %parse_failure code ***************************************/
......@@ -2313,10 +2722,10 @@ static void yy_parse_failed(
static void yy_syntax_error(
yyParser *yypParser, /* The parser */
int yymajor, /* The major type of the error token */
YYMINORTYPE yyminor /* The minor type of the error token */
ParseTOKENTYPE yyminor /* The minor type of the error token */
){
ParseARG_FETCH;
#define TOKEN (yyminor.yy0)
#define TOKEN yyminor
/************ Begin %syntax_error code ****************************************/
pInfo->validSql = false;
......@@ -2356,7 +2765,10 @@ static void yy_accept(
fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
}
#endif
while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
assert( yypParser->yytos==yypParser->yystack );
/* Here code is inserted which will be executed whenever the
** parser accepts */
/*********** Begin %parse_accept code *****************************************/
......@@ -2391,7 +2803,7 @@ void Parse(
ParseARG_PDECL /* Optional %extra_argument parameter */
){
YYMINORTYPE yyminorunion;
int yyact; /* The parser action. */
unsigned int yyact; /* The parser action. */
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
int yyendofinput; /* True if we are at the end of input */
#endif
......@@ -2400,29 +2812,8 @@ void Parse(
#endif
yyParser *yypParser; /* The parser */
/* (re)initialize the parser, if necessary */
yypParser = (yyParser*)yyp;
if( yypParser->yyidx<0 ){
#if YYSTACKDEPTH<=0
if( yypParser->yystksz <=0 ){
/*memset(&yyminorunion, 0, sizeof(yyminorunion));*/
yyminorunion = yyzerominor;
yyStackOverflow(yypParser, &yyminorunion);
return;
}
#endif
yypParser->yyidx = 0;
yypParser->yyerrcnt = -1;
yypParser->yystack[0].stateno = 0;
yypParser->yystack[0].major = 0;
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sInitialize. Empty stack. State 0\n",
yyTracePrompt);
}
#endif
}
yyminorunion.yy0 = yyminor;
assert( yypParser->yytos!=0 );
#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
yyendofinput = (yymajor==0);
#endif
......@@ -2430,21 +2821,34 @@ void Parse(
#ifndef NDEBUG
if( yyTraceFILE ){
fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]);
int stateno = yypParser->yytos->stateno;
if( stateno < YY_MIN_REDUCE ){
fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno);
}else{
fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
yyTracePrompt,yyTokenName[yymajor],stateno-YY_MIN_REDUCE);
}
}
#endif
do{
yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor);
if( yyact <= YY_MAX_SHIFTREDUCE ){
if( yyact > YY_MAX_SHIFT ) yyact += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
yy_shift(yypParser,yyact,yymajor,&yyminorunion);
if( yyact >= YY_MIN_REDUCE ){
yy_reduce(yypParser,yyact-YY_MIN_REDUCE,yymajor,yyminor);
}else if( yyact <= YY_MAX_SHIFTREDUCE ){
yy_shift(yypParser,yyact,yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt--;
#endif
yymajor = YYNOCODE;
}else if( yyact <= YY_MAX_REDUCE ){
yy_reduce(yypParser,yyact-YY_MIN_REDUCE);
}else if( yyact==YY_ACCEPT_ACTION ){
yypParser->yytos--;
yy_accept(yypParser);
return;
}else{
assert( yyact == YY_ERROR_ACTION );
yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
int yymx;
#endif
......@@ -2474,9 +2878,9 @@ void Parse(
**
*/
if( yypParser->yyerrcnt<0 ){
yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_syntax_error(yypParser,yymajor,yyminor);
}
yymx = yypParser->yystack[yypParser->yyidx].major;
yymx = yypParser->yytos->major;
if( yymx==YYERRORSYMBOL || yyerrorhit ){
#ifndef NDEBUG
if( yyTraceFILE ){
......@@ -2484,26 +2888,26 @@ void Parse(
yyTracePrompt,yyTokenName[yymajor]);
}
#endif
yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion);
yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
yymajor = YYNOCODE;
}else{
while(
yypParser->yyidx >= 0 &&
yymx != YYERRORSYMBOL &&
(yyact = yy_find_reduce_action(
yypParser->yystack[yypParser->yyidx].stateno,
while( yypParser->yytos >= yypParser->yystack
&& yymx != YYERRORSYMBOL
&& (yyact = yy_find_reduce_action(
yypParser->yytos->stateno,
YYERRORSYMBOL)) >= YY_MIN_REDUCE
){
yy_pop_parser_stack(yypParser);
}
if( yypParser->yyidx < 0 || yymajor==0 ){
if( yypParser->yytos < yypParser->yystack || yymajor==0 ){
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
yymajor = YYNOCODE;
}else if( yymx!=YYERRORSYMBOL ){
YYMINORTYPE u2;
u2.YYERRSYMDT = 0;
yy_shift(yypParser,yyact,YYERRORSYMBOL,&u2);
yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
}
}
yypParser->yyerrcnt = 3;
......@@ -2516,7 +2920,7 @@ void Parse(
** Applications can set this macro (for example inside %include) if
** they intend to abandon the parse upon the first syntax error seen.
*/
yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_syntax_error(yypParser,yymajor, yyminor);
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
yymajor = YYNOCODE;
......@@ -2531,24 +2935,29 @@ void Parse(
** three input tokens have been successfully shifted.
*/
if( yypParser->yyerrcnt<=0 ){
yy_syntax_error(yypParser,yymajor,yyminorunion);
yy_syntax_error(yypParser,yymajor, yyminor);
}
yypParser->yyerrcnt = 3;
yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
if( yyendofinput ){
yy_parse_failed(yypParser);
#ifndef YYNOERRORRECOVERY
yypParser->yyerrcnt = -1;
#endif
}
yymajor = YYNOCODE;
#endif
}
}while( yymajor!=YYNOCODE && yypParser->yyidx>=0 );
}while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack );
#ifndef NDEBUG
if( yyTraceFILE ){
int i;
yyStackEntry *i;
char cDiv = '[';
fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
for(i=1; i<=yypParser->yyidx; i++)
fprintf(yyTraceFILE,"%c%s", i==1 ? '[' : ' ',
yyTokenName[yypParser->yystack[i].major]);
for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
cDiv = ' ';
}
fprintf(yyTraceFILE,"]\n");
}
#endif
......
......@@ -96,7 +96,6 @@ static SKeyword keywordTable[] = {
{"TABLE", TK_TABLE},
{"DATABASE", TK_DATABASE},
{"DNODE", TK_DNODE},
{"IP", TK_IP},
{"USER", TK_USER},
{"ACCOUNT", TK_ACCOUNT},
{"USE", TK_USE},
......@@ -523,7 +522,7 @@ uint32_t tSQLGetToken(char* z, uint32_t* tokenType) {
}
if (seg == 4) { // ip address
*tokenType = TK_IP;
*tokenType = TK_IPTOKEN;
return i;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册