未验证 提交 be73f15a 编写于 作者: X xiao-yu-wang 提交者: GitHub

Merge pull request #10559 from taosdata/feature/3.0_query_integrate_wxy

TD-13706 integration create table stmt and insert stmt
......@@ -85,54 +85,55 @@
#define TK_DECIMAL 67
#define TK_SHOW 68
#define TK_DATABASES 69
#define TK_NK_FLOAT 70
#define TK_NK_BOOL 71
#define TK_NK_VARIABLE 72
#define TK_BETWEEN 73
#define TK_IS 74
#define TK_NULL 75
#define TK_NK_LT 76
#define TK_NK_GT 77
#define TK_NK_LE 78
#define TK_NK_GE 79
#define TK_NK_NE 80
#define TK_NK_EQ 81
#define TK_LIKE 82
#define TK_MATCH 83
#define TK_NMATCH 84
#define TK_IN 85
#define TK_FROM 86
#define TK_AS 87
#define TK_JOIN 88
#define TK_ON 89
#define TK_INNER 90
#define TK_SELECT 91
#define TK_DISTINCT 92
#define TK_WHERE 93
#define TK_PARTITION 94
#define TK_BY 95
#define TK_SESSION 96
#define TK_STATE_WINDOW 97
#define TK_INTERVAL 98
#define TK_SLIDING 99
#define TK_FILL 100
#define TK_VALUE 101
#define TK_NONE 102
#define TK_PREV 103
#define TK_LINEAR 104
#define TK_NEXT 105
#define TK_GROUP 106
#define TK_HAVING 107
#define TK_ORDER 108
#define TK_SLIMIT 109
#define TK_SOFFSET 110
#define TK_LIMIT 111
#define TK_OFFSET 112
#define TK_ASC 113
#define TK_DESC 114
#define TK_NULLS 115
#define TK_FIRST 116
#define TK_LAST 117
#define TK_TABLES 70
#define TK_NK_FLOAT 71
#define TK_NK_BOOL 72
#define TK_NK_VARIABLE 73
#define TK_BETWEEN 74
#define TK_IS 75
#define TK_NULL 76
#define TK_NK_LT 77
#define TK_NK_GT 78
#define TK_NK_LE 79
#define TK_NK_GE 80
#define TK_NK_NE 81
#define TK_NK_EQ 82
#define TK_LIKE 83
#define TK_MATCH 84
#define TK_NMATCH 85
#define TK_IN 86
#define TK_FROM 87
#define TK_AS 88
#define TK_JOIN 89
#define TK_ON 90
#define TK_INNER 91
#define TK_SELECT 92
#define TK_DISTINCT 93
#define TK_WHERE 94
#define TK_PARTITION 95
#define TK_BY 96
#define TK_SESSION 97
#define TK_STATE_WINDOW 98
#define TK_INTERVAL 99
#define TK_SLIDING 100
#define TK_FILL 101
#define TK_VALUE 102
#define TK_NONE 103
#define TK_PREV 104
#define TK_LINEAR 105
#define TK_NEXT 106
#define TK_GROUP 107
#define TK_HAVING 108
#define TK_ORDER 109
#define TK_SLIMIT 110
#define TK_SOFFSET 111
#define TK_LIMIT 112
#define TK_OFFSET 113
#define TK_ASC 114
#define TK_DESC 115
#define TK_NULLS 116
#define TK_FIRST 117
#define TK_LAST 118
#define TK_SPACE 300
#define TK_NK_COMMENT 301
......
......@@ -74,7 +74,8 @@ typedef enum ENodeType {
QUERY_NODE_CREATE_DATABASE_STMT,
QUERY_NODE_CREATE_TABLE_STMT,
QUERY_NODE_USE_DATABASE_STMT,
QUERY_NODE_SHOW_DATABASE_STMT, // temp
QUERY_NODE_SHOW_DATABASES_STMT, // temp
QUERY_NODE_SHOW_TABLES_STMT, // temp
// logic plan node
QUERY_NODE_LOGIC_PLAN_SCAN,
......@@ -128,6 +129,7 @@ void nodesDestroyNode(SNodeptr pNode);
SNodeList* nodesMakeList();
int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode);
int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode);
int32_t nodesListAppendList(SNodeList* pTarget, SNodeList* pSrc);
SListCell* nodesListErase(SNodeList* pList, SListCell* pCell);
SNodeptr nodesListGetNode(SNodeList* pList, int32_t index);
......
......@@ -43,6 +43,7 @@ typedef struct SScanLogicNode {
SLogicNode node;
SNodeList* pScanCols;
struct STableMeta* pMeta;
SVgroupsInfo* pVgroupList;
EScanType scanType;
uint8_t scanFlag; // denotes reversed scan of data or not
STimeWindow scanRange;
......@@ -84,7 +85,6 @@ typedef struct SSubLogicPlan {
SNodeList* pChildren;
SNodeList* pParents;
SLogicNode* pNode;
SQueryNodeAddr execNode;
ESubplanType subplanType;
int32_t level;
} SSubLogicPlan;
......
......@@ -123,6 +123,7 @@ struct STableMeta;
typedef struct SRealTableNode {
STableNode table; // QUERY_NODE_REAL_TABLE
struct STableMeta* pMeta;
SVgroupsInfo* pVgroupList;
} SRealTableNode;
typedef struct STempTableNode {
......
......@@ -38,8 +38,9 @@ typedef struct SParseContext {
typedef struct SCmdMsgInfo {
int16_t msgType;
SEpSet epSet;
char* pMsg;
void* pMsg;
int32_t msgLen;
void* pExtension; // todo remove it soon
} SCmdMsgInfo;
typedef struct SQuery {
......@@ -50,6 +51,7 @@ typedef struct SQuery {
int32_t numOfResCols;
SSchema* pResSchema;
SCmdMsgInfo* pCmdMsg;
int32_t msgType;
} SQuery;
int32_t qParseQuerySql(SParseContext* pCxt, SQuery** pQuery);
......
......@@ -28,7 +28,7 @@ typedef struct SPlanContext {
} SPlanContext;
// Create the physical plan for the query, according to the AST.
int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan);
int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNodeList);
// Set datasource of this subplan, multiple calls may be made to a subplan.
// @subplan subplan to be schedule
......
......@@ -176,6 +176,14 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
STscObj* pTscObj = pRequest->pTscObj;
SMsgSendInfo* pSendMsg = buildMsgInfoImpl(pRequest);
if (pMsgInfo->msgType == TDMT_VND_SHOW_TABLES) {
SShowReqInfo* pShowReqInfo = &pRequest->body.showInfo;
if (pShowReqInfo->pArray == NULL) {
pShowReqInfo->currentIndex = 0; // set the first vnode/ then iterate the next vnode
pShowReqInfo->pArray = pMsgInfo->pExtension;
}
}
int64_t transporterId = 0;
asyncSendMsgToServer(pTscObj->pAppInfo->pTransporter, &pMsgInfo->epSet, &transporterId, pSendMsg);
......@@ -183,10 +191,10 @@ int32_t execDdlQuery(SRequestObj* pRequest, SQuery* pQuery) {
return TSDB_CODE_SUCCESS;
}
int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pDag, SArray* pNodeList) {
pRequest->type = pQuery->sqlNodeType;
int32_t getPlan(SRequestObj* pRequest, SQuery* pQuery, SQueryPlan** pPlan, SArray* pNodeList) {
pRequest->type = pQuery->msgType;
SPlanContext cxt = { .queryId = pRequest->requestId, .pAstRoot = pQuery->pRoot };
int32_t code = qCreateQueryPlan(&cxt, pDag);
int32_t code = qCreateQueryPlan(&cxt, pPlan, pNodeList);
if (code != 0) {
return code;
}
......@@ -219,7 +227,7 @@ int32_t scheduleQuery(SRequestObj* pRequest, SQueryPlan* pDag, SArray* pNodeList
return pRequest->code;
}
if (TSDB_SQL_INSERT == pRequest->type || TSDB_SQL_CREATE_TABLE == pRequest->type) {
if (TDMT_VND_SUBMIT == pRequest->type || TDMT_VND_CREATE_TABLE == pRequest->type) {
pRequest->body.resInfo.numOfRows = res.numOfRows;
if (pRequest->body.queryJob != 0) {
......
......@@ -160,7 +160,6 @@ static SNode* groupingSetNodeCopy(const SGroupingSetNode* pSrc, SGroupingSetNode
static SNode* logicSubplanCopy(const SSubLogicPlan* pSrc, SSubLogicPlan* pDst) {
COPY_NODE_FIELD(pNode);
COPY_SCALAR_FIELD(execNode);
COPY_SCALAR_FIELD(subplanType);
return (SNode*)pDst;
}
......
......@@ -80,8 +80,10 @@ const char* nodesNodeName(ENodeType type) {
return "CreateTableStmt";
case QUERY_NODE_USE_DATABASE_STMT:
return "UseDatabaseStmt";
case QUERY_NODE_SHOW_DATABASE_STMT:
case QUERY_NODE_SHOW_DATABASES_STMT:
return "ShowDatabaseStmt";
case QUERY_NODE_SHOW_TABLES_STMT:
return "ShowTablesStmt";
case QUERY_NODE_LOGIC_PLAN_SCAN:
return "LogicScan";
case QUERY_NODE_LOGIC_PLAN_JOIN:
......@@ -1322,7 +1324,8 @@ static int32_t specificNodeToJson(const void* pObj, SJson* pJson) {
case QUERY_NODE_CREATE_DATABASE_STMT:
case QUERY_NODE_CREATE_TABLE_STMT:
case QUERY_NODE_USE_DATABASE_STMT:
case QUERY_NODE_SHOW_DATABASE_STMT:
case QUERY_NODE_SHOW_DATABASES_STMT:
case QUERY_NODE_SHOW_TABLES_STMT:
break;
case QUERY_NODE_LOGIC_PLAN_SCAN:
return logicScanNodeToJson(pObj, pJson);
......
......@@ -86,7 +86,8 @@ SNodeptr nodesMakeNode(ENodeType type) {
return makeNode(type, sizeof(SCreateTableStmt));
case QUERY_NODE_USE_DATABASE_STMT:
return makeNode(type, sizeof(SUseDatabaseStmt));
case QUERY_NODE_SHOW_DATABASE_STMT:
case QUERY_NODE_SHOW_DATABASES_STMT:
case QUERY_NODE_SHOW_TABLES_STMT:
return makeNode(type, sizeof(SNode));;
case QUERY_NODE_LOGIC_PLAN_SCAN:
return makeNode(type, sizeof(SScanLogicNode));
......@@ -202,6 +203,17 @@ int32_t nodesListAppend(SNodeList* pList, SNodeptr pNode) {
return TSDB_CODE_SUCCESS;
}
int32_t nodesListStrictAppend(SNodeList* pList, SNodeptr pNode) {
if (NULL == pNode) {
return TSDB_CODE_OUT_OF_MEMORY;
}
int32_t code = nodesListAppend(pList, pNode);
if (TSDB_CODE_SUCCESS != code) {
nodesDestroyNode(pNode);
}
return code;
}
int32_t nodesListAppendList(SNodeList* pTarget, SNodeList* pSrc) {
if (NULL == pTarget || NULL == pSrc) {
return TSDB_CODE_SUCCESS;
......
......@@ -101,8 +101,8 @@ cmd ::= CREATE TABLE exists_opt(A) full_table_name(B)
%type full_table_name { STokenPair }
%destructor full_table_name { }
full_table_name(A) ::= NK_ID(B). { STokenPair t = { .first = B, .second = nil_token}; A = t; }
full_table_name(A) ::= NK_ID(B) NK_DOT NK_ID(C). { STokenPair t = { .first = B, .second = C}; A = t; }
full_table_name(A) ::= NK_ID(B). { STokenPair t = { .first = nil_token, .second = B }; A = t; }
full_table_name(A) ::= NK_ID(B) NK_DOT NK_ID(C). { STokenPair t = { .first = B, .second = C }; A = t; }
%type column_def_list { SNodeList* }
%destructor column_def_list { nodesDestroyList($$); }
......@@ -146,7 +146,8 @@ table_options(A) ::= table_options(B) KEEP NK_INTEGER(C).
table_options(A) ::= table_options(B) TTL NK_INTEGER(C). { A = setTableOption(pCxt, B, TABLE_OPTION_TTL, &C); }
/************************************************ show ***************************************************************/
cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASE_STMT); }
cmd ::= SHOW DATABASES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
cmd ::= SHOW TABLES. { pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT); }
/************************************************ select *************************************************************/
cmd ::= query_expression(A). { PARSER_TRACE; pCxt->pRootNode = A; }
......
......@@ -714,18 +714,18 @@ SNode* createColumnDefNode(SAstCreateContext* pCxt, const SToken* pColName, SDat
strncpy(pCol->colName, pColName->z, pColName->n);
pCol->dataType = dataType;
if (NULL != pComment) {
strncpy(pCol->colName, pColName->z, pColName->n);
strncpy(pCol->comments, pComment->z, pComment->n);
}
return (SNode*)pCol;
}
SDataType createDataType(uint8_t type) {
SDataType dt = { .type = type, .precision = 0, .scale = 0, .bytes = 0 };
SDataType dt = { .type = type, .precision = 0, .scale = 0, .bytes = tDataTypes[type].bytes };
return dt;
}
SDataType createVarLenDataType(uint8_t type, const SToken* pLen) {
SDataType dt = { .type = type, .precision = 0, .scale = 0, .bytes = 0 };
SDataType dt = { .type = type, .precision = 0, .scale = 0, .bytes = tDataTypes[type].bytes };
return dt;
}
......@@ -751,7 +751,7 @@ SNode* createUseDatabaseStmt(SAstCreateContext* pCxt, const SToken* pDbName) {
}
SNode* createShowStmt(SAstCreateContext* pCxt, ENodeType type) {
SNode* pStmt = nodesMakeNode(QUERY_NODE_SHOW_DATABASE_STMT);;
SNode* pStmt = nodesMakeNode(type);;
CHECK_OUT_OF_MEM(pStmt);
return pStmt;
}
......@@ -39,6 +39,7 @@ static void setQuery(SAstCreateContext* pCxt, SQuery* pQuery) {
pQuery->haveResultSet = false;
pQuery->directRpc = true;
}
pQuery->msgType = (QUERY_NODE_CREATE_TABLE_STMT == type ? TDMT_VND_CREATE_TABLE : TDMT_VND_QUERY);
}
int32_t doParse(SParseContext* pParseCxt, SQuery** pQuery) {
......
......@@ -561,6 +561,29 @@ static int32_t checkAggColCoexist(STranslateContext* pCxt, SSelectStmt* pSelect)
return TSDB_CODE_SUCCESS;
}
static int32_t setTableVgroupList(STranslateContext *pCxt, SName* name, SVgroupsInfo **pVgList) {
SArray* vgroupList = NULL;
int32_t code = catalogGetTableDistVgInfo(pCxt->pParseCxt->pCatalog, pCxt->pParseCxt->pTransporter, &(pCxt->pParseCxt->mgmtEpSet), name, &vgroupList);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
size_t vgroupNum = taosArrayGetSize(vgroupList);
SVgroupsInfo *vgList = calloc(1, sizeof(SVgroupsInfo) + sizeof(SVgroupInfo) * vgroupNum);
vgList->numOfVgroups = vgroupNum;
for (int32_t i = 0; i < vgroupNum; ++i) {
SVgroupInfo *vg = taosArrayGet(vgroupList, i);
vgList->vgroups[i] = *vg;
}
*pVgList = vgList;
taosArrayDestroy(vgroupList);
return TSDB_CODE_SUCCESS;
}
static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pTable)) {
......@@ -572,6 +595,10 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) {
if (TSDB_CODE_SUCCESS != code) {
return generateSyntaxErrMsg(pCxt, TSDB_CODE_PAR_TABLE_NOT_EXIST, pRealTable->table.tableName);
}
code = setTableVgroupList(pCxt, &name, &(pRealTable->pVgroupList));
if (TSDB_CODE_SUCCESS != code) {
return code;
}
code = addNamespace(pCxt, pRealTable);
break;
}
......@@ -852,11 +879,7 @@ static int32_t translateUseDatabase(STranslateContext* pCxt, SUseDatabaseStmt* p
return TSDB_CODE_SUCCESS;
}
static int32_t translateCreateTable(STranslateContext* pCxt, SCreateTableStmt* pStmt) {
return TSDB_CODE_SUCCESS;
}
static int32_t translateShow(STranslateContext* pCxt) {
static int32_t translateShowDatabases(STranslateContext* pCxt) {
SShowReq showReq = { .type = TSDB_MGMT_TABLE_DB };
pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo));
......@@ -875,6 +898,34 @@ static int32_t translateShow(STranslateContext* pCxt) {
return TSDB_CODE_SUCCESS;
}
static int32_t translateShowTables(STranslateContext* pCxt) {
SName name = {0};
SVShowTablesReq* pShowReq = calloc(1, sizeof(SVShowTablesReq));
tNameSetDbName(&name, pCxt->pParseCxt->acctId, pCxt->pParseCxt->db, strlen(pCxt->pParseCxt->db));
char dbFname[TSDB_DB_FNAME_LEN] = {0};
tNameGetFullDbName(&name, dbFname);
SArray* array = NULL;
int32_t code = catalogGetDBVgInfo(pCxt->pParseCxt->pCatalog, pCxt->pParseCxt->pTransporter, &pCxt->pParseCxt->mgmtEpSet, dbFname, false, &array);
if (code != TSDB_CODE_SUCCESS) {
return code;
}
SVgroupInfo* info = taosArrayGet(array, 0);
pShowReq->head.vgId = htonl(info->vgId);
pCxt->pCmdMsg = malloc(sizeof(SCmdMsgInfo));
if (NULL== pCxt->pCmdMsg) {
return TSDB_CODE_OUT_OF_MEMORY;
}
pCxt->pCmdMsg->epSet = info->epset;
pCxt->pCmdMsg->msgType = TDMT_VND_SHOW_TABLES;
pCxt->pCmdMsg->msgLen = sizeof(SVShowTablesReq);
pCxt->pCmdMsg->pMsg = pShowReq;
pCxt->pCmdMsg->pExtension = array;
return TSDB_CODE_SUCCESS;
}
static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
int32_t code = TSDB_CODE_SUCCESS;
switch (nodeType(pNode)) {
......@@ -887,10 +938,11 @@ static int32_t translateQuery(STranslateContext* pCxt, SNode* pNode) {
case QUERY_NODE_USE_DATABASE_STMT:
code = translateUseDatabase(pCxt, (SUseDatabaseStmt*)pNode);
break;
case QUERY_NODE_SHOW_DATABASE_STMT:
code = translateShow(pCxt);
case QUERY_NODE_CREATE_TABLE_STMT:
code = translateCreateTable(pCxt, (SCreateTableStmt*)pNode);
case QUERY_NODE_SHOW_DATABASES_STMT:
code = translateShowDatabases(pCxt);
break;
case QUERY_NODE_SHOW_TABLES_STMT:
code = translateShowTables(pCxt);
break;
default:
break;
......@@ -942,9 +994,10 @@ typedef struct SVgroupTablesBatch {
SVgroupInfo info;
} SVgroupTablesBatch;
static void toSchema(const SColumnNode* pCol, SSchema* pSchema) {
pSchema->type = pCol->node.resType.type;
pSchema->bytes = pCol->node.resType.bytes;
static void toSchema(const SColumnDefNode* pCol, int32_t colId, SSchema* pSchema) {
pSchema->colId = colId;
pSchema->type = pCol->dataType.type;
pSchema->bytes = pCol->dataType.bytes;
strcpy(pSchema->name, pCol->colName);
}
......@@ -960,7 +1013,8 @@ static int32_t doBuildSingleTableBatchReq(SName* pTableName, SNodeList* pColumns
SNode* pCol;
int32_t index = 0;
FOREACH(pCol, pColumns) {
toSchema((SColumnNode*)pCol, req.ntbCfg.pSchema + index++);
toSchema((SColumnDefNode*)pCol, index + 1, req.ntbCfg.pSchema + index);
++index;
}
pBatch->info = *pVgroupInfo;
......@@ -1018,7 +1072,11 @@ static int32_t rewriteQuery(STranslateContext* pCxt, SQuery* pQuery) {
SCreateTableStmt* pStmt = (SCreateTableStmt*)pQuery->pRoot;
SName tableName = { .type = TSDB_TABLE_NAME_T, .acctId = pCxt->pParseCxt->acctId };
if ('\0' == pStmt->dbName[0]) {
strcpy(tableName.dbname, pCxt->pParseCxt->db);
} else {
strcpy(tableName.dbname, pStmt->dbName);
}
strcpy(tableName.tname, pStmt->tableName);
SVgroupInfo info = {0};
catalogGetTableHashVgroup(pCxt->pParseCxt->pCatalog, pCxt->pParseCxt->pTransporter, &pCxt->pParseCxt->mgmtEpSet, &tableName, &info);
......
......@@ -159,12 +159,9 @@ static int32_t createSName(SName* pName, SToken* pTableName, SParseContext* pPar
}
static int32_t getTableMeta(SInsertParseContext* pCxt, SToken* pTname) {
SName name = {0};
createSName(&name, pTname, pCxt->pComCxt, &pCxt->msg);
char tableName[TSDB_TABLE_FNAME_LEN] = {0};
tNameExtractFullName(&name, tableName);
SParseContext* pBasicCtx = pCxt->pComCxt;
SName name = {0};
createSName(&name, pTname, pBasicCtx, &pCxt->msg);
CHECK_CODE(catalogGetTableMeta(pBasicCtx->pCatalog, pBasicCtx->pTransporter, &pBasicCtx->mgmtEpSet, &name, &pCxt->pTableMeta));
SVgroupInfo vg;
CHECK_CODE(catalogGetTableHashVgroup(pBasicCtx->pCatalog, pBasicCtx->pTransporter, &pBasicCtx->mgmtEpSet, &name, &vg));
......@@ -939,6 +936,13 @@ int32_t parseInsertSql(SParseContext* pContext, SQuery** pQuery) {
return TSDB_CODE_TSC_OUT_OF_MEMORY;
}
*pQuery = calloc(1, sizeof(SQuery));
if (NULL == *pQuery) {
return TSDB_CODE_OUT_OF_MEMORY;
}
(*pQuery)->directRpc = false;
(*pQuery)->haveResultSet = false;
(*pQuery)->msgType = TDMT_VND_SUBMIT;
(*pQuery)->pRoot = (SNode*)context.pOutput;
context.pOutput->payloadType = PAYLOAD_TYPE_KV;
......
......@@ -109,25 +109,25 @@
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned char
#define YYNOCODE 179
#define YYNOCODE 180
#define YYACTIONTYPE unsigned short int
#define NewParseTOKENTYPE SToken
typedef union {
int yyinit;
NewParseTOKENTYPE yy0;
EOrder yy14;
ENullOrder yy17;
SDatabaseOptions* yy27;
STableOptions* yy40;
SNodeList* yy60;
SToken yy105;
STokenPair yy111;
SNode* yy172;
EFillMode yy202;
EOperatorType yy214;
SDataType yy248;
bool yy259;
EJoinType yy278;
EOperatorType yy20;
STableOptions* yy46;
EFillMode yy54;
STokenPair yy57;
SNodeList* yy64;
bool yy137;
SDatabaseOptions* yy199;
SToken yy209;
ENullOrder yy217;
EOrder yy218;
EJoinType yy252;
SNode* yy272;
SDataType yy304;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
......@@ -142,17 +142,17 @@ typedef union {
#define NewParseCTX_PARAM
#define NewParseCTX_FETCH
#define NewParseCTX_STORE
#define YYNSTATE 211
#define YYNRULE 196
#define YYNTOKEN 118
#define YY_MAX_SHIFT 210
#define YY_MIN_SHIFTREDUCE 352
#define YY_MAX_SHIFTREDUCE 547
#define YY_ERROR_ACTION 548
#define YY_ACCEPT_ACTION 549
#define YY_NO_ACTION 550
#define YY_MIN_REDUCE 551
#define YY_MAX_REDUCE 746
#define YYNSTATE 212
#define YYNRULE 197
#define YYNTOKEN 119
#define YY_MAX_SHIFT 211
#define YY_MIN_SHIFTREDUCE 353
#define YY_MAX_SHIFTREDUCE 549
#define YY_ERROR_ACTION 550
#define YY_ACCEPT_ACTION 551
#define YY_NO_ACTION 552
#define YY_MIN_REDUCE 553
#define YY_MAX_REDUCE 749
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
......@@ -219,256 +219,255 @@ typedef union {
** yy_default[] Default action for each state.
**
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (890)
#define YY_ACTTAB_COUNT (871)
static const YYACTIONTYPE yy_action[] = {
/* 0 */ 616, 614, 105, 187, 116, 725, 576, 48, 23, 75,
/* 10 */ 76, 639, 30, 28, 26, 25, 24, 157, 125, 724,
/* 20 */ 678, 100, 128, 723, 678, 30, 28, 26, 25, 24,
/* 30 */ 551, 617, 614, 639, 100, 68, 624, 614, 675, 157,
/* 40 */ 158, 694, 674, 42, 625, 430, 628, 664, 26, 25,
/* 50 */ 24, 663, 660, 210, 678, 209, 208, 207, 206, 205,
/* 60 */ 204, 203, 202, 201, 150, 200, 199, 198, 197, 196,
/* 70 */ 195, 194, 673, 22, 109, 151, 448, 449, 450, 451,
/* 80 */ 452, 453, 454, 456, 457, 458, 22, 109, 140, 448,
/* 90 */ 449, 450, 451, 452, 453, 454, 456, 457, 458, 30,
/* 100 */ 28, 26, 25, 24, 381, 185, 184, 183, 385, 182,
/* 110 */ 387, 388, 181, 390, 178, 117, 396, 175, 398, 399,
/* 120 */ 172, 169, 639, 573, 147, 624, 614, 133, 157, 158,
/* 130 */ 577, 48, 40, 625, 84, 628, 664, 152, 423, 80,
/* 140 */ 99, 660, 10, 639, 142, 497, 624, 614, 421, 143,
/* 150 */ 158, 424, 725, 41, 625, 189, 628, 664, 82, 20,
/* 160 */ 188, 107, 660, 52, 58, 162, 57, 639, 455, 149,
/* 170 */ 723, 459, 190, 157, 10, 74, 142, 421, 132, 73,
/* 180 */ 489, 118, 691, 639, 6, 485, 624, 614, 58, 143,
/* 190 */ 158, 640, 59, 41, 625, 78, 628, 664, 139, 9,
/* 200 */ 8, 107, 660, 52, 683, 639, 485, 2, 624, 614,
/* 210 */ 46, 157, 158, 424, 126, 41, 625, 44, 628, 664,
/* 220 */ 695, 58, 692, 107, 660, 737, 141, 53, 671, 672,
/* 230 */ 511, 676, 639, 43, 698, 624, 614, 705, 157, 158,
/* 240 */ 9, 8, 41, 625, 145, 628, 664, 134, 129, 127,
/* 250 */ 107, 660, 737, 639, 154, 549, 624, 614, 123, 157,
/* 260 */ 158, 721, 60, 41, 625, 160, 628, 664, 488, 29,
/* 270 */ 27, 107, 660, 737, 29, 27, 490, 410, 11, 546,
/* 280 */ 547, 410, 682, 11, 466, 65, 410, 412, 62, 460,
/* 290 */ 416, 412, 31, 725, 427, 121, 412, 31, 445, 621,
/* 300 */ 122, 1, 619, 114, 106, 704, 1, 57, 114, 64,
/* 310 */ 402, 723, 159, 167, 85, 5, 159, 47, 155, 685,
/* 320 */ 136, 159, 67, 411, 413, 416, 120, 411, 413, 416,
/* 330 */ 4, 51, 411, 413, 416, 485, 639, 69, 147, 624,
/* 340 */ 614, 420, 157, 158, 45, 139, 90, 625, 58, 628,
/* 350 */ 423, 29, 27, 147, 679, 29, 27, 46, 19, 32,
/* 360 */ 11, 16, 70, 410, 44, 646, 725, 410, 30, 28,
/* 370 */ 26, 25, 24, 412, 71, 671, 138, 412, 137, 740,
/* 380 */ 57, 725, 110, 1, 723, 114, 156, 7, 153, 114,
/* 390 */ 639, 419, 722, 624, 614, 57, 157, 158, 159, 723,
/* 400 */ 92, 625, 159, 628, 163, 77, 165, 191, 193, 411,
/* 410 */ 413, 416, 81, 411, 413, 416, 86, 83, 639, 3,
/* 420 */ 31, 624, 614, 98, 157, 158, 87, 14, 42, 625,
/* 430 */ 61, 628, 664, 135, 58, 508, 144, 660, 29, 27,
/* 440 */ 146, 29, 27, 63, 29, 27, 35, 510, 639, 50,
/* 450 */ 410, 624, 614, 410, 157, 158, 410, 66, 42, 625,
/* 460 */ 412, 628, 664, 412, 504, 36, 412, 661, 503, 21,
/* 470 */ 7, 130, 114, 1, 619, 114, 7, 37, 114, 30,
/* 480 */ 28, 26, 25, 24, 131, 159, 18, 15, 159, 482,
/* 490 */ 72, 159, 33, 481, 34, 8, 411, 413, 416, 411,
/* 500 */ 413, 416, 411, 413, 416, 639, 618, 56, 624, 614,
/* 510 */ 446, 157, 158, 428, 537, 49, 625, 12, 628, 38,
/* 520 */ 17, 532, 639, 531, 111, 624, 614, 536, 157, 158,
/* 530 */ 535, 112, 96, 625, 113, 628, 639, 79, 13, 624,
/* 540 */ 614, 608, 157, 158, 607, 414, 96, 625, 119, 628,
/* 550 */ 161, 572, 164, 403, 148, 738, 639, 166, 376, 624,
/* 560 */ 614, 115, 157, 158, 168, 171, 96, 625, 108, 628,
/* 570 */ 400, 639, 170, 397, 624, 614, 173, 157, 158, 174,
/* 580 */ 176, 49, 625, 639, 628, 179, 624, 614, 391, 157,
/* 590 */ 158, 177, 395, 91, 625, 389, 628, 639, 180, 394,
/* 600 */ 624, 614, 380, 157, 158, 407, 393, 93, 625, 186,
/* 610 */ 628, 406, 639, 405, 392, 624, 614, 39, 157, 158,
/* 620 */ 353, 739, 88, 625, 639, 628, 372, 624, 614, 192,
/* 630 */ 157, 158, 550, 371, 94, 625, 639, 628, 370, 624,
/* 640 */ 614, 365, 157, 158, 369, 368, 89, 625, 367, 628,
/* 650 */ 366, 364, 639, 550, 363, 624, 614, 550, 157, 158,
/* 660 */ 362, 361, 95, 625, 360, 628, 639, 359, 358, 624,
/* 670 */ 614, 357, 157, 158, 356, 550, 636, 625, 550, 628,
/* 680 */ 550, 639, 550, 550, 624, 614, 550, 157, 158, 550,
/* 690 */ 550, 635, 625, 639, 628, 550, 624, 614, 550, 157,
/* 700 */ 158, 550, 550, 634, 625, 639, 628, 550, 624, 614,
/* 710 */ 550, 157, 158, 550, 550, 103, 625, 639, 628, 550,
/* 720 */ 624, 614, 550, 157, 158, 550, 550, 102, 625, 550,
/* 730 */ 628, 639, 550, 550, 624, 614, 550, 157, 158, 550,
/* 740 */ 550, 104, 625, 639, 628, 139, 624, 614, 550, 157,
/* 750 */ 158, 139, 550, 101, 625, 639, 628, 46, 624, 614,
/* 760 */ 550, 157, 158, 46, 44, 97, 625, 514, 628, 550,
/* 770 */ 44, 550, 550, 550, 54, 671, 672, 550, 676, 550,
/* 780 */ 55, 671, 672, 550, 676, 550, 550, 30, 28, 26,
/* 790 */ 25, 24, 550, 124, 512, 513, 515, 516, 550, 550,
/* 800 */ 30, 28, 26, 25, 24, 550, 550, 550, 550, 550,
/* 810 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 820 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 830 */ 550, 550, 550, 430, 550, 550, 550, 550, 550, 550,
/* 840 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 850 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 860 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 870 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 880 */ 550, 550, 550, 550, 550, 550, 550, 550, 543, 544,
/* 0 */ 619, 617, 105, 188, 117, 728, 578, 48, 23, 75,
/* 10 */ 76, 642, 30, 28, 26, 25, 24, 158, 126, 727,
/* 20 */ 681, 100, 129, 726, 681, 30, 28, 26, 25, 24,
/* 30 */ 553, 620, 617, 642, 100, 68, 627, 617, 678, 158,
/* 40 */ 159, 499, 677, 42, 628, 432, 631, 667, 26, 25,
/* 50 */ 24, 666, 663, 211, 681, 210, 209, 208, 207, 206,
/* 60 */ 205, 204, 203, 202, 697, 201, 200, 199, 198, 197,
/* 70 */ 196, 195, 676, 423, 22, 109, 141, 450, 451, 452,
/* 80 */ 453, 454, 455, 456, 458, 459, 460, 22, 109, 134,
/* 90 */ 450, 451, 452, 453, 454, 455, 456, 458, 459, 460,
/* 100 */ 10, 10, 143, 143, 382, 186, 185, 184, 386, 183,
/* 110 */ 388, 389, 182, 391, 179, 118, 397, 176, 399, 400,
/* 120 */ 173, 170, 642, 575, 148, 627, 617, 84, 158, 159,
/* 130 */ 9, 8, 40, 628, 58, 631, 667, 6, 487, 80,
/* 140 */ 99, 663, 423, 642, 579, 48, 627, 617, 58, 144,
/* 150 */ 159, 82, 728, 41, 628, 190, 631, 667, 642, 20,
/* 160 */ 189, 107, 663, 52, 158, 115, 57, 643, 457, 133,
/* 170 */ 726, 461, 191, 642, 468, 74, 627, 617, 151, 144,
/* 180 */ 159, 119, 694, 41, 628, 491, 631, 667, 426, 58,
/* 190 */ 551, 107, 663, 52, 78, 642, 425, 426, 627, 617,
/* 200 */ 161, 158, 159, 155, 513, 41, 628, 43, 631, 667,
/* 210 */ 9, 8, 695, 107, 663, 740, 642, 2, 65, 627,
/* 220 */ 617, 62, 158, 159, 701, 152, 41, 628, 728, 631,
/* 230 */ 667, 135, 130, 128, 107, 663, 740, 642, 73, 59,
/* 240 */ 627, 617, 57, 158, 159, 724, 726, 41, 628, 698,
/* 250 */ 631, 667, 146, 29, 27, 107, 663, 740, 29, 27,
/* 260 */ 492, 686, 11, 487, 127, 412, 685, 11, 156, 462,
/* 270 */ 412, 708, 31, 429, 490, 414, 31, 548, 549, 624,
/* 280 */ 414, 60, 622, 403, 150, 1, 168, 114, 153, 124,
/* 290 */ 1, 642, 114, 148, 627, 617, 122, 158, 159, 418,
/* 300 */ 160, 90, 628, 85, 631, 160, 47, 447, 29, 27,
/* 310 */ 123, 707, 413, 415, 418, 29, 27, 413, 415, 418,
/* 320 */ 412, 728, 163, 162, 11, 64, 106, 412, 5, 137,
/* 330 */ 414, 688, 67, 58, 121, 57, 4, 414, 69, 726,
/* 340 */ 7, 51, 114, 422, 45, 487, 425, 1, 682, 114,
/* 350 */ 642, 32, 70, 627, 617, 160, 158, 159, 16, 649,
/* 360 */ 49, 628, 160, 631, 110, 743, 725, 413, 415, 418,
/* 370 */ 154, 157, 140, 77, 413, 415, 418, 421, 164, 642,
/* 380 */ 148, 166, 627, 617, 46, 158, 159, 194, 58, 42,
/* 390 */ 628, 44, 631, 667, 192, 29, 27, 145, 663, 149,
/* 400 */ 741, 71, 674, 139, 81, 138, 86, 412, 728, 83,
/* 410 */ 87, 29, 27, 147, 412, 98, 3, 414, 31, 14,
/* 420 */ 61, 510, 57, 412, 414, 63, 726, 1, 642, 114,
/* 430 */ 35, 627, 617, 414, 158, 159, 512, 50, 96, 628,
/* 440 */ 113, 631, 160, 7, 66, 114, 506, 505, 36, 160,
/* 450 */ 131, 37, 15, 132, 413, 415, 418, 622, 160, 18,
/* 460 */ 484, 413, 415, 418, 483, 34, 33, 72, 29, 27,
/* 470 */ 413, 415, 418, 8, 621, 642, 56, 534, 627, 617,
/* 480 */ 412, 158, 159, 430, 448, 42, 628, 539, 631, 667,
/* 490 */ 414, 17, 12, 38, 664, 30, 28, 26, 25, 24,
/* 500 */ 7, 533, 114, 111, 538, 537, 112, 642, 79, 13,
/* 510 */ 627, 617, 416, 158, 159, 160, 611, 96, 628, 120,
/* 520 */ 631, 610, 609, 574, 167, 396, 116, 413, 415, 418,
/* 530 */ 642, 377, 171, 627, 617, 165, 158, 159, 404, 169,
/* 540 */ 92, 628, 401, 631, 398, 642, 381, 172, 627, 617,
/* 550 */ 175, 158, 159, 178, 174, 96, 628, 108, 631, 642,
/* 560 */ 177, 180, 627, 617, 392, 158, 159, 408, 181, 49,
/* 570 */ 628, 642, 631, 136, 627, 617, 390, 158, 159, 395,
/* 580 */ 407, 91, 628, 187, 631, 406, 642, 394, 393, 627,
/* 590 */ 617, 39, 158, 159, 354, 193, 93, 628, 366, 631,
/* 600 */ 642, 373, 372, 627, 617, 371, 158, 159, 370, 742,
/* 610 */ 88, 628, 369, 631, 642, 552, 368, 627, 617, 367,
/* 620 */ 158, 159, 365, 364, 94, 628, 363, 631, 642, 552,
/* 630 */ 362, 627, 617, 361, 158, 159, 360, 359, 89, 628,
/* 640 */ 552, 631, 642, 552, 358, 627, 617, 357, 158, 159,
/* 650 */ 552, 552, 95, 628, 552, 631, 642, 552, 552, 627,
/* 660 */ 617, 552, 158, 159, 552, 552, 639, 628, 642, 631,
/* 670 */ 552, 627, 617, 552, 158, 159, 552, 552, 638, 628,
/* 680 */ 642, 631, 552, 627, 617, 552, 158, 159, 552, 552,
/* 690 */ 637, 628, 552, 631, 642, 552, 552, 627, 617, 552,
/* 700 */ 158, 159, 552, 552, 103, 628, 642, 631, 552, 627,
/* 710 */ 617, 552, 158, 159, 552, 552, 102, 628, 642, 631,
/* 720 */ 552, 627, 617, 552, 158, 159, 552, 552, 104, 628,
/* 730 */ 552, 631, 642, 552, 552, 627, 617, 552, 158, 159,
/* 740 */ 552, 552, 101, 628, 552, 631, 642, 552, 516, 627,
/* 750 */ 617, 19, 158, 159, 140, 552, 97, 628, 552, 631,
/* 760 */ 140, 30, 28, 26, 25, 24, 46, 30, 28, 26,
/* 770 */ 25, 24, 46, 44, 125, 514, 515, 517, 518, 44,
/* 780 */ 552, 552, 142, 53, 674, 675, 552, 679, 140, 54,
/* 790 */ 674, 675, 21, 679, 552, 30, 28, 26, 25, 24,
/* 800 */ 46, 552, 30, 28, 26, 25, 24, 44, 552, 552,
/* 810 */ 552, 552, 552, 552, 552, 552, 552, 55, 674, 675,
/* 820 */ 552, 679, 552, 552, 552, 552, 552, 552, 432, 552,
/* 830 */ 552, 552, 552, 552, 552, 552, 552, 552, 552, 552,
/* 840 */ 552, 552, 552, 552, 552, 552, 552, 552, 552, 552,
/* 850 */ 552, 552, 552, 552, 552, 552, 552, 552, 552, 552,
/* 860 */ 552, 552, 552, 552, 552, 552, 552, 552, 552, 545,
/* 870 */ 546,
};
static const YYCODETYPE yy_lookahead[] = {
/* 0 */ 129, 130, 131, 127, 123, 156, 125, 126, 141, 142,
/* 10 */ 177, 126, 12, 13, 14, 15, 16, 132, 168, 170,
/* 20 */ 134, 21, 137, 174, 134, 12, 13, 14, 15, 16,
/* 30 */ 0, 129, 130, 126, 21, 161, 129, 130, 152, 132,
/* 40 */ 133, 135, 152, 136, 137, 45, 139, 140, 14, 15,
/* 50 */ 16, 144, 145, 23, 134, 25, 26, 27, 28, 29,
/* 60 */ 30, 31, 32, 33, 3, 35, 36, 37, 38, 39,
/* 70 */ 40, 41, 152, 73, 74, 48, 76, 77, 78, 79,
/* 80 */ 80, 81, 82, 83, 84, 85, 73, 74, 154, 76,
/* 90 */ 77, 78, 79, 80, 81, 82, 83, 84, 85, 12,
/* 100 */ 13, 14, 15, 16, 50, 51, 52, 53, 54, 55,
/* 0 */ 130, 131, 132, 128, 124, 157, 126, 127, 142, 143,
/* 10 */ 178, 127, 12, 13, 14, 15, 16, 133, 169, 171,
/* 20 */ 135, 21, 138, 175, 135, 12, 13, 14, 15, 16,
/* 30 */ 0, 130, 131, 127, 21, 162, 130, 131, 153, 133,
/* 40 */ 134, 14, 153, 137, 138, 45, 140, 141, 14, 15,
/* 50 */ 16, 145, 146, 23, 135, 25, 26, 27, 28, 29,
/* 60 */ 30, 31, 32, 33, 136, 35, 36, 37, 38, 39,
/* 70 */ 40, 41, 153, 46, 74, 75, 155, 77, 78, 79,
/* 80 */ 80, 81, 82, 83, 84, 85, 86, 74, 75, 46,
/* 90 */ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
/* 100 */ 44, 44, 46, 46, 50, 51, 52, 53, 54, 55,
/* 110 */ 56, 57, 58, 59, 60, 18, 62, 63, 64, 65,
/* 120 */ 66, 67, 126, 0, 128, 129, 130, 46, 132, 133,
/* 130 */ 125, 126, 136, 137, 19, 139, 140, 110, 46, 42,
/* 140 */ 144, 145, 44, 126, 46, 14, 129, 130, 46, 132,
/* 150 */ 133, 46, 156, 136, 137, 32, 139, 140, 43, 73,
/* 160 */ 37, 144, 145, 146, 91, 68, 170, 126, 82, 108,
/* 170 */ 174, 85, 49, 132, 44, 158, 46, 46, 137, 87,
/* 180 */ 4, 164, 165, 126, 89, 90, 129, 130, 91, 132,
/* 190 */ 133, 126, 87, 136, 137, 171, 139, 140, 120, 1,
/* 200 */ 2, 144, 145, 146, 88, 126, 90, 157, 129, 130,
/* 210 */ 132, 132, 133, 46, 100, 136, 137, 139, 139, 140,
/* 220 */ 135, 91, 165, 144, 145, 146, 148, 149, 150, 151,
/* 230 */ 45, 153, 126, 48, 155, 129, 130, 167, 132, 133,
/* 240 */ 1, 2, 136, 137, 21, 139, 140, 96, 97, 98,
/* 250 */ 144, 145, 146, 126, 48, 118, 129, 130, 99, 132,
/* 260 */ 133, 155, 166, 136, 137, 128, 139, 140, 92, 12,
/* 270 */ 13, 144, 145, 146, 12, 13, 14, 24, 21, 116,
/* 280 */ 117, 24, 155, 21, 45, 45, 24, 34, 48, 45,
/* 290 */ 72, 34, 48, 156, 45, 130, 34, 48, 75, 44,
/* 300 */ 130, 44, 47, 46, 130, 167, 44, 170, 46, 166,
/* 310 */ 45, 174, 59, 48, 45, 107, 59, 48, 112, 163,
/* 320 */ 106, 59, 162, 70, 71, 72, 94, 70, 71, 72,
/* 330 */ 93, 160, 70, 71, 72, 90, 126, 159, 128, 129,
/* 340 */ 130, 46, 132, 133, 132, 120, 136, 137, 91, 139,
/* 350 */ 46, 12, 13, 128, 134, 12, 13, 132, 2, 86,
/* 360 */ 21, 44, 147, 24, 139, 143, 156, 24, 12, 13,
/* 370 */ 14, 15, 16, 34, 149, 150, 151, 34, 153, 178,
/* 380 */ 170, 156, 115, 44, 174, 46, 111, 44, 109, 46,
/* 390 */ 126, 46, 173, 129, 130, 170, 132, 133, 59, 174,
/* 400 */ 136, 137, 59, 139, 120, 172, 46, 122, 20, 70,
/* 410 */ 71, 72, 119, 70, 71, 72, 120, 119, 126, 48,
/* 420 */ 48, 129, 130, 124, 132, 133, 121, 95, 136, 137,
/* 430 */ 45, 139, 140, 169, 91, 45, 144, 145, 12, 13,
/* 440 */ 14, 12, 13, 44, 12, 13, 48, 45, 126, 44,
/* 450 */ 24, 129, 130, 24, 132, 133, 24, 44, 136, 137,
/* 460 */ 34, 139, 140, 34, 45, 44, 34, 145, 45, 2,
/* 470 */ 44, 24, 46, 44, 47, 46, 44, 44, 46, 12,
/* 480 */ 13, 14, 15, 16, 48, 59, 48, 95, 59, 45,
/* 490 */ 47, 59, 88, 45, 48, 2, 70, 71, 72, 70,
/* 500 */ 71, 72, 70, 71, 72, 126, 47, 47, 129, 130,
/* 510 */ 75, 132, 133, 45, 45, 136, 137, 95, 139, 4,
/* 520 */ 48, 24, 126, 24, 24, 129, 130, 24, 132, 133,
/* 530 */ 24, 24, 136, 137, 138, 139, 126, 47, 44, 129,
/* 540 */ 130, 0, 132, 133, 0, 34, 136, 137, 138, 139,
/* 550 */ 69, 0, 47, 45, 175, 176, 126, 24, 46, 129,
/* 560 */ 130, 24, 132, 133, 44, 44, 136, 137, 138, 139,
/* 570 */ 45, 126, 24, 45, 129, 130, 24, 132, 133, 44,
/* 580 */ 24, 136, 137, 126, 139, 24, 129, 130, 45, 132,
/* 590 */ 133, 44, 61, 136, 137, 45, 139, 126, 44, 61,
/* 600 */ 129, 130, 34, 132, 133, 24, 61, 136, 137, 49,
/* 610 */ 139, 24, 126, 24, 61, 129, 130, 44, 132, 133,
/* 620 */ 22, 176, 136, 137, 126, 139, 24, 129, 130, 21,
/* 630 */ 132, 133, 179, 24, 136, 137, 126, 139, 24, 129,
/* 640 */ 130, 34, 132, 133, 24, 24, 136, 137, 24, 139,
/* 650 */ 24, 24, 126, 179, 24, 129, 130, 179, 132, 133,
/* 660 */ 24, 24, 136, 137, 24, 139, 126, 24, 24, 129,
/* 670 */ 130, 24, 132, 133, 24, 179, 136, 137, 179, 139,
/* 680 */ 179, 126, 179, 179, 129, 130, 179, 132, 133, 179,
/* 690 */ 179, 136, 137, 126, 139, 179, 129, 130, 179, 132,
/* 700 */ 133, 179, 179, 136, 137, 126, 139, 179, 129, 130,
/* 710 */ 179, 132, 133, 179, 179, 136, 137, 126, 139, 179,
/* 720 */ 129, 130, 179, 132, 133, 179, 179, 136, 137, 179,
/* 730 */ 139, 126, 179, 179, 129, 130, 179, 132, 133, 179,
/* 740 */ 179, 136, 137, 126, 139, 120, 129, 130, 179, 132,
/* 750 */ 133, 120, 179, 136, 137, 126, 139, 132, 129, 130,
/* 760 */ 179, 132, 133, 132, 139, 136, 137, 75, 139, 179,
/* 770 */ 139, 179, 179, 179, 149, 150, 151, 179, 153, 179,
/* 780 */ 149, 150, 151, 179, 153, 179, 179, 12, 13, 14,
/* 790 */ 15, 16, 179, 101, 102, 103, 104, 105, 179, 179,
/* 800 */ 12, 13, 14, 15, 16, 179, 179, 179, 179, 179,
/* 810 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 820 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 830 */ 179, 179, 179, 45, 179, 179, 179, 179, 179, 179,
/* 840 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 850 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 860 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 870 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 880 */ 179, 179, 179, 179, 179, 179, 179, 179, 113, 114,
/* 890 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 900 */ 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 910 */ 179, 179, 179, 179, 179, 179, 179, 179, 179,
/* 120 */ 66, 67, 127, 0, 129, 130, 131, 19, 133, 134,
/* 130 */ 1, 2, 137, 138, 92, 140, 141, 90, 91, 42,
/* 140 */ 145, 146, 46, 127, 126, 127, 130, 131, 92, 133,
/* 150 */ 134, 43, 157, 137, 138, 32, 140, 141, 127, 74,
/* 160 */ 37, 145, 146, 147, 133, 68, 171, 127, 83, 138,
/* 170 */ 175, 86, 49, 127, 45, 159, 130, 131, 3, 133,
/* 180 */ 134, 165, 166, 137, 138, 4, 140, 141, 46, 92,
/* 190 */ 119, 145, 146, 147, 172, 127, 46, 46, 130, 131,
/* 200 */ 129, 133, 134, 48, 45, 137, 138, 48, 140, 141,
/* 210 */ 1, 2, 166, 145, 146, 147, 127, 158, 45, 130,
/* 220 */ 131, 48, 133, 134, 156, 48, 137, 138, 157, 140,
/* 230 */ 141, 97, 98, 99, 145, 146, 147, 127, 88, 88,
/* 240 */ 130, 131, 171, 133, 134, 156, 175, 137, 138, 136,
/* 250 */ 140, 141, 21, 12, 13, 145, 146, 147, 12, 13,
/* 260 */ 14, 89, 21, 91, 101, 24, 156, 21, 113, 45,
/* 270 */ 24, 168, 48, 45, 93, 34, 48, 117, 118, 44,
/* 280 */ 34, 167, 47, 45, 109, 44, 48, 46, 111, 100,
/* 290 */ 44, 127, 46, 129, 130, 131, 131, 133, 134, 73,
/* 300 */ 59, 137, 138, 45, 140, 59, 48, 76, 12, 13,
/* 310 */ 131, 168, 71, 72, 73, 12, 13, 71, 72, 73,
/* 320 */ 24, 157, 69, 70, 21, 167, 131, 24, 108, 107,
/* 330 */ 34, 164, 163, 92, 95, 171, 94, 34, 160, 175,
/* 340 */ 44, 161, 46, 46, 133, 91, 46, 44, 135, 46,
/* 350 */ 127, 87, 148, 130, 131, 59, 133, 134, 44, 144,
/* 360 */ 137, 138, 59, 140, 116, 179, 174, 71, 72, 73,
/* 370 */ 110, 112, 121, 173, 71, 72, 73, 46, 121, 127,
/* 380 */ 129, 46, 130, 131, 133, 133, 134, 20, 92, 137,
/* 390 */ 138, 140, 140, 141, 123, 12, 13, 145, 146, 176,
/* 400 */ 177, 150, 151, 152, 120, 154, 121, 24, 157, 120,
/* 410 */ 122, 12, 13, 14, 24, 125, 48, 34, 48, 96,
/* 420 */ 45, 45, 171, 24, 34, 44, 175, 44, 127, 46,
/* 430 */ 48, 130, 131, 34, 133, 134, 45, 44, 137, 138,
/* 440 */ 139, 140, 59, 44, 44, 46, 45, 45, 44, 59,
/* 450 */ 24, 44, 96, 48, 71, 72, 73, 47, 59, 48,
/* 460 */ 45, 71, 72, 73, 45, 48, 89, 47, 12, 13,
/* 470 */ 71, 72, 73, 2, 47, 127, 47, 24, 130, 131,
/* 480 */ 24, 133, 134, 45, 76, 137, 138, 45, 140, 141,
/* 490 */ 34, 48, 96, 4, 146, 12, 13, 14, 15, 16,
/* 500 */ 44, 24, 46, 24, 24, 24, 24, 127, 47, 44,
/* 510 */ 130, 131, 34, 133, 134, 59, 0, 137, 138, 139,
/* 520 */ 140, 0, 0, 0, 24, 61, 24, 71, 72, 73,
/* 530 */ 127, 46, 24, 130, 131, 47, 133, 134, 45, 44,
/* 540 */ 137, 138, 45, 140, 45, 127, 34, 44, 130, 131,
/* 550 */ 44, 133, 134, 44, 24, 137, 138, 139, 140, 127,
/* 560 */ 24, 24, 130, 131, 45, 133, 134, 24, 44, 137,
/* 570 */ 138, 127, 140, 170, 130, 131, 45, 133, 134, 61,
/* 580 */ 24, 137, 138, 49, 140, 24, 127, 61, 61, 130,
/* 590 */ 131, 44, 133, 134, 22, 21, 137, 138, 34, 140,
/* 600 */ 127, 24, 24, 130, 131, 24, 133, 134, 24, 177,
/* 610 */ 137, 138, 24, 140, 127, 180, 24, 130, 131, 24,
/* 620 */ 133, 134, 24, 24, 137, 138, 24, 140, 127, 180,
/* 630 */ 24, 130, 131, 24, 133, 134, 24, 24, 137, 138,
/* 640 */ 180, 140, 127, 180, 24, 130, 131, 24, 133, 134,
/* 650 */ 180, 180, 137, 138, 180, 140, 127, 180, 180, 130,
/* 660 */ 131, 180, 133, 134, 180, 180, 137, 138, 127, 140,
/* 670 */ 180, 130, 131, 180, 133, 134, 180, 180, 137, 138,
/* 680 */ 127, 140, 180, 130, 131, 180, 133, 134, 180, 180,
/* 690 */ 137, 138, 180, 140, 127, 180, 180, 130, 131, 180,
/* 700 */ 133, 134, 180, 180, 137, 138, 127, 140, 180, 130,
/* 710 */ 131, 180, 133, 134, 180, 180, 137, 138, 127, 140,
/* 720 */ 180, 130, 131, 180, 133, 134, 180, 180, 137, 138,
/* 730 */ 180, 140, 127, 180, 180, 130, 131, 180, 133, 134,
/* 740 */ 180, 180, 137, 138, 180, 140, 127, 180, 76, 130,
/* 750 */ 131, 2, 133, 134, 121, 180, 137, 138, 180, 140,
/* 760 */ 121, 12, 13, 14, 15, 16, 133, 12, 13, 14,
/* 770 */ 15, 16, 133, 140, 102, 103, 104, 105, 106, 140,
/* 780 */ 180, 180, 149, 150, 151, 152, 180, 154, 121, 150,
/* 790 */ 151, 152, 2, 154, 180, 12, 13, 14, 15, 16,
/* 800 */ 133, 180, 12, 13, 14, 15, 16, 140, 180, 180,
/* 810 */ 180, 180, 180, 180, 180, 180, 180, 150, 151, 152,
/* 820 */ 180, 154, 180, 180, 180, 180, 180, 180, 45, 180,
/* 830 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 840 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 850 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 860 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 114,
/* 870 */ 115, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 880 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 890 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 900 */ 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
/* 910 */ 180, 180, 180, 180, 180,
};
#define YY_SHIFT_COUNT (210)
#define YY_SHIFT_COUNT (211)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (788)
#define YY_SHIFT_MAX (790)
static const unsigned short int yy_shift_ofst[] = {
/* 0 */ 97, 257, 262, 339, 339, 339, 339, 343, 339, 339,
/* 10 */ 130, 429, 432, 426, 432, 432, 432, 432, 432, 432,
/* 20 */ 432, 432, 432, 432, 432, 432, 432, 432, 432, 432,
/* 30 */ 432, 432, 98, 98, 98, 253, 81, 81, 73, 102,
/* 40 */ 0, 13, 13, 253, 92, 92, 92, 102, 54, 775,
/* 50 */ 692, 151, 105, 116, 95, 116, 131, 61, 176, 167,
/* 60 */ 114, 159, 218, 218, 114, 159, 218, 208, 214, 232,
/* 70 */ 237, 245, 295, 304, 273, 317, 267, 275, 279, 102,
/* 80 */ 345, 360, 388, 345, 388, 890, 890, 30, 356, 467,
/* 90 */ 788, 87, 87, 87, 87, 87, 87, 87, 123, 239,
/* 100 */ 86, 34, 34, 34, 34, 185, 240, 198, 244, 223,
/* 110 */ 163, 27, 206, 249, 255, 265, 269, 115, 371, 372,
/* 120 */ 332, 385, 390, 399, 398, 402, 405, 413, 419, 421,
/* 130 */ 423, 447, 436, 427, 433, 438, 392, 444, 448, 443,
/* 140 */ 404, 446, 459, 460, 493, 435, 468, 469, 472, 422,
/* 150 */ 515, 497, 499, 500, 503, 506, 507, 490, 494, 511,
/* 160 */ 541, 544, 481, 551, 512, 505, 508, 533, 537, 520,
/* 170 */ 525, 548, 521, 528, 552, 535, 543, 556, 547, 550,
/* 180 */ 561, 554, 531, 538, 545, 553, 568, 560, 581, 587,
/* 190 */ 589, 573, 598, 608, 602, 609, 614, 620, 621, 624,
/* 200 */ 626, 607, 627, 630, 636, 637, 640, 643, 644, 647,
/* 210 */ 650,
/* 0 */ 97, 241, 246, 303, 303, 303, 303, 296, 303, 303,
/* 10 */ 56, 383, 456, 399, 456, 456, 456, 456, 456, 456,
/* 20 */ 456, 456, 456, 456, 456, 456, 456, 456, 456, 456,
/* 30 */ 456, 456, 57, 57, 57, 390, 43, 43, 42, 96,
/* 40 */ 0, 13, 13, 390, 150, 150, 150, 96, 54, 755,
/* 50 */ 672, 134, 151, 172, 47, 172, 27, 175, 181, 142,
/* 60 */ 163, 189, 226, 226, 163, 189, 226, 220, 222, 239,
/* 70 */ 242, 254, 297, 300, 264, 314, 248, 259, 260, 96,
/* 80 */ 331, 335, 367, 331, 367, 871, 871, 30, 749, 790,
/* 90 */ 783, 483, 483, 483, 483, 483, 483, 483, 123, 129,
/* 100 */ 85, 34, 34, 34, 34, 159, 173, 209, 224, 231,
/* 110 */ 160, 177, 155, 228, 235, 253, 238, 258, 108, 368,
/* 120 */ 370, 323, 375, 376, 381, 382, 391, 393, 400, 401,
/* 130 */ 404, 402, 426, 405, 410, 407, 411, 356, 415, 419,
/* 140 */ 420, 377, 417, 427, 429, 471, 408, 438, 442, 443,
/* 150 */ 396, 489, 453, 477, 479, 480, 481, 482, 461, 465,
/* 160 */ 478, 516, 521, 522, 523, 485, 488, 493, 500, 502,
/* 170 */ 495, 497, 508, 503, 499, 530, 506, 519, 536, 509,
/* 180 */ 531, 537, 524, 464, 518, 526, 527, 512, 534, 543,
/* 190 */ 556, 561, 547, 572, 574, 577, 578, 581, 584, 588,
/* 200 */ 592, 595, 564, 598, 599, 602, 606, 609, 612, 613,
/* 210 */ 620, 623,
};
#define YY_REDUCE_COUNT (86)
#define YY_REDUCE_MIN (-167)
#define YY_REDUCE_MAX (631)
#define YY_REDUCE_MIN (-168)
#define YY_REDUCE_MAX (667)
static const short yy_reduce_ofst[] = {
/* 0 */ 137, -4, 17, 57, 79, 106, 127, 210, -93, 292,
/* 10 */ 225, 322, 379, 396, 410, 264, 430, 445, 457, 471,
/* 20 */ 486, 498, 510, 526, 540, 555, 567, 579, 591, 605,
/* 30 */ 617, 629, 78, 625, 631, -129, -115, 41, -151, -119,
/* 40 */ -133, -133, -133, -98, -114, -110, -80, 5, -124, -167,
/* 50 */ -150, -126, -94, -66, -66, -66, 65, 24, 50, 85,
/* 60 */ 70, 96, 165, 170, 138, 143, 174, 156, 160, 171,
/* 70 */ 178, -66, 212, 220, 215, 222, 201, 219, 233, 65,
/* 80 */ 284, 285, 293, 296, 298, 299, 305,
/* 0 */ 71, -5, 16, 46, 68, 89, 110, 164, -94, 252,
/* 10 */ 251, 348, 223, 301, 380, 403, 418, 432, 444, 459,
/* 20 */ 473, 487, 501, 515, 529, 541, 553, 567, 579, 591,
/* 30 */ 605, 619, 633, 639, 667, -130, -116, 31, -152, -120,
/* 40 */ -134, -134, -134, -99, -115, -111, -81, 18, -125, -168,
/* 50 */ -151, -127, -72, -79, -79, -79, 40, 22, 59, 113,
/* 60 */ 103, 114, 165, 179, 143, 158, 195, 167, 169, 180,
/* 70 */ 178, -79, 211, 213, 204, 215, 186, 192, 200, 40,
/* 80 */ 257, 271, 284, 285, 289, 290, 288,
};
static const YYACTIONTYPE yy_default[] = {
/* 0 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 10 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 20 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 30 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 40 */ 548, 666, 548, 548, 677, 677, 677, 548, 548, 741,
/* 50 */ 548, 701, 693, 669, 683, 670, 548, 726, 686, 548,
/* 60 */ 708, 706, 548, 548, 708, 706, 548, 720, 716, 699,
/* 70 */ 697, 683, 548, 548, 548, 548, 744, 732, 728, 548,
/* 80 */ 548, 548, 553, 548, 553, 603, 554, 548, 548, 548,
/* 90 */ 548, 719, 718, 643, 642, 641, 637, 638, 548, 548,
/* 100 */ 548, 632, 633, 631, 630, 548, 548, 667, 548, 548,
/* 110 */ 548, 729, 733, 548, 620, 548, 548, 548, 690, 700,
/* 120 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 130 */ 548, 548, 548, 620, 548, 717, 548, 676, 672, 548,
/* 140 */ 548, 668, 619, 548, 662, 548, 548, 548, 727, 548,
/* 150 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 160 */ 548, 548, 548, 548, 548, 574, 548, 548, 548, 600,
/* 170 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 180 */ 548, 548, 585, 583, 582, 581, 548, 578, 548, 548,
/* 190 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 200 */ 548, 548, 548, 548, 548, 548, 548, 548, 548, 548,
/* 210 */ 548,
/* 0 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 10 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 20 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 30 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 40 */ 550, 669, 550, 550, 680, 680, 680, 550, 550, 744,
/* 50 */ 550, 704, 696, 672, 686, 673, 550, 729, 689, 550,
/* 60 */ 711, 709, 550, 550, 711, 709, 550, 723, 719, 702,
/* 70 */ 700, 686, 550, 550, 550, 550, 747, 735, 731, 550,
/* 80 */ 550, 550, 555, 550, 555, 605, 556, 550, 550, 550,
/* 90 */ 550, 722, 721, 646, 645, 644, 640, 641, 550, 550,
/* 100 */ 550, 635, 636, 634, 633, 550, 550, 670, 550, 550,
/* 110 */ 550, 732, 736, 550, 623, 550, 550, 550, 550, 693,
/* 120 */ 703, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 130 */ 550, 550, 550, 550, 623, 550, 720, 550, 679, 675,
/* 140 */ 550, 550, 671, 622, 550, 665, 550, 550, 550, 730,
/* 150 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 160 */ 550, 550, 550, 550, 550, 550, 576, 550, 550, 550,
/* 170 */ 602, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 180 */ 550, 550, 550, 587, 585, 584, 583, 550, 580, 550,
/* 190 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 200 */ 550, 550, 550, 550, 550, 550, 550, 550, 550, 550,
/* 210 */ 550, 550,
};
/********** End of lemon-generated parsing tables *****************************/
......@@ -645,115 +644,116 @@ static const char *const yyTokenName[] = {
/* 67 */ "DECIMAL",
/* 68 */ "SHOW",
/* 69 */ "DATABASES",
/* 70 */ "NK_FLOAT",
/* 71 */ "NK_BOOL",
/* 72 */ "NK_VARIABLE",
/* 73 */ "BETWEEN",
/* 74 */ "IS",
/* 75 */ "NULL",
/* 76 */ "NK_LT",
/* 77 */ "NK_GT",
/* 78 */ "NK_LE",
/* 79 */ "NK_GE",
/* 80 */ "NK_NE",
/* 81 */ "NK_EQ",
/* 82 */ "LIKE",
/* 83 */ "MATCH",
/* 84 */ "NMATCH",
/* 85 */ "IN",
/* 86 */ "FROM",
/* 87 */ "AS",
/* 88 */ "JOIN",
/* 89 */ "ON",
/* 90 */ "INNER",
/* 91 */ "SELECT",
/* 92 */ "DISTINCT",
/* 93 */ "WHERE",
/* 94 */ "PARTITION",
/* 95 */ "BY",
/* 96 */ "SESSION",
/* 97 */ "STATE_WINDOW",
/* 98 */ "INTERVAL",
/* 99 */ "SLIDING",
/* 100 */ "FILL",
/* 101 */ "VALUE",
/* 102 */ "NONE",
/* 103 */ "PREV",
/* 104 */ "LINEAR",
/* 105 */ "NEXT",
/* 106 */ "GROUP",
/* 107 */ "HAVING",
/* 108 */ "ORDER",
/* 109 */ "SLIMIT",
/* 110 */ "SOFFSET",
/* 111 */ "LIMIT",
/* 112 */ "OFFSET",
/* 113 */ "ASC",
/* 114 */ "DESC",
/* 115 */ "NULLS",
/* 116 */ "FIRST",
/* 117 */ "LAST",
/* 118 */ "cmd",
/* 119 */ "exists_opt",
/* 120 */ "db_name",
/* 121 */ "db_options",
/* 122 */ "full_table_name",
/* 123 */ "column_def_list",
/* 124 */ "table_options",
/* 125 */ "column_def",
/* 126 */ "column_name",
/* 127 */ "type_name",
/* 128 */ "query_expression",
/* 129 */ "literal",
/* 130 */ "duration_literal",
/* 131 */ "literal_list",
/* 132 */ "table_name",
/* 133 */ "function_name",
/* 134 */ "table_alias",
/* 135 */ "column_alias",
/* 136 */ "expression",
/* 137 */ "column_reference",
/* 138 */ "expression_list",
/* 139 */ "subquery",
/* 140 */ "predicate",
/* 141 */ "compare_op",
/* 142 */ "in_op",
/* 143 */ "in_predicate_value",
/* 144 */ "boolean_value_expression",
/* 145 */ "boolean_primary",
/* 146 */ "common_expression",
/* 147 */ "from_clause",
/* 148 */ "table_reference_list",
/* 149 */ "table_reference",
/* 150 */ "table_primary",
/* 151 */ "joined_table",
/* 152 */ "alias_opt",
/* 153 */ "parenthesized_joined_table",
/* 154 */ "join_type",
/* 155 */ "search_condition",
/* 156 */ "query_specification",
/* 157 */ "set_quantifier_opt",
/* 158 */ "select_list",
/* 159 */ "where_clause_opt",
/* 160 */ "partition_by_clause_opt",
/* 161 */ "twindow_clause_opt",
/* 162 */ "group_by_clause_opt",
/* 163 */ "having_clause_opt",
/* 164 */ "select_sublist",
/* 165 */ "select_item",
/* 166 */ "sliding_opt",
/* 167 */ "fill_opt",
/* 168 */ "fill_mode",
/* 169 */ "group_by_list",
/* 170 */ "query_expression_body",
/* 171 */ "order_by_clause_opt",
/* 172 */ "slimit_clause_opt",
/* 173 */ "limit_clause_opt",
/* 174 */ "query_primary",
/* 175 */ "sort_specification_list",
/* 176 */ "sort_specification",
/* 177 */ "ordering_specification_opt",
/* 178 */ "null_ordering_opt",
/* 70 */ "TABLES",
/* 71 */ "NK_FLOAT",
/* 72 */ "NK_BOOL",
/* 73 */ "NK_VARIABLE",
/* 74 */ "BETWEEN",
/* 75 */ "IS",
/* 76 */ "NULL",
/* 77 */ "NK_LT",
/* 78 */ "NK_GT",
/* 79 */ "NK_LE",
/* 80 */ "NK_GE",
/* 81 */ "NK_NE",
/* 82 */ "NK_EQ",
/* 83 */ "LIKE",
/* 84 */ "MATCH",
/* 85 */ "NMATCH",
/* 86 */ "IN",
/* 87 */ "FROM",
/* 88 */ "AS",
/* 89 */ "JOIN",
/* 90 */ "ON",
/* 91 */ "INNER",
/* 92 */ "SELECT",
/* 93 */ "DISTINCT",
/* 94 */ "WHERE",
/* 95 */ "PARTITION",
/* 96 */ "BY",
/* 97 */ "SESSION",
/* 98 */ "STATE_WINDOW",
/* 99 */ "INTERVAL",
/* 100 */ "SLIDING",
/* 101 */ "FILL",
/* 102 */ "VALUE",
/* 103 */ "NONE",
/* 104 */ "PREV",
/* 105 */ "LINEAR",
/* 106 */ "NEXT",
/* 107 */ "GROUP",
/* 108 */ "HAVING",
/* 109 */ "ORDER",
/* 110 */ "SLIMIT",
/* 111 */ "SOFFSET",
/* 112 */ "LIMIT",
/* 113 */ "OFFSET",
/* 114 */ "ASC",
/* 115 */ "DESC",
/* 116 */ "NULLS",
/* 117 */ "FIRST",
/* 118 */ "LAST",
/* 119 */ "cmd",
/* 120 */ "exists_opt",
/* 121 */ "db_name",
/* 122 */ "db_options",
/* 123 */ "full_table_name",
/* 124 */ "column_def_list",
/* 125 */ "table_options",
/* 126 */ "column_def",
/* 127 */ "column_name",
/* 128 */ "type_name",
/* 129 */ "query_expression",
/* 130 */ "literal",
/* 131 */ "duration_literal",
/* 132 */ "literal_list",
/* 133 */ "table_name",
/* 134 */ "function_name",
/* 135 */ "table_alias",
/* 136 */ "column_alias",
/* 137 */ "expression",
/* 138 */ "column_reference",
/* 139 */ "expression_list",
/* 140 */ "subquery",
/* 141 */ "predicate",
/* 142 */ "compare_op",
/* 143 */ "in_op",
/* 144 */ "in_predicate_value",
/* 145 */ "boolean_value_expression",
/* 146 */ "boolean_primary",
/* 147 */ "common_expression",
/* 148 */ "from_clause",
/* 149 */ "table_reference_list",
/* 150 */ "table_reference",
/* 151 */ "table_primary",
/* 152 */ "joined_table",
/* 153 */ "alias_opt",
/* 154 */ "parenthesized_joined_table",
/* 155 */ "join_type",
/* 156 */ "search_condition",
/* 157 */ "query_specification",
/* 158 */ "set_quantifier_opt",
/* 159 */ "select_list",
/* 160 */ "where_clause_opt",
/* 161 */ "partition_by_clause_opt",
/* 162 */ "twindow_clause_opt",
/* 163 */ "group_by_clause_opt",
/* 164 */ "having_clause_opt",
/* 165 */ "select_sublist",
/* 166 */ "select_item",
/* 167 */ "sliding_opt",
/* 168 */ "fill_opt",
/* 169 */ "fill_mode",
/* 170 */ "group_by_list",
/* 171 */ "query_expression_body",
/* 172 */ "order_by_clause_opt",
/* 173 */ "slimit_clause_opt",
/* 174 */ "limit_clause_opt",
/* 175 */ "query_primary",
/* 176 */ "sort_specification_list",
/* 177 */ "sort_specification",
/* 178 */ "ordering_specification_opt",
/* 179 */ "null_ordering_opt",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
......@@ -818,145 +818,146 @@ static const char *const yyRuleName[] = {
/* 54 */ "table_options ::= table_options KEEP NK_INTEGER",
/* 55 */ "table_options ::= table_options TTL NK_INTEGER",
/* 56 */ "cmd ::= SHOW DATABASES",
/* 57 */ "cmd ::= query_expression",
/* 58 */ "literal ::= NK_INTEGER",
/* 59 */ "literal ::= NK_FLOAT",
/* 60 */ "literal ::= NK_STRING",
/* 61 */ "literal ::= NK_BOOL",
/* 62 */ "literal ::= TIMESTAMP NK_STRING",
/* 63 */ "literal ::= duration_literal",
/* 64 */ "duration_literal ::= NK_VARIABLE",
/* 65 */ "literal_list ::= literal",
/* 66 */ "literal_list ::= literal_list NK_COMMA literal",
/* 67 */ "db_name ::= NK_ID",
/* 68 */ "table_name ::= NK_ID",
/* 69 */ "column_name ::= NK_ID",
/* 70 */ "function_name ::= NK_ID",
/* 71 */ "table_alias ::= NK_ID",
/* 72 */ "column_alias ::= NK_ID",
/* 73 */ "expression ::= literal",
/* 74 */ "expression ::= column_reference",
/* 75 */ "expression ::= function_name NK_LP expression_list NK_RP",
/* 76 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
/* 77 */ "expression ::= subquery",
/* 78 */ "expression ::= NK_LP expression NK_RP",
/* 79 */ "expression ::= NK_PLUS expression",
/* 80 */ "expression ::= NK_MINUS expression",
/* 81 */ "expression ::= expression NK_PLUS expression",
/* 82 */ "expression ::= expression NK_MINUS expression",
/* 83 */ "expression ::= expression NK_STAR expression",
/* 84 */ "expression ::= expression NK_SLASH expression",
/* 85 */ "expression ::= expression NK_REM expression",
/* 86 */ "expression_list ::= expression",
/* 87 */ "expression_list ::= expression_list NK_COMMA expression",
/* 88 */ "column_reference ::= column_name",
/* 89 */ "column_reference ::= table_name NK_DOT column_name",
/* 90 */ "predicate ::= expression compare_op expression",
/* 91 */ "predicate ::= expression BETWEEN expression AND expression",
/* 92 */ "predicate ::= expression NOT BETWEEN expression AND expression",
/* 93 */ "predicate ::= expression IS NULL",
/* 94 */ "predicate ::= expression IS NOT NULL",
/* 95 */ "predicate ::= expression in_op in_predicate_value",
/* 96 */ "compare_op ::= NK_LT",
/* 97 */ "compare_op ::= NK_GT",
/* 98 */ "compare_op ::= NK_LE",
/* 99 */ "compare_op ::= NK_GE",
/* 100 */ "compare_op ::= NK_NE",
/* 101 */ "compare_op ::= NK_EQ",
/* 102 */ "compare_op ::= LIKE",
/* 103 */ "compare_op ::= NOT LIKE",
/* 104 */ "compare_op ::= MATCH",
/* 105 */ "compare_op ::= NMATCH",
/* 106 */ "in_op ::= IN",
/* 107 */ "in_op ::= NOT IN",
/* 108 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
/* 109 */ "boolean_value_expression ::= boolean_primary",
/* 110 */ "boolean_value_expression ::= NOT boolean_primary",
/* 111 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
/* 112 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
/* 113 */ "boolean_primary ::= predicate",
/* 114 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
/* 115 */ "common_expression ::= expression",
/* 116 */ "common_expression ::= boolean_value_expression",
/* 117 */ "from_clause ::= FROM table_reference_list",
/* 118 */ "table_reference_list ::= table_reference",
/* 119 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
/* 120 */ "table_reference ::= table_primary",
/* 121 */ "table_reference ::= joined_table",
/* 122 */ "table_primary ::= table_name alias_opt",
/* 123 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
/* 124 */ "table_primary ::= subquery alias_opt",
/* 125 */ "table_primary ::= parenthesized_joined_table",
/* 126 */ "alias_opt ::=",
/* 127 */ "alias_opt ::= table_alias",
/* 128 */ "alias_opt ::= AS table_alias",
/* 129 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
/* 130 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
/* 131 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
/* 132 */ "join_type ::=",
/* 133 */ "join_type ::= INNER",
/* 134 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
/* 135 */ "set_quantifier_opt ::=",
/* 136 */ "set_quantifier_opt ::= DISTINCT",
/* 137 */ "set_quantifier_opt ::= ALL",
/* 138 */ "select_list ::= NK_STAR",
/* 139 */ "select_list ::= select_sublist",
/* 140 */ "select_sublist ::= select_item",
/* 141 */ "select_sublist ::= select_sublist NK_COMMA select_item",
/* 142 */ "select_item ::= common_expression",
/* 143 */ "select_item ::= common_expression column_alias",
/* 144 */ "select_item ::= common_expression AS column_alias",
/* 145 */ "select_item ::= table_name NK_DOT NK_STAR",
/* 146 */ "where_clause_opt ::=",
/* 147 */ "where_clause_opt ::= WHERE search_condition",
/* 148 */ "partition_by_clause_opt ::=",
/* 149 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
/* 150 */ "twindow_clause_opt ::=",
/* 151 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP",
/* 152 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
/* 153 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
/* 154 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
/* 155 */ "sliding_opt ::=",
/* 156 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
/* 157 */ "fill_opt ::=",
/* 158 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
/* 159 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
/* 160 */ "fill_mode ::= NONE",
/* 161 */ "fill_mode ::= PREV",
/* 162 */ "fill_mode ::= NULL",
/* 163 */ "fill_mode ::= LINEAR",
/* 164 */ "fill_mode ::= NEXT",
/* 165 */ "group_by_clause_opt ::=",
/* 166 */ "group_by_clause_opt ::= GROUP BY group_by_list",
/* 167 */ "group_by_list ::= expression",
/* 168 */ "group_by_list ::= group_by_list NK_COMMA expression",
/* 169 */ "having_clause_opt ::=",
/* 170 */ "having_clause_opt ::= HAVING search_condition",
/* 171 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
/* 172 */ "query_expression_body ::= query_primary",
/* 173 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
/* 174 */ "query_primary ::= query_specification",
/* 175 */ "order_by_clause_opt ::=",
/* 176 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
/* 177 */ "slimit_clause_opt ::=",
/* 178 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
/* 179 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
/* 180 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
/* 181 */ "limit_clause_opt ::=",
/* 182 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
/* 183 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
/* 184 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
/* 185 */ "subquery ::= NK_LP query_expression NK_RP",
/* 186 */ "search_condition ::= common_expression",
/* 187 */ "sort_specification_list ::= sort_specification",
/* 188 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
/* 189 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
/* 190 */ "ordering_specification_opt ::=",
/* 191 */ "ordering_specification_opt ::= ASC",
/* 192 */ "ordering_specification_opt ::= DESC",
/* 193 */ "null_ordering_opt ::=",
/* 194 */ "null_ordering_opt ::= NULLS FIRST",
/* 195 */ "null_ordering_opt ::= NULLS LAST",
/* 57 */ "cmd ::= SHOW TABLES",
/* 58 */ "cmd ::= query_expression",
/* 59 */ "literal ::= NK_INTEGER",
/* 60 */ "literal ::= NK_FLOAT",
/* 61 */ "literal ::= NK_STRING",
/* 62 */ "literal ::= NK_BOOL",
/* 63 */ "literal ::= TIMESTAMP NK_STRING",
/* 64 */ "literal ::= duration_literal",
/* 65 */ "duration_literal ::= NK_VARIABLE",
/* 66 */ "literal_list ::= literal",
/* 67 */ "literal_list ::= literal_list NK_COMMA literal",
/* 68 */ "db_name ::= NK_ID",
/* 69 */ "table_name ::= NK_ID",
/* 70 */ "column_name ::= NK_ID",
/* 71 */ "function_name ::= NK_ID",
/* 72 */ "table_alias ::= NK_ID",
/* 73 */ "column_alias ::= NK_ID",
/* 74 */ "expression ::= literal",
/* 75 */ "expression ::= column_reference",
/* 76 */ "expression ::= function_name NK_LP expression_list NK_RP",
/* 77 */ "expression ::= function_name NK_LP NK_STAR NK_RP",
/* 78 */ "expression ::= subquery",
/* 79 */ "expression ::= NK_LP expression NK_RP",
/* 80 */ "expression ::= NK_PLUS expression",
/* 81 */ "expression ::= NK_MINUS expression",
/* 82 */ "expression ::= expression NK_PLUS expression",
/* 83 */ "expression ::= expression NK_MINUS expression",
/* 84 */ "expression ::= expression NK_STAR expression",
/* 85 */ "expression ::= expression NK_SLASH expression",
/* 86 */ "expression ::= expression NK_REM expression",
/* 87 */ "expression_list ::= expression",
/* 88 */ "expression_list ::= expression_list NK_COMMA expression",
/* 89 */ "column_reference ::= column_name",
/* 90 */ "column_reference ::= table_name NK_DOT column_name",
/* 91 */ "predicate ::= expression compare_op expression",
/* 92 */ "predicate ::= expression BETWEEN expression AND expression",
/* 93 */ "predicate ::= expression NOT BETWEEN expression AND expression",
/* 94 */ "predicate ::= expression IS NULL",
/* 95 */ "predicate ::= expression IS NOT NULL",
/* 96 */ "predicate ::= expression in_op in_predicate_value",
/* 97 */ "compare_op ::= NK_LT",
/* 98 */ "compare_op ::= NK_GT",
/* 99 */ "compare_op ::= NK_LE",
/* 100 */ "compare_op ::= NK_GE",
/* 101 */ "compare_op ::= NK_NE",
/* 102 */ "compare_op ::= NK_EQ",
/* 103 */ "compare_op ::= LIKE",
/* 104 */ "compare_op ::= NOT LIKE",
/* 105 */ "compare_op ::= MATCH",
/* 106 */ "compare_op ::= NMATCH",
/* 107 */ "in_op ::= IN",
/* 108 */ "in_op ::= NOT IN",
/* 109 */ "in_predicate_value ::= NK_LP expression_list NK_RP",
/* 110 */ "boolean_value_expression ::= boolean_primary",
/* 111 */ "boolean_value_expression ::= NOT boolean_primary",
/* 112 */ "boolean_value_expression ::= boolean_value_expression OR boolean_value_expression",
/* 113 */ "boolean_value_expression ::= boolean_value_expression AND boolean_value_expression",
/* 114 */ "boolean_primary ::= predicate",
/* 115 */ "boolean_primary ::= NK_LP boolean_value_expression NK_RP",
/* 116 */ "common_expression ::= expression",
/* 117 */ "common_expression ::= boolean_value_expression",
/* 118 */ "from_clause ::= FROM table_reference_list",
/* 119 */ "table_reference_list ::= table_reference",
/* 120 */ "table_reference_list ::= table_reference_list NK_COMMA table_reference",
/* 121 */ "table_reference ::= table_primary",
/* 122 */ "table_reference ::= joined_table",
/* 123 */ "table_primary ::= table_name alias_opt",
/* 124 */ "table_primary ::= db_name NK_DOT table_name alias_opt",
/* 125 */ "table_primary ::= subquery alias_opt",
/* 126 */ "table_primary ::= parenthesized_joined_table",
/* 127 */ "alias_opt ::=",
/* 128 */ "alias_opt ::= table_alias",
/* 129 */ "alias_opt ::= AS table_alias",
/* 130 */ "parenthesized_joined_table ::= NK_LP joined_table NK_RP",
/* 131 */ "parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP",
/* 132 */ "joined_table ::= table_reference join_type JOIN table_reference ON search_condition",
/* 133 */ "join_type ::=",
/* 134 */ "join_type ::= INNER",
/* 135 */ "query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt",
/* 136 */ "set_quantifier_opt ::=",
/* 137 */ "set_quantifier_opt ::= DISTINCT",
/* 138 */ "set_quantifier_opt ::= ALL",
/* 139 */ "select_list ::= NK_STAR",
/* 140 */ "select_list ::= select_sublist",
/* 141 */ "select_sublist ::= select_item",
/* 142 */ "select_sublist ::= select_sublist NK_COMMA select_item",
/* 143 */ "select_item ::= common_expression",
/* 144 */ "select_item ::= common_expression column_alias",
/* 145 */ "select_item ::= common_expression AS column_alias",
/* 146 */ "select_item ::= table_name NK_DOT NK_STAR",
/* 147 */ "where_clause_opt ::=",
/* 148 */ "where_clause_opt ::= WHERE search_condition",
/* 149 */ "partition_by_clause_opt ::=",
/* 150 */ "partition_by_clause_opt ::= PARTITION BY expression_list",
/* 151 */ "twindow_clause_opt ::=",
/* 152 */ "twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP",
/* 153 */ "twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP",
/* 154 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt",
/* 155 */ "twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt",
/* 156 */ "sliding_opt ::=",
/* 157 */ "sliding_opt ::= SLIDING NK_LP duration_literal NK_RP",
/* 158 */ "fill_opt ::=",
/* 159 */ "fill_opt ::= FILL NK_LP fill_mode NK_RP",
/* 160 */ "fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP",
/* 161 */ "fill_mode ::= NONE",
/* 162 */ "fill_mode ::= PREV",
/* 163 */ "fill_mode ::= NULL",
/* 164 */ "fill_mode ::= LINEAR",
/* 165 */ "fill_mode ::= NEXT",
/* 166 */ "group_by_clause_opt ::=",
/* 167 */ "group_by_clause_opt ::= GROUP BY group_by_list",
/* 168 */ "group_by_list ::= expression",
/* 169 */ "group_by_list ::= group_by_list NK_COMMA expression",
/* 170 */ "having_clause_opt ::=",
/* 171 */ "having_clause_opt ::= HAVING search_condition",
/* 172 */ "query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt",
/* 173 */ "query_expression_body ::= query_primary",
/* 174 */ "query_expression_body ::= query_expression_body UNION ALL query_expression_body",
/* 175 */ "query_primary ::= query_specification",
/* 176 */ "order_by_clause_opt ::=",
/* 177 */ "order_by_clause_opt ::= ORDER BY sort_specification_list",
/* 178 */ "slimit_clause_opt ::=",
/* 179 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER",
/* 180 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER",
/* 181 */ "slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER",
/* 182 */ "limit_clause_opt ::=",
/* 183 */ "limit_clause_opt ::= LIMIT NK_INTEGER",
/* 184 */ "limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER",
/* 185 */ "limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER",
/* 186 */ "subquery ::= NK_LP query_expression NK_RP",
/* 187 */ "search_condition ::= common_expression",
/* 188 */ "sort_specification_list ::= sort_specification",
/* 189 */ "sort_specification_list ::= sort_specification_list NK_COMMA sort_specification",
/* 190 */ "sort_specification ::= expression ordering_specification_opt null_ordering_opt",
/* 191 */ "ordering_specification_opt ::=",
/* 192 */ "ordering_specification_opt ::= ASC",
/* 193 */ "ordering_specification_opt ::= DESC",
/* 194 */ "null_ordering_opt ::=",
/* 195 */ "null_ordering_opt ::= NULLS FIRST",
/* 196 */ "null_ordering_opt ::= NULLS LAST",
};
#endif /* NDEBUG */
......@@ -1083,119 +1084,119 @@ static void yy_destructor(
*/
/********* Begin destructor definitions ***************************************/
/* Default NON-TERMINAL Destructor */
case 118: /* cmd */
case 119: /* exists_opt */
case 125: /* column_def */
case 128: /* query_expression */
case 129: /* literal */
case 130: /* duration_literal */
case 136: /* expression */
case 137: /* column_reference */
case 139: /* subquery */
case 140: /* predicate */
case 143: /* in_predicate_value */
case 144: /* boolean_value_expression */
case 145: /* boolean_primary */
case 146: /* common_expression */
case 147: /* from_clause */
case 148: /* table_reference_list */
case 149: /* table_reference */
case 150: /* table_primary */
case 151: /* joined_table */
case 153: /* parenthesized_joined_table */
case 155: /* search_condition */
case 156: /* query_specification */
case 159: /* where_clause_opt */
case 161: /* twindow_clause_opt */
case 163: /* having_clause_opt */
case 165: /* select_item */
case 166: /* sliding_opt */
case 167: /* fill_opt */
case 170: /* query_expression_body */
case 172: /* slimit_clause_opt */
case 173: /* limit_clause_opt */
case 174: /* query_primary */
case 176: /* sort_specification */
case 119: /* cmd */
case 120: /* exists_opt */
case 126: /* column_def */
case 129: /* query_expression */
case 130: /* literal */
case 131: /* duration_literal */
case 137: /* expression */
case 138: /* column_reference */
case 140: /* subquery */
case 141: /* predicate */
case 144: /* in_predicate_value */
case 145: /* boolean_value_expression */
case 146: /* boolean_primary */
case 147: /* common_expression */
case 148: /* from_clause */
case 149: /* table_reference_list */
case 150: /* table_reference */
case 151: /* table_primary */
case 152: /* joined_table */
case 154: /* parenthesized_joined_table */
case 156: /* search_condition */
case 157: /* query_specification */
case 160: /* where_clause_opt */
case 162: /* twindow_clause_opt */
case 164: /* having_clause_opt */
case 166: /* select_item */
case 167: /* sliding_opt */
case 168: /* fill_opt */
case 171: /* query_expression_body */
case 173: /* slimit_clause_opt */
case 174: /* limit_clause_opt */
case 175: /* query_primary */
case 177: /* sort_specification */
{
PARSER_DESTRUCTOR_TRACE; nodesDestroyNode((yypminor->yy172));
PARSER_DESTRUCTOR_TRACE; nodesDestroyNode((yypminor->yy272));
}
break;
case 120: /* db_name */
case 126: /* column_name */
case 132: /* table_name */
case 133: /* function_name */
case 134: /* table_alias */
case 135: /* column_alias */
case 152: /* alias_opt */
case 121: /* db_name */
case 127: /* column_name */
case 133: /* table_name */
case 134: /* function_name */
case 135: /* table_alias */
case 136: /* column_alias */
case 153: /* alias_opt */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 121: /* db_options */
case 122: /* db_options */
{
tfree((yypminor->yy27));
tfree((yypminor->yy199));
}
break;
case 122: /* full_table_name */
case 123: /* full_table_name */
{
}
break;
case 123: /* column_def_list */
case 124: /* column_def_list */
{
nodesDestroyList((yypminor->yy60));
nodesDestroyList((yypminor->yy64));
}
break;
case 124: /* table_options */
case 125: /* table_options */
{
tfree((yypminor->yy40));
tfree((yypminor->yy46));
}
break;
case 127: /* type_name */
case 128: /* type_name */
{
}
break;
case 131: /* literal_list */
case 138: /* expression_list */
case 158: /* select_list */
case 160: /* partition_by_clause_opt */
case 162: /* group_by_clause_opt */
case 164: /* select_sublist */
case 169: /* group_by_list */
case 171: /* order_by_clause_opt */
case 175: /* sort_specification_list */
case 132: /* literal_list */
case 139: /* expression_list */
case 159: /* select_list */
case 161: /* partition_by_clause_opt */
case 163: /* group_by_clause_opt */
case 165: /* select_sublist */
case 170: /* group_by_list */
case 172: /* order_by_clause_opt */
case 176: /* sort_specification_list */
{
PARSER_DESTRUCTOR_TRACE; nodesDestroyList((yypminor->yy60));
PARSER_DESTRUCTOR_TRACE; nodesDestroyList((yypminor->yy64));
}
break;
case 141: /* compare_op */
case 142: /* in_op */
case 142: /* compare_op */
case 143: /* in_op */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 154: /* join_type */
case 155: /* join_type */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 157: /* set_quantifier_opt */
case 158: /* set_quantifier_opt */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 168: /* fill_mode */
case 169: /* fill_mode */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 177: /* ordering_specification_opt */
case 178: /* ordering_specification_opt */
{
PARSER_DESTRUCTOR_TRACE;
}
break;
case 178: /* null_ordering_opt */
case 179: /* null_ordering_opt */
{
PARSER_DESTRUCTOR_TRACE;
}
......@@ -1494,202 +1495,203 @@ static const struct {
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[] = {
{ 118, -5 }, /* (0) cmd ::= CREATE DATABASE exists_opt db_name db_options */
{ 119, -3 }, /* (1) exists_opt ::= IF NOT EXISTS */
{ 119, 0 }, /* (2) exists_opt ::= */
{ 121, 0 }, /* (3) db_options ::= */
{ 121, -3 }, /* (4) db_options ::= db_options BLOCKS NK_INTEGER */
{ 121, -3 }, /* (5) db_options ::= db_options CACHE NK_INTEGER */
{ 121, -3 }, /* (6) db_options ::= db_options CACHELAST NK_INTEGER */
{ 121, -3 }, /* (7) db_options ::= db_options COMP NK_INTEGER */
{ 121, -3 }, /* (8) db_options ::= db_options DAYS NK_INTEGER */
{ 121, -3 }, /* (9) db_options ::= db_options FSYNC NK_INTEGER */
{ 121, -3 }, /* (10) db_options ::= db_options MAXROWS NK_INTEGER */
{ 121, -3 }, /* (11) db_options ::= db_options MINROWS NK_INTEGER */
{ 121, -3 }, /* (12) db_options ::= db_options KEEP NK_INTEGER */
{ 121, -3 }, /* (13) db_options ::= db_options PRECISION NK_STRING */
{ 121, -3 }, /* (14) db_options ::= db_options QUORUM NK_INTEGER */
{ 121, -3 }, /* (15) db_options ::= db_options REPLICA NK_INTEGER */
{ 121, -3 }, /* (16) db_options ::= db_options TTL NK_INTEGER */
{ 121, -3 }, /* (17) db_options ::= db_options WAL NK_INTEGER */
{ 121, -3 }, /* (18) db_options ::= db_options VGROUPS NK_INTEGER */
{ 121, -3 }, /* (19) db_options ::= db_options SINGLESTABLE NK_INTEGER */
{ 121, -3 }, /* (20) db_options ::= db_options STREAMMODE NK_INTEGER */
{ 118, -2 }, /* (21) cmd ::= USE db_name */
{ 118, -8 }, /* (22) cmd ::= CREATE TABLE exists_opt full_table_name NK_LP column_def_list NK_RP table_options */
{ 122, -1 }, /* (23) full_table_name ::= NK_ID */
{ 122, -3 }, /* (24) full_table_name ::= NK_ID NK_DOT NK_ID */
{ 123, -1 }, /* (25) column_def_list ::= column_def */
{ 123, -3 }, /* (26) column_def_list ::= column_def_list NK_COMMA column_def */
{ 125, -2 }, /* (27) column_def ::= column_name type_name */
{ 125, -4 }, /* (28) column_def ::= column_name type_name COMMENT NK_STRING */
{ 127, -1 }, /* (29) type_name ::= BOOL */
{ 127, -1 }, /* (30) type_name ::= TINYINT */
{ 127, -1 }, /* (31) type_name ::= SMALLINT */
{ 127, -1 }, /* (32) type_name ::= INT */
{ 127, -1 }, /* (33) type_name ::= INTEGER */
{ 127, -1 }, /* (34) type_name ::= BIGINT */
{ 127, -1 }, /* (35) type_name ::= FLOAT */
{ 127, -1 }, /* (36) type_name ::= DOUBLE */
{ 127, -4 }, /* (37) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
{ 127, -1 }, /* (38) type_name ::= TIMESTAMP */
{ 127, -4 }, /* (39) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
{ 127, -2 }, /* (40) type_name ::= TINYINT UNSIGNED */
{ 127, -2 }, /* (41) type_name ::= SMALLINT UNSIGNED */
{ 127, -2 }, /* (42) type_name ::= INT UNSIGNED */
{ 127, -2 }, /* (43) type_name ::= BIGINT UNSIGNED */
{ 127, -1 }, /* (44) type_name ::= JSON */
{ 127, -4 }, /* (45) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
{ 127, -1 }, /* (46) type_name ::= MEDIUMBLOB */
{ 127, -1 }, /* (47) type_name ::= BLOB */
{ 127, -4 }, /* (48) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
{ 127, -1 }, /* (49) type_name ::= DECIMAL */
{ 127, -4 }, /* (50) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
{ 127, -6 }, /* (51) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
{ 124, 0 }, /* (52) table_options ::= */
{ 124, -3 }, /* (53) table_options ::= table_options COMMENT NK_INTEGER */
{ 124, -3 }, /* (54) table_options ::= table_options KEEP NK_INTEGER */
{ 124, -3 }, /* (55) table_options ::= table_options TTL NK_INTEGER */
{ 118, -2 }, /* (56) cmd ::= SHOW DATABASES */
{ 118, -1 }, /* (57) cmd ::= query_expression */
{ 129, -1 }, /* (58) literal ::= NK_INTEGER */
{ 129, -1 }, /* (59) literal ::= NK_FLOAT */
{ 129, -1 }, /* (60) literal ::= NK_STRING */
{ 129, -1 }, /* (61) literal ::= NK_BOOL */
{ 129, -2 }, /* (62) literal ::= TIMESTAMP NK_STRING */
{ 129, -1 }, /* (63) literal ::= duration_literal */
{ 130, -1 }, /* (64) duration_literal ::= NK_VARIABLE */
{ 131, -1 }, /* (65) literal_list ::= literal */
{ 131, -3 }, /* (66) literal_list ::= literal_list NK_COMMA literal */
{ 120, -1 }, /* (67) db_name ::= NK_ID */
{ 132, -1 }, /* (68) table_name ::= NK_ID */
{ 126, -1 }, /* (69) column_name ::= NK_ID */
{ 133, -1 }, /* (70) function_name ::= NK_ID */
{ 134, -1 }, /* (71) table_alias ::= NK_ID */
{ 135, -1 }, /* (72) column_alias ::= NK_ID */
{ 136, -1 }, /* (73) expression ::= literal */
{ 136, -1 }, /* (74) expression ::= column_reference */
{ 136, -4 }, /* (75) expression ::= function_name NK_LP expression_list NK_RP */
{ 136, -4 }, /* (76) expression ::= function_name NK_LP NK_STAR NK_RP */
{ 136, -1 }, /* (77) expression ::= subquery */
{ 136, -3 }, /* (78) expression ::= NK_LP expression NK_RP */
{ 136, -2 }, /* (79) expression ::= NK_PLUS expression */
{ 136, -2 }, /* (80) expression ::= NK_MINUS expression */
{ 136, -3 }, /* (81) expression ::= expression NK_PLUS expression */
{ 136, -3 }, /* (82) expression ::= expression NK_MINUS expression */
{ 136, -3 }, /* (83) expression ::= expression NK_STAR expression */
{ 136, -3 }, /* (84) expression ::= expression NK_SLASH expression */
{ 136, -3 }, /* (85) expression ::= expression NK_REM expression */
{ 138, -1 }, /* (86) expression_list ::= expression */
{ 138, -3 }, /* (87) expression_list ::= expression_list NK_COMMA expression */
{ 137, -1 }, /* (88) column_reference ::= column_name */
{ 137, -3 }, /* (89) column_reference ::= table_name NK_DOT column_name */
{ 140, -3 }, /* (90) predicate ::= expression compare_op expression */
{ 140, -5 }, /* (91) predicate ::= expression BETWEEN expression AND expression */
{ 140, -6 }, /* (92) predicate ::= expression NOT BETWEEN expression AND expression */
{ 140, -3 }, /* (93) predicate ::= expression IS NULL */
{ 140, -4 }, /* (94) predicate ::= expression IS NOT NULL */
{ 140, -3 }, /* (95) predicate ::= expression in_op in_predicate_value */
{ 141, -1 }, /* (96) compare_op ::= NK_LT */
{ 141, -1 }, /* (97) compare_op ::= NK_GT */
{ 141, -1 }, /* (98) compare_op ::= NK_LE */
{ 141, -1 }, /* (99) compare_op ::= NK_GE */
{ 141, -1 }, /* (100) compare_op ::= NK_NE */
{ 141, -1 }, /* (101) compare_op ::= NK_EQ */
{ 141, -1 }, /* (102) compare_op ::= LIKE */
{ 141, -2 }, /* (103) compare_op ::= NOT LIKE */
{ 141, -1 }, /* (104) compare_op ::= MATCH */
{ 141, -1 }, /* (105) compare_op ::= NMATCH */
{ 142, -1 }, /* (106) in_op ::= IN */
{ 142, -2 }, /* (107) in_op ::= NOT IN */
{ 143, -3 }, /* (108) in_predicate_value ::= NK_LP expression_list NK_RP */
{ 144, -1 }, /* (109) boolean_value_expression ::= boolean_primary */
{ 144, -2 }, /* (110) boolean_value_expression ::= NOT boolean_primary */
{ 144, -3 }, /* (111) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{ 144, -3 }, /* (112) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{ 145, -1 }, /* (113) boolean_primary ::= predicate */
{ 145, -3 }, /* (114) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
{ 146, -1 }, /* (115) common_expression ::= expression */
{ 146, -1 }, /* (116) common_expression ::= boolean_value_expression */
{ 147, -2 }, /* (117) from_clause ::= FROM table_reference_list */
{ 148, -1 }, /* (118) table_reference_list ::= table_reference */
{ 148, -3 }, /* (119) table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ 149, -1 }, /* (120) table_reference ::= table_primary */
{ 149, -1 }, /* (121) table_reference ::= joined_table */
{ 150, -2 }, /* (122) table_primary ::= table_name alias_opt */
{ 150, -4 }, /* (123) table_primary ::= db_name NK_DOT table_name alias_opt */
{ 150, -2 }, /* (124) table_primary ::= subquery alias_opt */
{ 150, -1 }, /* (125) table_primary ::= parenthesized_joined_table */
{ 152, 0 }, /* (126) alias_opt ::= */
{ 152, -1 }, /* (127) alias_opt ::= table_alias */
{ 152, -2 }, /* (128) alias_opt ::= AS table_alias */
{ 153, -3 }, /* (129) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
{ 153, -3 }, /* (130) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
{ 151, -6 }, /* (131) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ 154, 0 }, /* (132) join_type ::= */
{ 154, -1 }, /* (133) join_type ::= INNER */
{ 156, -9 }, /* (134) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{ 157, 0 }, /* (135) set_quantifier_opt ::= */
{ 157, -1 }, /* (136) set_quantifier_opt ::= DISTINCT */
{ 157, -1 }, /* (137) set_quantifier_opt ::= ALL */
{ 158, -1 }, /* (138) select_list ::= NK_STAR */
{ 158, -1 }, /* (139) select_list ::= select_sublist */
{ 164, -1 }, /* (140) select_sublist ::= select_item */
{ 164, -3 }, /* (141) select_sublist ::= select_sublist NK_COMMA select_item */
{ 165, -1 }, /* (142) select_item ::= common_expression */
{ 165, -2 }, /* (143) select_item ::= common_expression column_alias */
{ 165, -3 }, /* (144) select_item ::= common_expression AS column_alias */
{ 165, -3 }, /* (145) select_item ::= table_name NK_DOT NK_STAR */
{ 159, 0 }, /* (146) where_clause_opt ::= */
{ 159, -2 }, /* (147) where_clause_opt ::= WHERE search_condition */
{ 160, 0 }, /* (148) partition_by_clause_opt ::= */
{ 160, -3 }, /* (149) partition_by_clause_opt ::= PARTITION BY expression_list */
{ 161, 0 }, /* (150) twindow_clause_opt ::= */
{ 161, -6 }, /* (151) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
{ 161, -4 }, /* (152) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
{ 161, -6 }, /* (153) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ 161, -8 }, /* (154) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ 166, 0 }, /* (155) sliding_opt ::= */
{ 166, -4 }, /* (156) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ 167, 0 }, /* (157) fill_opt ::= */
{ 167, -4 }, /* (158) fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ 167, -6 }, /* (159) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ 168, -1 }, /* (160) fill_mode ::= NONE */
{ 168, -1 }, /* (161) fill_mode ::= PREV */
{ 168, -1 }, /* (162) fill_mode ::= NULL */
{ 168, -1 }, /* (163) fill_mode ::= LINEAR */
{ 168, -1 }, /* (164) fill_mode ::= NEXT */
{ 162, 0 }, /* (165) group_by_clause_opt ::= */
{ 162, -3 }, /* (166) group_by_clause_opt ::= GROUP BY group_by_list */
{ 169, -1 }, /* (167) group_by_list ::= expression */
{ 169, -3 }, /* (168) group_by_list ::= group_by_list NK_COMMA expression */
{ 163, 0 }, /* (169) having_clause_opt ::= */
{ 163, -2 }, /* (170) having_clause_opt ::= HAVING search_condition */
{ 128, -4 }, /* (171) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{ 170, -1 }, /* (172) query_expression_body ::= query_primary */
{ 170, -4 }, /* (173) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ 174, -1 }, /* (174) query_primary ::= query_specification */
{ 171, 0 }, /* (175) order_by_clause_opt ::= */
{ 171, -3 }, /* (176) order_by_clause_opt ::= ORDER BY sort_specification_list */
{ 172, 0 }, /* (177) slimit_clause_opt ::= */
{ 172, -2 }, /* (178) slimit_clause_opt ::= SLIMIT NK_INTEGER */
{ 172, -4 }, /* (179) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
{ 172, -4 }, /* (180) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{ 173, 0 }, /* (181) limit_clause_opt ::= */
{ 173, -2 }, /* (182) limit_clause_opt ::= LIMIT NK_INTEGER */
{ 173, -4 }, /* (183) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
{ 173, -4 }, /* (184) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{ 139, -3 }, /* (185) subquery ::= NK_LP query_expression NK_RP */
{ 155, -1 }, /* (186) search_condition ::= common_expression */
{ 175, -1 }, /* (187) sort_specification_list ::= sort_specification */
{ 175, -3 }, /* (188) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
{ 176, -3 }, /* (189) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ 177, 0 }, /* (190) ordering_specification_opt ::= */
{ 177, -1 }, /* (191) ordering_specification_opt ::= ASC */
{ 177, -1 }, /* (192) ordering_specification_opt ::= DESC */
{ 178, 0 }, /* (193) null_ordering_opt ::= */
{ 178, -2 }, /* (194) null_ordering_opt ::= NULLS FIRST */
{ 178, -2 }, /* (195) null_ordering_opt ::= NULLS LAST */
{ 119, -5 }, /* (0) cmd ::= CREATE DATABASE exists_opt db_name db_options */
{ 120, -3 }, /* (1) exists_opt ::= IF NOT EXISTS */
{ 120, 0 }, /* (2) exists_opt ::= */
{ 122, 0 }, /* (3) db_options ::= */
{ 122, -3 }, /* (4) db_options ::= db_options BLOCKS NK_INTEGER */
{ 122, -3 }, /* (5) db_options ::= db_options CACHE NK_INTEGER */
{ 122, -3 }, /* (6) db_options ::= db_options CACHELAST NK_INTEGER */
{ 122, -3 }, /* (7) db_options ::= db_options COMP NK_INTEGER */
{ 122, -3 }, /* (8) db_options ::= db_options DAYS NK_INTEGER */
{ 122, -3 }, /* (9) db_options ::= db_options FSYNC NK_INTEGER */
{ 122, -3 }, /* (10) db_options ::= db_options MAXROWS NK_INTEGER */
{ 122, -3 }, /* (11) db_options ::= db_options MINROWS NK_INTEGER */
{ 122, -3 }, /* (12) db_options ::= db_options KEEP NK_INTEGER */
{ 122, -3 }, /* (13) db_options ::= db_options PRECISION NK_STRING */
{ 122, -3 }, /* (14) db_options ::= db_options QUORUM NK_INTEGER */
{ 122, -3 }, /* (15) db_options ::= db_options REPLICA NK_INTEGER */
{ 122, -3 }, /* (16) db_options ::= db_options TTL NK_INTEGER */
{ 122, -3 }, /* (17) db_options ::= db_options WAL NK_INTEGER */
{ 122, -3 }, /* (18) db_options ::= db_options VGROUPS NK_INTEGER */
{ 122, -3 }, /* (19) db_options ::= db_options SINGLESTABLE NK_INTEGER */
{ 122, -3 }, /* (20) db_options ::= db_options STREAMMODE NK_INTEGER */
{ 119, -2 }, /* (21) cmd ::= USE db_name */
{ 119, -8 }, /* (22) cmd ::= CREATE TABLE exists_opt full_table_name NK_LP column_def_list NK_RP table_options */
{ 123, -1 }, /* (23) full_table_name ::= NK_ID */
{ 123, -3 }, /* (24) full_table_name ::= NK_ID NK_DOT NK_ID */
{ 124, -1 }, /* (25) column_def_list ::= column_def */
{ 124, -3 }, /* (26) column_def_list ::= column_def_list NK_COMMA column_def */
{ 126, -2 }, /* (27) column_def ::= column_name type_name */
{ 126, -4 }, /* (28) column_def ::= column_name type_name COMMENT NK_STRING */
{ 128, -1 }, /* (29) type_name ::= BOOL */
{ 128, -1 }, /* (30) type_name ::= TINYINT */
{ 128, -1 }, /* (31) type_name ::= SMALLINT */
{ 128, -1 }, /* (32) type_name ::= INT */
{ 128, -1 }, /* (33) type_name ::= INTEGER */
{ 128, -1 }, /* (34) type_name ::= BIGINT */
{ 128, -1 }, /* (35) type_name ::= FLOAT */
{ 128, -1 }, /* (36) type_name ::= DOUBLE */
{ 128, -4 }, /* (37) type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
{ 128, -1 }, /* (38) type_name ::= TIMESTAMP */
{ 128, -4 }, /* (39) type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
{ 128, -2 }, /* (40) type_name ::= TINYINT UNSIGNED */
{ 128, -2 }, /* (41) type_name ::= SMALLINT UNSIGNED */
{ 128, -2 }, /* (42) type_name ::= INT UNSIGNED */
{ 128, -2 }, /* (43) type_name ::= BIGINT UNSIGNED */
{ 128, -1 }, /* (44) type_name ::= JSON */
{ 128, -4 }, /* (45) type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
{ 128, -1 }, /* (46) type_name ::= MEDIUMBLOB */
{ 128, -1 }, /* (47) type_name ::= BLOB */
{ 128, -4 }, /* (48) type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
{ 128, -1 }, /* (49) type_name ::= DECIMAL */
{ 128, -4 }, /* (50) type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
{ 128, -6 }, /* (51) type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
{ 125, 0 }, /* (52) table_options ::= */
{ 125, -3 }, /* (53) table_options ::= table_options COMMENT NK_INTEGER */
{ 125, -3 }, /* (54) table_options ::= table_options KEEP NK_INTEGER */
{ 125, -3 }, /* (55) table_options ::= table_options TTL NK_INTEGER */
{ 119, -2 }, /* (56) cmd ::= SHOW DATABASES */
{ 119, -2 }, /* (57) cmd ::= SHOW TABLES */
{ 119, -1 }, /* (58) cmd ::= query_expression */
{ 130, -1 }, /* (59) literal ::= NK_INTEGER */
{ 130, -1 }, /* (60) literal ::= NK_FLOAT */
{ 130, -1 }, /* (61) literal ::= NK_STRING */
{ 130, -1 }, /* (62) literal ::= NK_BOOL */
{ 130, -2 }, /* (63) literal ::= TIMESTAMP NK_STRING */
{ 130, -1 }, /* (64) literal ::= duration_literal */
{ 131, -1 }, /* (65) duration_literal ::= NK_VARIABLE */
{ 132, -1 }, /* (66) literal_list ::= literal */
{ 132, -3 }, /* (67) literal_list ::= literal_list NK_COMMA literal */
{ 121, -1 }, /* (68) db_name ::= NK_ID */
{ 133, -1 }, /* (69) table_name ::= NK_ID */
{ 127, -1 }, /* (70) column_name ::= NK_ID */
{ 134, -1 }, /* (71) function_name ::= NK_ID */
{ 135, -1 }, /* (72) table_alias ::= NK_ID */
{ 136, -1 }, /* (73) column_alias ::= NK_ID */
{ 137, -1 }, /* (74) expression ::= literal */
{ 137, -1 }, /* (75) expression ::= column_reference */
{ 137, -4 }, /* (76) expression ::= function_name NK_LP expression_list NK_RP */
{ 137, -4 }, /* (77) expression ::= function_name NK_LP NK_STAR NK_RP */
{ 137, -1 }, /* (78) expression ::= subquery */
{ 137, -3 }, /* (79) expression ::= NK_LP expression NK_RP */
{ 137, -2 }, /* (80) expression ::= NK_PLUS expression */
{ 137, -2 }, /* (81) expression ::= NK_MINUS expression */
{ 137, -3 }, /* (82) expression ::= expression NK_PLUS expression */
{ 137, -3 }, /* (83) expression ::= expression NK_MINUS expression */
{ 137, -3 }, /* (84) expression ::= expression NK_STAR expression */
{ 137, -3 }, /* (85) expression ::= expression NK_SLASH expression */
{ 137, -3 }, /* (86) expression ::= expression NK_REM expression */
{ 139, -1 }, /* (87) expression_list ::= expression */
{ 139, -3 }, /* (88) expression_list ::= expression_list NK_COMMA expression */
{ 138, -1 }, /* (89) column_reference ::= column_name */
{ 138, -3 }, /* (90) column_reference ::= table_name NK_DOT column_name */
{ 141, -3 }, /* (91) predicate ::= expression compare_op expression */
{ 141, -5 }, /* (92) predicate ::= expression BETWEEN expression AND expression */
{ 141, -6 }, /* (93) predicate ::= expression NOT BETWEEN expression AND expression */
{ 141, -3 }, /* (94) predicate ::= expression IS NULL */
{ 141, -4 }, /* (95) predicate ::= expression IS NOT NULL */
{ 141, -3 }, /* (96) predicate ::= expression in_op in_predicate_value */
{ 142, -1 }, /* (97) compare_op ::= NK_LT */
{ 142, -1 }, /* (98) compare_op ::= NK_GT */
{ 142, -1 }, /* (99) compare_op ::= NK_LE */
{ 142, -1 }, /* (100) compare_op ::= NK_GE */
{ 142, -1 }, /* (101) compare_op ::= NK_NE */
{ 142, -1 }, /* (102) compare_op ::= NK_EQ */
{ 142, -1 }, /* (103) compare_op ::= LIKE */
{ 142, -2 }, /* (104) compare_op ::= NOT LIKE */
{ 142, -1 }, /* (105) compare_op ::= MATCH */
{ 142, -1 }, /* (106) compare_op ::= NMATCH */
{ 143, -1 }, /* (107) in_op ::= IN */
{ 143, -2 }, /* (108) in_op ::= NOT IN */
{ 144, -3 }, /* (109) in_predicate_value ::= NK_LP expression_list NK_RP */
{ 145, -1 }, /* (110) boolean_value_expression ::= boolean_primary */
{ 145, -2 }, /* (111) boolean_value_expression ::= NOT boolean_primary */
{ 145, -3 }, /* (112) boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{ 145, -3 }, /* (113) boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{ 146, -1 }, /* (114) boolean_primary ::= predicate */
{ 146, -3 }, /* (115) boolean_primary ::= NK_LP boolean_value_expression NK_RP */
{ 147, -1 }, /* (116) common_expression ::= expression */
{ 147, -1 }, /* (117) common_expression ::= boolean_value_expression */
{ 148, -2 }, /* (118) from_clause ::= FROM table_reference_list */
{ 149, -1 }, /* (119) table_reference_list ::= table_reference */
{ 149, -3 }, /* (120) table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ 150, -1 }, /* (121) table_reference ::= table_primary */
{ 150, -1 }, /* (122) table_reference ::= joined_table */
{ 151, -2 }, /* (123) table_primary ::= table_name alias_opt */
{ 151, -4 }, /* (124) table_primary ::= db_name NK_DOT table_name alias_opt */
{ 151, -2 }, /* (125) table_primary ::= subquery alias_opt */
{ 151, -1 }, /* (126) table_primary ::= parenthesized_joined_table */
{ 153, 0 }, /* (127) alias_opt ::= */
{ 153, -1 }, /* (128) alias_opt ::= table_alias */
{ 153, -2 }, /* (129) alias_opt ::= AS table_alias */
{ 154, -3 }, /* (130) parenthesized_joined_table ::= NK_LP joined_table NK_RP */
{ 154, -3 }, /* (131) parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */
{ 152, -6 }, /* (132) joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ 155, 0 }, /* (133) join_type ::= */
{ 155, -1 }, /* (134) join_type ::= INNER */
{ 157, -9 }, /* (135) query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{ 158, 0 }, /* (136) set_quantifier_opt ::= */
{ 158, -1 }, /* (137) set_quantifier_opt ::= DISTINCT */
{ 158, -1 }, /* (138) set_quantifier_opt ::= ALL */
{ 159, -1 }, /* (139) select_list ::= NK_STAR */
{ 159, -1 }, /* (140) select_list ::= select_sublist */
{ 165, -1 }, /* (141) select_sublist ::= select_item */
{ 165, -3 }, /* (142) select_sublist ::= select_sublist NK_COMMA select_item */
{ 166, -1 }, /* (143) select_item ::= common_expression */
{ 166, -2 }, /* (144) select_item ::= common_expression column_alias */
{ 166, -3 }, /* (145) select_item ::= common_expression AS column_alias */
{ 166, -3 }, /* (146) select_item ::= table_name NK_DOT NK_STAR */
{ 160, 0 }, /* (147) where_clause_opt ::= */
{ 160, -2 }, /* (148) where_clause_opt ::= WHERE search_condition */
{ 161, 0 }, /* (149) partition_by_clause_opt ::= */
{ 161, -3 }, /* (150) partition_by_clause_opt ::= PARTITION BY expression_list */
{ 162, 0 }, /* (151) twindow_clause_opt ::= */
{ 162, -6 }, /* (152) twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
{ 162, -4 }, /* (153) twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
{ 162, -6 }, /* (154) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ 162, -8 }, /* (155) twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ 167, 0 }, /* (156) sliding_opt ::= */
{ 167, -4 }, /* (157) sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ 168, 0 }, /* (158) fill_opt ::= */
{ 168, -4 }, /* (159) fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ 168, -6 }, /* (160) fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ 169, -1 }, /* (161) fill_mode ::= NONE */
{ 169, -1 }, /* (162) fill_mode ::= PREV */
{ 169, -1 }, /* (163) fill_mode ::= NULL */
{ 169, -1 }, /* (164) fill_mode ::= LINEAR */
{ 169, -1 }, /* (165) fill_mode ::= NEXT */
{ 163, 0 }, /* (166) group_by_clause_opt ::= */
{ 163, -3 }, /* (167) group_by_clause_opt ::= GROUP BY group_by_list */
{ 170, -1 }, /* (168) group_by_list ::= expression */
{ 170, -3 }, /* (169) group_by_list ::= group_by_list NK_COMMA expression */
{ 164, 0 }, /* (170) having_clause_opt ::= */
{ 164, -2 }, /* (171) having_clause_opt ::= HAVING search_condition */
{ 129, -4 }, /* (172) query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{ 171, -1 }, /* (173) query_expression_body ::= query_primary */
{ 171, -4 }, /* (174) query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ 175, -1 }, /* (175) query_primary ::= query_specification */
{ 172, 0 }, /* (176) order_by_clause_opt ::= */
{ 172, -3 }, /* (177) order_by_clause_opt ::= ORDER BY sort_specification_list */
{ 173, 0 }, /* (178) slimit_clause_opt ::= */
{ 173, -2 }, /* (179) slimit_clause_opt ::= SLIMIT NK_INTEGER */
{ 173, -4 }, /* (180) slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
{ 173, -4 }, /* (181) slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{ 174, 0 }, /* (182) limit_clause_opt ::= */
{ 174, -2 }, /* (183) limit_clause_opt ::= LIMIT NK_INTEGER */
{ 174, -4 }, /* (184) limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */
{ 174, -4 }, /* (185) limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */
{ 140, -3 }, /* (186) subquery ::= NK_LP query_expression NK_RP */
{ 156, -1 }, /* (187) search_condition ::= common_expression */
{ 176, -1 }, /* (188) sort_specification_list ::= sort_specification */
{ 176, -3 }, /* (189) sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */
{ 177, -3 }, /* (190) sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ 178, 0 }, /* (191) ordering_specification_opt ::= */
{ 178, -1 }, /* (192) ordering_specification_opt ::= ASC */
{ 178, -1 }, /* (193) ordering_specification_opt ::= DESC */
{ 179, 0 }, /* (194) null_ordering_opt ::= */
{ 179, -2 }, /* (195) null_ordering_opt ::= NULLS FIRST */
{ 179, -2 }, /* (196) null_ordering_opt ::= NULLS LAST */
};
static void yy_accept(yyParser*); /* Forward Declaration */
......@@ -1777,677 +1779,680 @@ static YYACTIONTYPE yy_reduce(
/********** Begin reduce actions **********************************************/
YYMINORTYPE yylhsminor;
case 0: /* cmd ::= CREATE DATABASE exists_opt db_name db_options */
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy259, &yymsp[-1].minor.yy105, yymsp[0].minor.yy27);}
{ pCxt->pRootNode = createCreateDatabaseStmt(pCxt, yymsp[-2].minor.yy137, &yymsp[-1].minor.yy209, yymsp[0].minor.yy199);}
break;
case 1: /* exists_opt ::= IF NOT EXISTS */
{ yymsp[-2].minor.yy259 = true; }
{ yymsp[-2].minor.yy137 = true; }
break;
case 2: /* exists_opt ::= */
{ yymsp[1].minor.yy259 = false; }
{ yymsp[1].minor.yy137 = false; }
break;
case 3: /* db_options ::= */
{ yymsp[1].minor.yy27 = createDefaultDatabaseOptions(pCxt); }
{ yymsp[1].minor.yy199 = createDefaultDatabaseOptions(pCxt); }
break;
case 4: /* db_options ::= db_options BLOCKS NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_BLOCKS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 5: /* db_options ::= db_options CACHE NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_CACHE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 6: /* db_options ::= db_options CACHELAST NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_CACHELAST, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 7: /* db_options ::= db_options COMP NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_COMP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 8: /* db_options ::= db_options DAYS NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_DAYS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 9: /* db_options ::= db_options FSYNC NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_FSYNC, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 10: /* db_options ::= db_options MAXROWS NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_MAXROWS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 11: /* db_options ::= db_options MINROWS NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_MINROWS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 12: /* db_options ::= db_options KEEP NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_KEEP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 13: /* db_options ::= db_options PRECISION NK_STRING */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_PRECISION, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 14: /* db_options ::= db_options QUORUM NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_QUORUM, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 15: /* db_options ::= db_options REPLICA NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_REPLICA, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 16: /* db_options ::= db_options TTL NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_TTL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 17: /* db_options ::= db_options WAL NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_WAL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 18: /* db_options ::= db_options VGROUPS NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_VGROUPS, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 19: /* db_options ::= db_options SINGLESTABLE NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_SINGLESTABLE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 20: /* db_options ::= db_options STREAMMODE NK_INTEGER */
{ yylhsminor.yy27 = setDatabaseOption(pCxt, yymsp[-2].minor.yy27, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy27 = yylhsminor.yy27;
{ yylhsminor.yy199 = setDatabaseOption(pCxt, yymsp[-2].minor.yy199, DB_OPTION_STREAMMODE, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy199 = yylhsminor.yy199;
break;
case 21: /* cmd ::= USE db_name */
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy105);}
{ pCxt->pRootNode = createUseDatabaseStmt(pCxt, &yymsp[0].minor.yy209);}
break;
case 22: /* cmd ::= CREATE TABLE exists_opt full_table_name NK_LP column_def_list NK_RP table_options */
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-5].minor.yy259, &yymsp[-4].minor.yy111, yymsp[-2].minor.yy60, yymsp[0].minor.yy40);}
{ pCxt->pRootNode = createCreateTableStmt(pCxt, yymsp[-5].minor.yy137, &yymsp[-4].minor.yy57, yymsp[-2].minor.yy64, yymsp[0].minor.yy46);}
break;
case 23: /* full_table_name ::= NK_ID */
{ STokenPair t = { .first = yymsp[0].minor.yy0, .second = nil_token}; yylhsminor.yy111 = t; }
yymsp[0].minor.yy111 = yylhsminor.yy111;
{ STokenPair t = { .first = nil_token, .second = yymsp[0].minor.yy0 }; yylhsminor.yy57 = t; }
yymsp[0].minor.yy57 = yylhsminor.yy57;
break;
case 24: /* full_table_name ::= NK_ID NK_DOT NK_ID */
{ STokenPair t = { .first = yymsp[-2].minor.yy0, .second = yymsp[0].minor.yy0}; yylhsminor.yy111 = t; }
yymsp[-2].minor.yy111 = yylhsminor.yy111;
{ STokenPair t = { .first = yymsp[-2].minor.yy0, .second = yymsp[0].minor.yy0 }; yylhsminor.yy57 = t; }
yymsp[-2].minor.yy57 = yylhsminor.yy57;
break;
case 25: /* column_def_list ::= column_def */
{ yylhsminor.yy60 = createNodeList(pCxt, yymsp[0].minor.yy172); }
yymsp[0].minor.yy60 = yylhsminor.yy60;
{ yylhsminor.yy64 = createNodeList(pCxt, yymsp[0].minor.yy272); }
yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
case 26: /* column_def_list ::= column_def_list NK_COMMA column_def */
{ yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); }
yymsp[-2].minor.yy60 = yylhsminor.yy60;
{ yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, yymsp[0].minor.yy272); }
yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
case 27: /* column_def ::= column_name type_name */
{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy105, yymsp[0].minor.yy248, NULL); }
yymsp[-1].minor.yy172 = yylhsminor.yy172;
{ yylhsminor.yy272 = createColumnDefNode(pCxt, &yymsp[-1].minor.yy209, yymsp[0].minor.yy304, NULL); }
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 28: /* column_def ::= column_name type_name COMMENT NK_STRING */
{ yylhsminor.yy172 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-2].minor.yy248, &yymsp[0].minor.yy0); }
yymsp[-3].minor.yy172 = yylhsminor.yy172;
{ yylhsminor.yy272 = createColumnDefNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-2].minor.yy304, &yymsp[0].minor.yy0); }
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 29: /* type_name ::= BOOL */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BOOL); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BOOL); }
break;
case 30: /* type_name ::= TINYINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TINYINT); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_TINYINT); }
break;
case 31: /* type_name ::= SMALLINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_SMALLINT); }
break;
case 32: /* type_name ::= INT */
case 33: /* type_name ::= INTEGER */ yytestcase(yyruleno==33);
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_INT); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_INT); }
break;
case 34: /* type_name ::= BIGINT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BIGINT); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BIGINT); }
break;
case 35: /* type_name ::= FLOAT */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_FLOAT); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_FLOAT); }
break;
case 36: /* type_name ::= DOUBLE */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_DOUBLE); }
break;
case 37: /* type_name ::= BINARY NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_BINARY, &yymsp[-1].minor.yy0); }
break;
case 38: /* type_name ::= TIMESTAMP */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_TIMESTAMP); }
break;
case 39: /* type_name ::= NCHAR NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_NCHAR, &yymsp[-1].minor.yy0); }
break;
case 40: /* type_name ::= TINYINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UTINYINT); }
break;
case 41: /* type_name ::= SMALLINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_USMALLINT); }
break;
case 42: /* type_name ::= INT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UINT); }
{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UINT); }
break;
case 43: /* type_name ::= BIGINT UNSIGNED */
{ yymsp[-1].minor.yy248 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
{ yymsp[-1].minor.yy304 = createDataType(TSDB_DATA_TYPE_UBIGINT); }
break;
case 44: /* type_name ::= JSON */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_JSON); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_JSON); }
break;
case 45: /* type_name ::= VARCHAR NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_VARCHAR, &yymsp[-1].minor.yy0); }
break;
case 46: /* type_name ::= MEDIUMBLOB */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_MEDIUMBLOB); }
break;
case 47: /* type_name ::= BLOB */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_BLOB); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_BLOB); }
break;
case 48: /* type_name ::= VARBINARY NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
{ yymsp[-3].minor.yy304 = createVarLenDataType(TSDB_DATA_TYPE_VARBINARY, &yymsp[-1].minor.yy0); }
break;
case 49: /* type_name ::= DECIMAL */
{ yymsp[0].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
{ yymsp[0].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 50: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_RP */
{ yymsp[-3].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
{ yymsp[-3].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 51: /* type_name ::= DECIMAL NK_LP NK_INTEGER NK_COMMA NK_INTEGER NK_RP */
{ yymsp[-5].minor.yy248 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
{ yymsp[-5].minor.yy304 = createDataType(TSDB_DATA_TYPE_DECIMAL); }
break;
case 52: /* table_options ::= */
{ yymsp[1].minor.yy40 = createDefaultTableOptions(pCxt);}
{ yymsp[1].minor.yy46 = createDefaultTableOptions(pCxt);}
break;
case 53: /* table_options ::= table_options COMMENT NK_INTEGER */
{ yylhsminor.yy40 = setTableOption(pCxt, yymsp[-2].minor.yy40, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy40 = yylhsminor.yy40;
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_COMMENT, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break;
case 54: /* table_options ::= table_options KEEP NK_INTEGER */
{ yylhsminor.yy40 = setTableOption(pCxt, yymsp[-2].minor.yy40, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy40 = yylhsminor.yy40;
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_KEEP, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break;
case 55: /* table_options ::= table_options TTL NK_INTEGER */
{ yylhsminor.yy40 = setTableOption(pCxt, yymsp[-2].minor.yy40, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy40 = yylhsminor.yy40;
{ yylhsminor.yy46 = setTableOption(pCxt, yymsp[-2].minor.yy46, TABLE_OPTION_TTL, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy46 = yylhsminor.yy46;
break;
case 56: /* cmd ::= SHOW DATABASES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASE_STMT); }
break;
case 57: /* cmd ::= query_expression */
{ PARSER_TRACE; pCxt->pRootNode = yymsp[0].minor.yy172; }
break;
case 58: /* literal ::= NK_INTEGER */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 59: /* literal ::= NK_FLOAT */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 60: /* literal ::= NK_STRING */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 61: /* literal ::= NK_BOOL */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 62: /* literal ::= TIMESTAMP NK_STRING */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
yymsp[-1].minor.yy172 = yylhsminor.yy172;
break;
case 63: /* literal ::= duration_literal */
case 73: /* expression ::= literal */ yytestcase(yyruleno==73);
case 74: /* expression ::= column_reference */ yytestcase(yyruleno==74);
case 77: /* expression ::= subquery */ yytestcase(yyruleno==77);
case 109: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==109);
case 113: /* boolean_primary ::= predicate */ yytestcase(yyruleno==113);
case 118: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==118);
case 120: /* table_reference ::= table_primary */ yytestcase(yyruleno==120);
case 121: /* table_reference ::= joined_table */ yytestcase(yyruleno==121);
case 125: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==125);
case 172: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==172);
case 174: /* query_primary ::= query_specification */ yytestcase(yyruleno==174);
{ PARSER_TRACE; yylhsminor.yy172 = yymsp[0].minor.yy172; }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 64: /* duration_literal ::= NK_VARIABLE */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
break;
case 65: /* literal_list ::= literal */
case 86: /* expression_list ::= expression */ yytestcase(yyruleno==86);
{ PARSER_TRACE; yylhsminor.yy60 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); }
yymsp[0].minor.yy60 = yylhsminor.yy60;
break;
case 66: /* literal_list ::= literal_list NK_COMMA literal */
case 87: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==87);
{ PARSER_TRACE; yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, releaseRawExprNode(pCxt, yymsp[0].minor.yy172)); }
yymsp[-2].minor.yy60 = yylhsminor.yy60;
break;
case 67: /* db_name ::= NK_ID */
case 68: /* table_name ::= NK_ID */ yytestcase(yyruleno==68);
case 69: /* column_name ::= NK_ID */ yytestcase(yyruleno==69);
case 70: /* function_name ::= NK_ID */ yytestcase(yyruleno==70);
case 71: /* table_alias ::= NK_ID */ yytestcase(yyruleno==71);
case 72: /* column_alias ::= NK_ID */ yytestcase(yyruleno==72);
{ PARSER_TRACE; yylhsminor.yy105 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy105 = yylhsminor.yy105;
break;
case 75: /* expression ::= function_name NK_LP expression_list NK_RP */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy105, yymsp[-1].minor.yy60)); }
yymsp[-3].minor.yy172 = yylhsminor.yy172;
break;
case 76: /* expression ::= function_name NK_LP NK_STAR NK_RP */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy105, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy105, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
yymsp[-3].minor.yy172 = yylhsminor.yy172;
break;
case 78: /* expression ::= NK_LP expression NK_RP */
case 114: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==114);
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
break;
case 79: /* expression ::= NK_PLUS expression */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_DATABASES_STMT); }
break;
case 57: /* cmd ::= SHOW TABLES */
{ pCxt->pRootNode = createShowStmt(pCxt, QUERY_NODE_SHOW_TABLES_STMT); }
break;
case 58: /* cmd ::= query_expression */
{ PARSER_TRACE; pCxt->pRootNode = yymsp[0].minor.yy272; }
break;
case 59: /* literal ::= NK_INTEGER */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BIGINT, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 60: /* literal ::= NK_FLOAT */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_DOUBLE, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 61: /* literal ::= NK_STRING */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BINARY, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 62: /* literal ::= NK_BOOL */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_BOOL, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 63: /* literal ::= TIMESTAMP NK_STRING */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0, createValueNode(pCxt, TSDB_DATA_TYPE_TIMESTAMP, &yymsp[0].minor.yy0)); }
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 64: /* literal ::= duration_literal */
case 74: /* expression ::= literal */ yytestcase(yyruleno==74);
case 75: /* expression ::= column_reference */ yytestcase(yyruleno==75);
case 78: /* expression ::= subquery */ yytestcase(yyruleno==78);
case 110: /* boolean_value_expression ::= boolean_primary */ yytestcase(yyruleno==110);
case 114: /* boolean_primary ::= predicate */ yytestcase(yyruleno==114);
case 119: /* table_reference_list ::= table_reference */ yytestcase(yyruleno==119);
case 121: /* table_reference ::= table_primary */ yytestcase(yyruleno==121);
case 122: /* table_reference ::= joined_table */ yytestcase(yyruleno==122);
case 126: /* table_primary ::= parenthesized_joined_table */ yytestcase(yyruleno==126);
case 173: /* query_expression_body ::= query_primary */ yytestcase(yyruleno==173);
case 175: /* query_primary ::= query_specification */ yytestcase(yyruleno==175);
{ PARSER_TRACE; yylhsminor.yy272 = yymsp[0].minor.yy272; }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 65: /* duration_literal ::= NK_VARIABLE */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy0, createDurationValueNode(pCxt, &yymsp[0].minor.yy0)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 66: /* literal_list ::= literal */
case 87: /* expression_list ::= expression */ yytestcase(yyruleno==87);
{ PARSER_TRACE; yylhsminor.yy64 = createNodeList(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272)); }
yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
case 67: /* literal_list ::= literal_list NK_COMMA literal */
case 88: /* expression_list ::= expression_list NK_COMMA expression */ yytestcase(yyruleno==88);
{ PARSER_TRACE; yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, releaseRawExprNode(pCxt, yymsp[0].minor.yy272)); }
yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
case 68: /* db_name ::= NK_ID */
case 69: /* table_name ::= NK_ID */ yytestcase(yyruleno==69);
case 70: /* column_name ::= NK_ID */ yytestcase(yyruleno==70);
case 71: /* function_name ::= NK_ID */ yytestcase(yyruleno==71);
case 72: /* table_alias ::= NK_ID */ yytestcase(yyruleno==72);
case 73: /* column_alias ::= NK_ID */ yytestcase(yyruleno==73);
{ PARSER_TRACE; yylhsminor.yy209 = yymsp[0].minor.yy0; }
yymsp[0].minor.yy209 = yylhsminor.yy209;
break;
case 76: /* expression ::= function_name NK_LP expression_list NK_RP */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy209, yymsp[-1].minor.yy64)); }
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 77: /* expression ::= function_name NK_LP NK_STAR NK_RP */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-3].minor.yy209, &yymsp[0].minor.yy0, createFunctionNode(pCxt, &yymsp[-3].minor.yy209, createNodeList(pCxt, createColumnNode(pCxt, NULL, &yymsp[-1].minor.yy0)))); }
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 79: /* expression ::= NK_LP expression NK_RP */
case 115: /* boolean_primary ::= NK_LP boolean_value_expression NK_RP */ yytestcase(yyruleno==115);
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 80: /* expression ::= NK_PLUS expression */
{
PARSER_TRACE;
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy172));
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, releaseRawExprNode(pCxt, yymsp[0].minor.yy272));
}
yymsp[-1].minor.yy172 = yylhsminor.yy172;
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 80: /* expression ::= NK_MINUS expression */
case 81: /* expression ::= NK_MINUS expression */
{
PARSER_TRACE;
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL));
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &t, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[0].minor.yy272), NULL));
}
yymsp[-1].minor.yy172 = yylhsminor.yy172;
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 81: /* expression ::= expression NK_PLUS expression */
case 82: /* expression ::= expression NK_PLUS expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_ADD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 82: /* expression ::= expression NK_MINUS expression */
case 83: /* expression ::= expression NK_MINUS expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_SUB, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 83: /* expression ::= expression NK_STAR expression */
case 84: /* expression ::= expression NK_STAR expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MULTI, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 84: /* expression ::= expression NK_SLASH expression */
case 85: /* expression ::= expression NK_SLASH expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_DIV, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 85: /* expression ::= expression NK_REM expression */
case 86: /* expression ::= expression NK_REM expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, OP_TYPE_MOD, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 88: /* column_reference ::= column_name */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNode(pCxt, &yymsp[0].minor.yy105, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy105)); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
case 89: /* column_reference ::= column_name */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNode(pCxt, &yymsp[0].minor.yy209, createColumnNode(pCxt, NULL, &yymsp[0].minor.yy209)); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 89: /* column_reference ::= table_name NK_DOT column_name */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105, createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy105)); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 90: /* column_reference ::= table_name NK_DOT column_name */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209, createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy209)); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 90: /* predicate ::= expression compare_op expression */
case 95: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==95);
case 91: /* predicate ::= expression compare_op expression */
case 96: /* predicate ::= expression in_op in_predicate_value */ yytestcase(yyruleno==96);
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy214, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createOperatorNode(pCxt, yymsp[-1].minor.yy20, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 91: /* predicate ::= expression BETWEEN expression AND expression */
case 92: /* predicate ::= expression BETWEEN expression AND expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy172), releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-4].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-4].minor.yy272), releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-4].minor.yy172 = yylhsminor.yy172;
yymsp[-4].minor.yy272 = yylhsminor.yy272;
break;
case 92: /* predicate ::= expression NOT BETWEEN expression AND expression */
case 93: /* predicate ::= expression NOT BETWEEN expression AND expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[-5].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-5].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createNotBetweenAnd(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[-5].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-5].minor.yy172 = yylhsminor.yy172;
yymsp[-5].minor.yy272 = yylhsminor.yy272;
break;
case 93: /* predicate ::= expression IS NULL */
case 94: /* predicate ::= expression IS NULL */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), NULL));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NULL, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), NULL));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 94: /* predicate ::= expression IS NOT NULL */
case 95: /* predicate ::= expression IS NOT NULL */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), NULL));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-3].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &yymsp[0].minor.yy0, createOperatorNode(pCxt, OP_TYPE_IS_NOT_NULL, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), NULL));
}
yymsp[-3].minor.yy172 = yylhsminor.yy172;
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 96: /* compare_op ::= NK_LT */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_LOWER_THAN; }
case 97: /* compare_op ::= NK_LT */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_LOWER_THAN; }
break;
case 97: /* compare_op ::= NK_GT */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_GREATER_THAN; }
case 98: /* compare_op ::= NK_GT */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_GREATER_THAN; }
break;
case 98: /* compare_op ::= NK_LE */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_LOWER_EQUAL; }
case 99: /* compare_op ::= NK_LE */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_LOWER_EQUAL; }
break;
case 99: /* compare_op ::= NK_GE */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_GREATER_EQUAL; }
case 100: /* compare_op ::= NK_GE */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_GREATER_EQUAL; }
break;
case 100: /* compare_op ::= NK_NE */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_NOT_EQUAL; }
case 101: /* compare_op ::= NK_NE */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_NOT_EQUAL; }
break;
case 101: /* compare_op ::= NK_EQ */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_EQUAL; }
case 102: /* compare_op ::= NK_EQ */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_EQUAL; }
break;
case 102: /* compare_op ::= LIKE */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_LIKE; }
case 103: /* compare_op ::= LIKE */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_LIKE; }
break;
case 103: /* compare_op ::= NOT LIKE */
{ PARSER_TRACE; yymsp[-1].minor.yy214 = OP_TYPE_NOT_LIKE; }
case 104: /* compare_op ::= NOT LIKE */
{ PARSER_TRACE; yymsp[-1].minor.yy20 = OP_TYPE_NOT_LIKE; }
break;
case 104: /* compare_op ::= MATCH */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_MATCH; }
case 105: /* compare_op ::= MATCH */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_MATCH; }
break;
case 105: /* compare_op ::= NMATCH */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_NMATCH; }
case 106: /* compare_op ::= NMATCH */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_NMATCH; }
break;
case 106: /* in_op ::= IN */
{ PARSER_TRACE; yymsp[0].minor.yy214 = OP_TYPE_IN; }
case 107: /* in_op ::= IN */
{ PARSER_TRACE; yymsp[0].minor.yy20 = OP_TYPE_IN; }
break;
case 107: /* in_op ::= NOT IN */
{ PARSER_TRACE; yymsp[-1].minor.yy214 = OP_TYPE_NOT_IN; }
case 108: /* in_op ::= NOT IN */
{ PARSER_TRACE; yymsp[-1].minor.yy20 = OP_TYPE_NOT_IN; }
break;
case 108: /* in_predicate_value ::= NK_LP expression_list NK_RP */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 109: /* in_predicate_value ::= NK_LP expression_list NK_RP */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 110: /* boolean_value_expression ::= NOT boolean_primary */
case 111: /* boolean_value_expression ::= NOT boolean_primary */
{
PARSER_TRACE;
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), NULL));
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-1].minor.yy0, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_NOT, releaseRawExprNode(pCxt, yymsp[0].minor.yy272), NULL));
}
yymsp[-1].minor.yy172 = yylhsminor.yy172;
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 111: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
case 112: /* boolean_value_expression ::= boolean_value_expression OR boolean_value_expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_OR, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 112: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
case 113: /* boolean_value_expression ::= boolean_value_expression AND boolean_value_expression */
{
PARSER_TRACE;
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy172);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), releaseRawExprNode(pCxt, yymsp[0].minor.yy172)));
SToken s = getTokenFromRawExprNode(pCxt, yymsp[-2].minor.yy272);
SToken e = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = createRawExprNodeExt(pCxt, &s, &e, createLogicConditionNode(pCxt, LOGIC_COND_TYPE_AND, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), releaseRawExprNode(pCxt, yymsp[0].minor.yy272)));
}
yymsp[-2].minor.yy172 = yylhsminor.yy172;
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 115: /* common_expression ::= expression */
case 116: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==116);
{ yylhsminor.yy172 = yymsp[0].minor.yy172; }
yymsp[0].minor.yy172 = yylhsminor.yy172;
case 116: /* common_expression ::= expression */
case 117: /* common_expression ::= boolean_value_expression */ yytestcase(yyruleno==117);
{ yylhsminor.yy272 = yymsp[0].minor.yy272; }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 117: /* from_clause ::= FROM table_reference_list */
case 147: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==147);
case 170: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==170);
{ PARSER_TRACE; yymsp[-1].minor.yy172 = yymsp[0].minor.yy172; }
case 118: /* from_clause ::= FROM table_reference_list */
case 148: /* where_clause_opt ::= WHERE search_condition */ yytestcase(yyruleno==148);
case 171: /* having_clause_opt ::= HAVING search_condition */ yytestcase(yyruleno==171);
{ PARSER_TRACE; yymsp[-1].minor.yy272 = yymsp[0].minor.yy272; }
break;
case 119: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ PARSER_TRACE; yylhsminor.yy172 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy172, yymsp[0].minor.yy172, NULL); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 120: /* table_reference_list ::= table_reference_list NK_COMMA table_reference */
{ PARSER_TRACE; yylhsminor.yy272 = createJoinTableNode(pCxt, JOIN_TYPE_INNER, yymsp[-2].minor.yy272, yymsp[0].minor.yy272, NULL); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 122: /* table_primary ::= table_name alias_opt */
{ PARSER_TRACE; yylhsminor.yy172 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
yymsp[-1].minor.yy172 = yylhsminor.yy172;
case 123: /* table_primary ::= table_name alias_opt */
{ PARSER_TRACE; yylhsminor.yy272 = createRealTableNode(pCxt, NULL, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); }
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 123: /* table_primary ::= db_name NK_DOT table_name alias_opt */
{ PARSER_TRACE; yylhsminor.yy172 = createRealTableNode(pCxt, &yymsp[-3].minor.yy105, &yymsp[-1].minor.yy105, &yymsp[0].minor.yy105); }
yymsp[-3].minor.yy172 = yylhsminor.yy172;
case 124: /* table_primary ::= db_name NK_DOT table_name alias_opt */
{ PARSER_TRACE; yylhsminor.yy272 = createRealTableNode(pCxt, &yymsp[-3].minor.yy209, &yymsp[-1].minor.yy209, &yymsp[0].minor.yy209); }
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 124: /* table_primary ::= subquery alias_opt */
{ PARSER_TRACE; yylhsminor.yy172 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); }
yymsp[-1].minor.yy172 = yylhsminor.yy172;
case 125: /* table_primary ::= subquery alias_opt */
{ PARSER_TRACE; yylhsminor.yy272 = createTempTableNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272), &yymsp[0].minor.yy209); }
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 126: /* alias_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy105 = nil_token; }
case 127: /* alias_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy209 = nil_token; }
break;
case 127: /* alias_opt ::= table_alias */
{ PARSER_TRACE; yylhsminor.yy105 = yymsp[0].minor.yy105; }
yymsp[0].minor.yy105 = yylhsminor.yy105;
case 128: /* alias_opt ::= table_alias */
{ PARSER_TRACE; yylhsminor.yy209 = yymsp[0].minor.yy209; }
yymsp[0].minor.yy209 = yylhsminor.yy209;
break;
case 128: /* alias_opt ::= AS table_alias */
{ PARSER_TRACE; yymsp[-1].minor.yy105 = yymsp[0].minor.yy105; }
case 129: /* alias_opt ::= AS table_alias */
{ PARSER_TRACE; yymsp[-1].minor.yy209 = yymsp[0].minor.yy209; }
break;
case 129: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case 130: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==130);
{ PARSER_TRACE; yymsp[-2].minor.yy172 = yymsp[-1].minor.yy172; }
case 130: /* parenthesized_joined_table ::= NK_LP joined_table NK_RP */
case 131: /* parenthesized_joined_table ::= NK_LP parenthesized_joined_table NK_RP */ yytestcase(yyruleno==131);
{ PARSER_TRACE; yymsp[-2].minor.yy272 = yymsp[-1].minor.yy272; }
break;
case 131: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ PARSER_TRACE; yylhsminor.yy172 = createJoinTableNode(pCxt, yymsp[-4].minor.yy278, yymsp[-5].minor.yy172, yymsp[-2].minor.yy172, yymsp[0].minor.yy172); }
yymsp[-5].minor.yy172 = yylhsminor.yy172;
case 132: /* joined_table ::= table_reference join_type JOIN table_reference ON search_condition */
{ PARSER_TRACE; yylhsminor.yy272 = createJoinTableNode(pCxt, yymsp[-4].minor.yy252, yymsp[-5].minor.yy272, yymsp[-2].minor.yy272, yymsp[0].minor.yy272); }
yymsp[-5].minor.yy272 = yylhsminor.yy272;
break;
case 132: /* join_type ::= */
{ PARSER_TRACE; yymsp[1].minor.yy278 = JOIN_TYPE_INNER; }
case 133: /* join_type ::= */
{ PARSER_TRACE; yymsp[1].minor.yy252 = JOIN_TYPE_INNER; }
break;
case 133: /* join_type ::= INNER */
{ PARSER_TRACE; yymsp[0].minor.yy278 = JOIN_TYPE_INNER; }
case 134: /* join_type ::= INNER */
{ PARSER_TRACE; yymsp[0].minor.yy252 = JOIN_TYPE_INNER; }
break;
case 134: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
case 135: /* query_specification ::= SELECT set_quantifier_opt select_list from_clause where_clause_opt partition_by_clause_opt twindow_clause_opt group_by_clause_opt having_clause_opt */
{
PARSER_TRACE;
yymsp[-8].minor.yy172 = createSelectStmt(pCxt, yymsp[-7].minor.yy259, yymsp[-6].minor.yy60, yymsp[-5].minor.yy172);
yymsp[-8].minor.yy172 = addWhereClause(pCxt, yymsp[-8].minor.yy172, yymsp[-4].minor.yy172);
yymsp[-8].minor.yy172 = addPartitionByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-3].minor.yy60);
yymsp[-8].minor.yy172 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy172, yymsp[-2].minor.yy172);
yymsp[-8].minor.yy172 = addGroupByClause(pCxt, yymsp[-8].minor.yy172, yymsp[-1].minor.yy60);
yymsp[-8].minor.yy172 = addHavingClause(pCxt, yymsp[-8].minor.yy172, yymsp[0].minor.yy172);
yymsp[-8].minor.yy272 = createSelectStmt(pCxt, yymsp[-7].minor.yy137, yymsp[-6].minor.yy64, yymsp[-5].minor.yy272);
yymsp[-8].minor.yy272 = addWhereClause(pCxt, yymsp[-8].minor.yy272, yymsp[-4].minor.yy272);
yymsp[-8].minor.yy272 = addPartitionByClause(pCxt, yymsp[-8].minor.yy272, yymsp[-3].minor.yy64);
yymsp[-8].minor.yy272 = addWindowClauseClause(pCxt, yymsp[-8].minor.yy272, yymsp[-2].minor.yy272);
yymsp[-8].minor.yy272 = addGroupByClause(pCxt, yymsp[-8].minor.yy272, yymsp[-1].minor.yy64);
yymsp[-8].minor.yy272 = addHavingClause(pCxt, yymsp[-8].minor.yy272, yymsp[0].minor.yy272);
}
break;
case 135: /* set_quantifier_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy259 = false; }
case 136: /* set_quantifier_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy137 = false; }
break;
case 136: /* set_quantifier_opt ::= DISTINCT */
{ PARSER_TRACE; yymsp[0].minor.yy259 = true; }
case 137: /* set_quantifier_opt ::= DISTINCT */
{ PARSER_TRACE; yymsp[0].minor.yy137 = true; }
break;
case 137: /* set_quantifier_opt ::= ALL */
{ PARSER_TRACE; yymsp[0].minor.yy259 = false; }
case 138: /* set_quantifier_opt ::= ALL */
{ PARSER_TRACE; yymsp[0].minor.yy137 = false; }
break;
case 138: /* select_list ::= NK_STAR */
{ PARSER_TRACE; yymsp[0].minor.yy60 = NULL; }
case 139: /* select_list ::= NK_STAR */
{ PARSER_TRACE; yymsp[0].minor.yy64 = NULL; }
break;
case 139: /* select_list ::= select_sublist */
{ PARSER_TRACE; yylhsminor.yy60 = yymsp[0].minor.yy60; }
yymsp[0].minor.yy60 = yylhsminor.yy60;
case 140: /* select_list ::= select_sublist */
{ PARSER_TRACE; yylhsminor.yy64 = yymsp[0].minor.yy64; }
yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
case 140: /* select_sublist ::= select_item */
case 187: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==187);
{ PARSER_TRACE; yylhsminor.yy60 = createNodeList(pCxt, yymsp[0].minor.yy172); }
yymsp[0].minor.yy60 = yylhsminor.yy60;
case 141: /* select_sublist ::= select_item */
case 188: /* sort_specification_list ::= sort_specification */ yytestcase(yyruleno==188);
{ PARSER_TRACE; yylhsminor.yy64 = createNodeList(pCxt, yymsp[0].minor.yy272); }
yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
case 141: /* select_sublist ::= select_sublist NK_COMMA select_item */
case 188: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==188);
{ PARSER_TRACE; yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, yymsp[0].minor.yy172); }
yymsp[-2].minor.yy60 = yylhsminor.yy60;
case 142: /* select_sublist ::= select_sublist NK_COMMA select_item */
case 189: /* sort_specification_list ::= sort_specification_list NK_COMMA sort_specification */ yytestcase(yyruleno==189);
{ PARSER_TRACE; yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, yymsp[0].minor.yy272); }
yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
case 142: /* select_item ::= common_expression */
case 143: /* select_item ::= common_expression */
{
PARSER_TRACE;
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy172);
yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172), &t);
SToken t = getTokenFromRawExprNode(pCxt, yymsp[0].minor.yy272);
yylhsminor.yy272 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272), &t);
}
yymsp[0].minor.yy172 = yylhsminor.yy172;
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 143: /* select_item ::= common_expression column_alias */
{ PARSER_TRACE; yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172), &yymsp[0].minor.yy105); }
yymsp[-1].minor.yy172 = yylhsminor.yy172;
case 144: /* select_item ::= common_expression column_alias */
{ PARSER_TRACE; yylhsminor.yy272 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272), &yymsp[0].minor.yy209); }
yymsp[-1].minor.yy272 = yylhsminor.yy272;
break;
case 144: /* select_item ::= common_expression AS column_alias */
{ PARSER_TRACE; yylhsminor.yy172 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), &yymsp[0].minor.yy105); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 145: /* select_item ::= common_expression AS column_alias */
{ PARSER_TRACE; yylhsminor.yy272 = setProjectionAlias(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), &yymsp[0].minor.yy209); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 145: /* select_item ::= table_name NK_DOT NK_STAR */
{ PARSER_TRACE; yylhsminor.yy172 = createColumnNode(pCxt, &yymsp[-2].minor.yy105, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 146: /* select_item ::= table_name NK_DOT NK_STAR */
{ PARSER_TRACE; yylhsminor.yy272 = createColumnNode(pCxt, &yymsp[-2].minor.yy209, &yymsp[0].minor.yy0); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 146: /* where_clause_opt ::= */
case 150: /* twindow_clause_opt ::= */ yytestcase(yyruleno==150);
case 155: /* sliding_opt ::= */ yytestcase(yyruleno==155);
case 157: /* fill_opt ::= */ yytestcase(yyruleno==157);
case 169: /* having_clause_opt ::= */ yytestcase(yyruleno==169);
case 177: /* slimit_clause_opt ::= */ yytestcase(yyruleno==177);
case 181: /* limit_clause_opt ::= */ yytestcase(yyruleno==181);
{ PARSER_TRACE; yymsp[1].minor.yy172 = NULL; }
case 147: /* where_clause_opt ::= */
case 151: /* twindow_clause_opt ::= */ yytestcase(yyruleno==151);
case 156: /* sliding_opt ::= */ yytestcase(yyruleno==156);
case 158: /* fill_opt ::= */ yytestcase(yyruleno==158);
case 170: /* having_clause_opt ::= */ yytestcase(yyruleno==170);
case 178: /* slimit_clause_opt ::= */ yytestcase(yyruleno==178);
case 182: /* limit_clause_opt ::= */ yytestcase(yyruleno==182);
{ PARSER_TRACE; yymsp[1].minor.yy272 = NULL; }
break;
case 148: /* partition_by_clause_opt ::= */
case 165: /* group_by_clause_opt ::= */ yytestcase(yyruleno==165);
case 175: /* order_by_clause_opt ::= */ yytestcase(yyruleno==175);
{ PARSER_TRACE; yymsp[1].minor.yy60 = NULL; }
case 149: /* partition_by_clause_opt ::= */
case 166: /* group_by_clause_opt ::= */ yytestcase(yyruleno==166);
case 176: /* order_by_clause_opt ::= */ yytestcase(yyruleno==176);
{ PARSER_TRACE; yymsp[1].minor.yy64 = NULL; }
break;
case 149: /* partition_by_clause_opt ::= PARTITION BY expression_list */
case 166: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==166);
case 176: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==176);
{ PARSER_TRACE; yymsp[-2].minor.yy60 = yymsp[0].minor.yy60; }
case 150: /* partition_by_clause_opt ::= PARTITION BY expression_list */
case 167: /* group_by_clause_opt ::= GROUP BY group_by_list */ yytestcase(yyruleno==167);
case 177: /* order_by_clause_opt ::= ORDER BY sort_specification_list */ yytestcase(yyruleno==177);
{ PARSER_TRACE; yymsp[-2].minor.yy64 = yymsp[0].minor.yy64; }
break;
case 151: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
{ PARSER_TRACE; yymsp[-5].minor.yy172 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy172), &yymsp[-1].minor.yy0); }
case 152: /* twindow_clause_opt ::= SESSION NK_LP column_reference NK_COMMA NK_INTEGER NK_RP */
{ PARSER_TRACE; yymsp[-5].minor.yy272 = createSessionWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-3].minor.yy272), &yymsp[-1].minor.yy0); }
break;
case 152: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy172 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy172)); }
case 153: /* twindow_clause_opt ::= STATE_WINDOW NK_LP column_reference NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy272 = createStateWindowNode(pCxt, releaseRawExprNode(pCxt, yymsp[-1].minor.yy272)); }
break;
case 153: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ PARSER_TRACE; yymsp[-5].minor.yy172 = createIntervalWindowNode(pCxt, yymsp[-3].minor.yy172, NULL, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
case 154: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_RP sliding_opt fill_opt */
{ PARSER_TRACE; yymsp[-5].minor.yy272 = createIntervalWindowNode(pCxt, yymsp[-3].minor.yy272, NULL, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); }
break;
case 154: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ PARSER_TRACE; yymsp[-7].minor.yy172 = createIntervalWindowNode(pCxt, yymsp[-5].minor.yy172, yymsp[-3].minor.yy172, yymsp[-1].minor.yy172, yymsp[0].minor.yy172); }
case 155: /* twindow_clause_opt ::= INTERVAL NK_LP duration_literal NK_COMMA duration_literal NK_RP sliding_opt fill_opt */
{ PARSER_TRACE; yymsp[-7].minor.yy272 = createIntervalWindowNode(pCxt, yymsp[-5].minor.yy272, yymsp[-3].minor.yy272, yymsp[-1].minor.yy272, yymsp[0].minor.yy272); }
break;
case 156: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy172 = yymsp[-1].minor.yy172; }
case 157: /* sliding_opt ::= SLIDING NK_LP duration_literal NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy272 = yymsp[-1].minor.yy272; }
break;
case 158: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy172 = createFillNode(pCxt, yymsp[-1].minor.yy202, NULL); }
case 159: /* fill_opt ::= FILL NK_LP fill_mode NK_RP */
{ PARSER_TRACE; yymsp[-3].minor.yy272 = createFillNode(pCxt, yymsp[-1].minor.yy54, NULL); }
break;
case 159: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ PARSER_TRACE; yymsp[-5].minor.yy172 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy60)); }
case 160: /* fill_opt ::= FILL NK_LP VALUE NK_COMMA literal_list NK_RP */
{ PARSER_TRACE; yymsp[-5].minor.yy272 = createFillNode(pCxt, FILL_MODE_VALUE, createNodeListNode(pCxt, yymsp[-1].minor.yy64)); }
break;
case 160: /* fill_mode ::= NONE */
{ PARSER_TRACE; yymsp[0].minor.yy202 = FILL_MODE_NONE; }
case 161: /* fill_mode ::= NONE */
{ PARSER_TRACE; yymsp[0].minor.yy54 = FILL_MODE_NONE; }
break;
case 161: /* fill_mode ::= PREV */
{ PARSER_TRACE; yymsp[0].minor.yy202 = FILL_MODE_PREV; }
case 162: /* fill_mode ::= PREV */
{ PARSER_TRACE; yymsp[0].minor.yy54 = FILL_MODE_PREV; }
break;
case 162: /* fill_mode ::= NULL */
{ PARSER_TRACE; yymsp[0].minor.yy202 = FILL_MODE_NULL; }
case 163: /* fill_mode ::= NULL */
{ PARSER_TRACE; yymsp[0].minor.yy54 = FILL_MODE_NULL; }
break;
case 163: /* fill_mode ::= LINEAR */
{ PARSER_TRACE; yymsp[0].minor.yy202 = FILL_MODE_LINEAR; }
case 164: /* fill_mode ::= LINEAR */
{ PARSER_TRACE; yymsp[0].minor.yy54 = FILL_MODE_LINEAR; }
break;
case 164: /* fill_mode ::= NEXT */
{ PARSER_TRACE; yymsp[0].minor.yy202 = FILL_MODE_NEXT; }
case 165: /* fill_mode ::= NEXT */
{ PARSER_TRACE; yymsp[0].minor.yy54 = FILL_MODE_NEXT; }
break;
case 167: /* group_by_list ::= expression */
{ PARSER_TRACE; yylhsminor.yy60 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); }
yymsp[0].minor.yy60 = yylhsminor.yy60;
case 168: /* group_by_list ::= expression */
{ PARSER_TRACE; yylhsminor.yy64 = createNodeList(pCxt, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); }
yymsp[0].minor.yy64 = yylhsminor.yy64;
break;
case 168: /* group_by_list ::= group_by_list NK_COMMA expression */
{ PARSER_TRACE; yylhsminor.yy60 = addNodeToList(pCxt, yymsp[-2].minor.yy60, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy172))); }
yymsp[-2].minor.yy60 = yylhsminor.yy60;
case 169: /* group_by_list ::= group_by_list NK_COMMA expression */
{ PARSER_TRACE; yylhsminor.yy64 = addNodeToList(pCxt, yymsp[-2].minor.yy64, createGroupingSetNode(pCxt, releaseRawExprNode(pCxt, yymsp[0].minor.yy272))); }
yymsp[-2].minor.yy64 = yylhsminor.yy64;
break;
case 171: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
case 172: /* query_expression ::= query_expression_body order_by_clause_opt slimit_clause_opt limit_clause_opt */
{
PARSER_TRACE;
yylhsminor.yy172 = addOrderByClause(pCxt, yymsp[-3].minor.yy172, yymsp[-2].minor.yy60);
yylhsminor.yy172 = addSlimitClause(pCxt, yylhsminor.yy172, yymsp[-1].minor.yy172);
yylhsminor.yy172 = addLimitClause(pCxt, yylhsminor.yy172, yymsp[0].minor.yy172);
yylhsminor.yy272 = addOrderByClause(pCxt, yymsp[-3].minor.yy272, yymsp[-2].minor.yy64);
yylhsminor.yy272 = addSlimitClause(pCxt, yylhsminor.yy272, yymsp[-1].minor.yy272);
yylhsminor.yy272 = addLimitClause(pCxt, yylhsminor.yy272, yymsp[0].minor.yy272);
}
yymsp[-3].minor.yy172 = yylhsminor.yy172;
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 173: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ PARSER_TRACE; yylhsminor.yy172 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy172, yymsp[0].minor.yy172); }
yymsp[-3].minor.yy172 = yylhsminor.yy172;
case 174: /* query_expression_body ::= query_expression_body UNION ALL query_expression_body */
{ PARSER_TRACE; yylhsminor.yy272 = createSetOperator(pCxt, SET_OP_TYPE_UNION_ALL, yymsp[-3].minor.yy272, yymsp[0].minor.yy272); }
yymsp[-3].minor.yy272 = yylhsminor.yy272;
break;
case 178: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case 182: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==182);
{ PARSER_TRACE; yymsp[-1].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
case 179: /* slimit_clause_opt ::= SLIMIT NK_INTEGER */
case 183: /* limit_clause_opt ::= LIMIT NK_INTEGER */ yytestcase(yyruleno==183);
{ PARSER_TRACE; yymsp[-1].minor.yy272 = createLimitNode(pCxt, &yymsp[0].minor.yy0, NULL); }
break;
case 179: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case 183: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==183);
{ PARSER_TRACE; yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
case 180: /* slimit_clause_opt ::= SLIMIT NK_INTEGER SOFFSET NK_INTEGER */
case 184: /* limit_clause_opt ::= LIMIT NK_INTEGER OFFSET NK_INTEGER */ yytestcase(yyruleno==184);
{ PARSER_TRACE; yymsp[-3].minor.yy272 = createLimitNode(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0); }
break;
case 180: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case 184: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==184);
{ PARSER_TRACE; yymsp[-3].minor.yy172 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
case 181: /* slimit_clause_opt ::= SLIMIT NK_INTEGER NK_COMMA NK_INTEGER */
case 185: /* limit_clause_opt ::= LIMIT NK_INTEGER NK_COMMA NK_INTEGER */ yytestcase(yyruleno==185);
{ PARSER_TRACE; yymsp[-3].minor.yy272 = createLimitNode(pCxt, &yymsp[0].minor.yy0, &yymsp[-2].minor.yy0); }
break;
case 185: /* subquery ::= NK_LP query_expression NK_RP */
{ PARSER_TRACE; yylhsminor.yy172 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy172); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 186: /* subquery ::= NK_LP query_expression NK_RP */
{ PARSER_TRACE; yylhsminor.yy272 = createRawExprNodeExt(pCxt, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-1].minor.yy272); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 186: /* search_condition ::= common_expression */
{ PARSER_TRACE; yylhsminor.yy172 = releaseRawExprNode(pCxt, yymsp[0].minor.yy172); }
yymsp[0].minor.yy172 = yylhsminor.yy172;
case 187: /* search_condition ::= common_expression */
{ PARSER_TRACE; yylhsminor.yy272 = releaseRawExprNode(pCxt, yymsp[0].minor.yy272); }
yymsp[0].minor.yy272 = yylhsminor.yy272;
break;
case 189: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ PARSER_TRACE; yylhsminor.yy172 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy172), yymsp[-1].minor.yy14, yymsp[0].minor.yy17); }
yymsp[-2].minor.yy172 = yylhsminor.yy172;
case 190: /* sort_specification ::= expression ordering_specification_opt null_ordering_opt */
{ PARSER_TRACE; yylhsminor.yy272 = createOrderByExprNode(pCxt, releaseRawExprNode(pCxt, yymsp[-2].minor.yy272), yymsp[-1].minor.yy218, yymsp[0].minor.yy217); }
yymsp[-2].minor.yy272 = yylhsminor.yy272;
break;
case 190: /* ordering_specification_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy14 = ORDER_ASC; }
case 191: /* ordering_specification_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy218 = ORDER_ASC; }
break;
case 191: /* ordering_specification_opt ::= ASC */
{ PARSER_TRACE; yymsp[0].minor.yy14 = ORDER_ASC; }
case 192: /* ordering_specification_opt ::= ASC */
{ PARSER_TRACE; yymsp[0].minor.yy218 = ORDER_ASC; }
break;
case 192: /* ordering_specification_opt ::= DESC */
{ PARSER_TRACE; yymsp[0].minor.yy14 = ORDER_DESC; }
case 193: /* ordering_specification_opt ::= DESC */
{ PARSER_TRACE; yymsp[0].minor.yy218 = ORDER_DESC; }
break;
case 193: /* null_ordering_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy17 = NULL_ORDER_DEFAULT; }
case 194: /* null_ordering_opt ::= */
{ PARSER_TRACE; yymsp[1].minor.yy217 = NULL_ORDER_DEFAULT; }
break;
case 194: /* null_ordering_opt ::= NULLS FIRST */
{ PARSER_TRACE; yymsp[-1].minor.yy17 = NULL_ORDER_FIRST; }
case 195: /* null_ordering_opt ::= NULLS FIRST */
{ PARSER_TRACE; yymsp[-1].minor.yy217 = NULL_ORDER_FIRST; }
break;
case 195: /* null_ordering_opt ::= NULLS LAST */
{ PARSER_TRACE; yymsp[-1].minor.yy17 = NULL_ORDER_LAST; }
case 196: /* null_ordering_opt ::= NULLS LAST */
{ PARSER_TRACE; yymsp[-1].minor.yy217 = NULL_ORDER_LAST; }
break;
default:
break;
......
......@@ -88,7 +88,7 @@ static SKeyword keywordTable[] = {
// {"SCORES", TK_SCORES},
// {"GRANTS", TK_GRANTS},
// {"DOT", TK_DOT},
// {"TABLES", TK_TABLES},
{"TABLES", TK_TABLES},
// {"STABLES", TK_STABLES},
{"VGROUPS", TK_VGROUPS},
// {"DROP", TK_DROP},
......
......@@ -50,7 +50,7 @@ extern "C" {
int32_t createLogicPlan(SPlanContext* pCxt, SLogicNode** pLogicNode);
int32_t optimize(SPlanContext* pCxt, SLogicNode* pLogicNode);
int32_t createPhysiPlan(SPlanContext* pCxt, SLogicNode* pLogicNode, SQueryPlan** pPlan);
int32_t createPhysiPlan(SPlanContext* pCxt, SLogicNode* pLogicNode, SQueryPlan** pPlan, SArray* pExecNodeList);
#ifdef __cplusplus
}
......
......@@ -128,6 +128,7 @@ static SLogicNode* createScanLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSe
pScan->node.id = pCxt->planNodeId++;
pScan->pMeta = pRealTable->pMeta;
pScan->pVgroupList = pRealTable->pVgroupList;
// set columns to scan
SNodeList* pCols = NULL;
......
......@@ -27,6 +27,7 @@ typedef struct SPhysiPlanContext {
int32_t errCode;
int16_t nextDataBlockId;
SArray* pLocationHelper;
SArray* pExecNodeList;
} SPhysiPlanContext;
static int32_t getSlotKey(SNode* pNode, char* pKey) {
......@@ -185,11 +186,41 @@ static int32_t setSlotOutput(SPhysiPlanContext* pCxt, SNodeList* pTargets, SData
return TSDB_CODE_SUCCESS;
}
static SNodeptr createPrimaryKeyCol(SPhysiPlanContext* pCxt, uint64_t tableId) {
SColumnNode* pCol = nodesMakeNode(QUERY_NODE_COLUMN);
CHECK_ALLOC(pCol, NULL);
pCol->node.resType.type = TSDB_DATA_TYPE_TIMESTAMP;
pCol->node.resType.bytes = tDataTypes[TSDB_DATA_TYPE_TIMESTAMP].bytes;
pCol->tableId = tableId;
pCol->colId = PRIMARYKEY_TIMESTAMP_COL_ID;
pCol->colType = COLUMN_TYPE_COLUMN;
return pCol;
}
static int32_t addPrimaryKeyCol(SPhysiPlanContext* pCxt, SScanPhysiNode* pScanPhysiNode) {
if (NULL == pScanPhysiNode->pScanCols) {
pScanPhysiNode->pScanCols = nodesMakeList();
CHECK_ALLOC(pScanPhysiNode->pScanCols, TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, createPrimaryKeyCol(pCxt, pScanPhysiNode->uid)));
return TSDB_CODE_SUCCESS;
}
SNode* pNode;
FOREACH(pNode, pScanPhysiNode->pScanCols) {
if (PRIMARYKEY_TIMESTAMP_COL_ID == ((SColumnNode*)pNode)->colId) {
return TSDB_CODE_SUCCESS;
}
}
CHECK_CODE_EXT(nodesListStrictAppend(pScanPhysiNode->pScanCols, createPrimaryKeyCol(pCxt, pScanPhysiNode->uid)));
return TSDB_CODE_SUCCESS;
}
static int32_t initScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* pScanLogicNode, SScanPhysiNode* pScanPhysiNode) {
if (NULL != pScanLogicNode->pScanCols) {
pScanPhysiNode->pScanCols = nodesCloneList(pScanLogicNode->pScanCols);
CHECK_ALLOC(pScanPhysiNode->pScanCols, TSDB_CODE_OUT_OF_MEMORY);
}
CHECK_CODE(addPrimaryKeyCol(pCxt, pScanPhysiNode), TSDB_CODE_OUT_OF_MEMORY);
// Data block describe also needs to be set without scanning column, such as SELECT COUNT(*) FROM t
CHECK_CODE(addDataBlockDesc(pCxt, pScanPhysiNode->pScanCols, pScanPhysiNode->node.pOutputDataBlockDesc), TSDB_CODE_OUT_OF_MEMORY);
......@@ -206,6 +237,11 @@ static int32_t initScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* pScanL
return TSDB_CODE_SUCCESS;
}
static void vgroupInfoToNodeAddr(const SVgroupInfo* vg, SQueryNodeAddr* pNodeAddr) {
pNodeAddr->nodeId = vg->vgId;
pNodeAddr->epset = vg->epset;
}
static SPhysiNode* createTagScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* pScanLogicNode) {
STagScanPhysiNode* pTagScan = (STagScanPhysiNode*)makePhysiNode(pCxt, QUERY_NODE_PHYSICAL_PLAN_TAG_SCAN);
CHECK_ALLOC(pTagScan, NULL);
......@@ -213,21 +249,23 @@ static SPhysiNode* createTagScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNod
return (SPhysiNode*)pTagScan;
}
static SPhysiNode* createTableScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* pScanLogicNode) {
static SPhysiNode* createTableScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode) {
STableScanPhysiNode* pTableScan = (STableScanPhysiNode*)makePhysiNode(pCxt, QUERY_NODE_PHYSICAL_PLAN_TABLE_SCAN);
CHECK_ALLOC(pTableScan, NULL);
CHECK_CODE(initScanPhysiNode(pCxt, pScanLogicNode, (SScanPhysiNode*)pTableScan), (SPhysiNode*)pTableScan);
pTableScan->scanFlag = pScanLogicNode->scanFlag;
pTableScan->scanRange = pScanLogicNode->scanRange;
vgroupInfoToNodeAddr(pScanLogicNode->pVgroupList->vgroups, &pSubplan->execNode);
taosArrayPush(pCxt->pExecNodeList, &pSubplan->execNode);
return (SPhysiNode*)pTableScan;
}
static SPhysiNode* createScanPhysiNode(SPhysiPlanContext* pCxt, SScanLogicNode* pScanLogicNode) {
static SPhysiNode* createScanPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SScanLogicNode* pScanLogicNode) {
switch (pScanLogicNode->scanType) {
case SCAN_TYPE_TAG:
return createTagScanPhysiNode(pCxt, pScanLogicNode);
case SCAN_TYPE_TABLE:
return createTableScanPhysiNode(pCxt, pScanLogicNode);
return createTableScanPhysiNode(pCxt, pSubplan, pScanLogicNode);
case SCAN_TYPE_STABLE:
case SCAN_TYPE_STREAM:
break;
......@@ -428,13 +466,13 @@ static SPhysiNode* createProjectPhysiNode(SPhysiPlanContext* pCxt, SNodeList* pC
return (SPhysiNode*)pProject;
}
static SPhysiNode* createPhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicPlan) {
static SPhysiNode* createPhysiNode(SPhysiPlanContext* pCxt, SSubplan* pSubplan, SLogicNode* pLogicPlan) {
SNodeList* pChildren = nodesMakeList();
CHECK_ALLOC(pChildren, NULL);
SNode* pLogicChild;
FOREACH(pLogicChild, pLogicPlan->pChildren) {
SNode* pChildPhyNode = (SNode*)createPhysiNode(pCxt, (SLogicNode*)pLogicChild);
SNode* pChildPhyNode = (SNode*)createPhysiNode(pCxt, pSubplan, (SLogicNode*)pLogicChild);
if (TSDB_CODE_SUCCESS != nodesListAppend(pChildren, pChildPhyNode)) {
pCxt->errCode = TSDB_CODE_OUT_OF_MEMORY;
nodesDestroyList(pChildren);
......@@ -445,7 +483,7 @@ static SPhysiNode* createPhysiNode(SPhysiPlanContext* pCxt, SLogicNode* pLogicPl
SPhysiNode* pPhyNode = NULL;
switch (nodeType(pLogicPlan)) {
case QUERY_NODE_LOGIC_PLAN_SCAN:
pPhyNode = createScanPhysiNode(pCxt, (SScanLogicNode*)pLogicPlan);
pPhyNode = createScanPhysiNode(pCxt, pSubplan, (SScanLogicNode*)pLogicPlan);
break;
case QUERY_NODE_LOGIC_PLAN_JOIN:
pPhyNode = createJoinPhysiNode(pCxt, pChildren, (SJoinLogicNode*)pLogicPlan);
......@@ -493,25 +531,17 @@ static SSubplan* createPhysiSubplan(SPhysiPlanContext* pCxt, SSubLogicPlan* pLog
SVnodeModifLogicNode* pModif = (SVnodeModifLogicNode*)pLogicSubplan->pNode;
pSubplan->pDataSink = createDataInserter(pCxt, pModif->pVgDataBlocks);
pSubplan->msgType = pModif->msgType;
pSubplan->execNode.epset = pModif->pVgDataBlocks->vg.epset;
taosArrayPush(pCxt->pExecNodeList, &pSubplan->execNode);
} else {
pSubplan->pNode = createPhysiNode(pCxt, pLogicSubplan->pNode);
pSubplan->pNode = createPhysiNode(pCxt, pSubplan, pLogicSubplan->pNode);
pSubplan->pDataSink = createDataDispatcher(pCxt, pSubplan->pNode);
pSubplan->msgType = TDMT_VND_QUERY;
}
pSubplan->subplanType = pLogicSubplan->subplanType;
return pSubplan;
}
static int32_t strictListAppend(SNodeList* pList, SNodeptr pNode) {
if (NULL == pNode) {
return TSDB_CODE_OUT_OF_MEMORY;
}
int32_t code = nodesListAppend(pList, pNode);
if (TSDB_CODE_SUCCESS != code) {
nodesDestroyNode(pNode);
}
return code;
}
static int32_t splitLogicPlan(SPhysiPlanContext* pCxt, SLogicNode* pLogicNode, SSubLogicPlan** pSubLogicPlan) {
*pSubLogicPlan = (SSubLogicPlan*)nodesMakeNode(QUERY_NODE_LOGIC_SUBPLAN);
CHECK_ALLOC(*pSubLogicPlan, TSDB_CODE_OUT_OF_MEMORY);
......@@ -529,7 +559,7 @@ static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNodeptr pSubplan, int32_t l
if (level >= LIST_LENGTH(pSubplans)) {
pGroup = nodesMakeNode(QUERY_NODE_NODE_LIST);
CHECK_ALLOC(pGroup, TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE(strictListAppend(pSubplans, pGroup), TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE(nodesListStrictAppend(pSubplans, pGroup), TSDB_CODE_OUT_OF_MEMORY);
} else {
pGroup = nodesListGetNode(pSubplans, level);
}
......@@ -537,7 +567,7 @@ static int32_t pushSubplan(SPhysiPlanContext* pCxt, SNodeptr pSubplan, int32_t l
pGroup->pNodeList = nodesMakeList();
CHECK_ALLOC(pGroup->pNodeList, TSDB_CODE_OUT_OF_MEMORY);
}
CHECK_CODE(strictListAppend(pGroup->pNodeList, pSubplan), TSDB_CODE_OUT_OF_MEMORY);
CHECK_CODE(nodesListStrictAppend(pGroup->pNodeList, pSubplan), TSDB_CODE_OUT_OF_MEMORY);
}
SSubLogicPlan* singleCloneSubLogicPlan(SPhysiPlanContext* pCxt, SSubLogicPlan* pSrc, int32_t level) {
......@@ -562,7 +592,6 @@ static int32_t doScaleOut(SPhysiPlanContext* pCxt, SSubLogicPlan* pSubplan, int3
SSubLogicPlan* pNewSubplan = singleCloneSubLogicPlan(pCxt, pSubplan, level);
CHECK_ALLOC(pNewSubplan, TSDB_CODE_OUT_OF_MEMORY);
SVgDataBlocks* blocks = (SVgDataBlocks*)taosArrayGetP(pNode->pDataBlocks, i);
pNewSubplan->execNode.epset = blocks->vg.epset;
((SVnodeModifLogicNode*)pNewSubplan->pNode)->pVgDataBlocks = blocks;
CHECK_CODE_EXT(pushSubplan(pCxt, pNewSubplan, level, pLogicPlan->pSubplans));
}
......@@ -639,12 +668,13 @@ static int32_t buildPhysiPlan(SPhysiPlanContext* pCxt, SQueryLogicPlan* pLogicPl
return TSDB_CODE_SUCCESS;
}
int32_t createPhysiPlan(SPlanContext* pCxt, SLogicNode* pLogicNode, SQueryPlan** pPlan) {
int32_t createPhysiPlan(SPlanContext* pCxt, SLogicNode* pLogicNode, SQueryPlan** pPlan, SArray* pExecNodeList) {
SPhysiPlanContext cxt = {
.pPlanCxt = pCxt,
.errCode = TSDB_CODE_SUCCESS,
.nextDataBlockId = 0,
.pLocationHelper = taosArrayInit(32, POINTER_BYTES)
.pLocationHelper = taosArrayInit(32, POINTER_BYTES),
.pExecNodeList = pExecNodeList
};
if (NULL == cxt.pLocationHelper) {
return TSDB_CODE_OUT_OF_MEMORY;
......
......@@ -21,14 +21,14 @@ int32_t optimize(SPlanContext* pCxt, SLogicNode* pLogicNode) {
return TSDB_CODE_SUCCESS;
}
int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan) {
int32_t qCreateQueryPlan(SPlanContext* pCxt, SQueryPlan** pPlan, SArray* pExecNodeList) {
SLogicNode* pLogicNode = NULL;
int32_t code = createLogicPlan(pCxt, &pLogicNode);
if (TSDB_CODE_SUCCESS == code) {
code = optimize(pCxt, pLogicNode);
}
if (TSDB_CODE_SUCCESS == code) {
code = createPhysiPlan(pCxt, pLogicNode, pPlan);
code = createPhysiPlan(pCxt, pLogicNode, pPlan, pExecNodeList);
}
return code;
}
......
......@@ -71,7 +71,7 @@ protected:
if (TEST_PHYSICAL_PLAN == target) {
SQueryPlan* pPlan = nullptr;
code = createPhysiPlan(&cxt, pLogicPlan, &pPlan);
code = createPhysiPlan(&cxt, pLogicPlan, &pPlan, NULL);
if (code != TSDB_CODE_SUCCESS) {
cout << "sql:[" << cxt_.pSql << "] physical plan code:" << code << ", strerror:" << tstrerror(code) << endl;
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册