fix:add grammar support
This commit is contained in:
parent
a7a85fb796
commit
8c1c2a2f97
|
@ -530,9 +530,9 @@ cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B) AS DATABASE db_name(C).
|
||||||
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
||||||
WITH META AS DATABASE db_name(C). { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, A, &B, &C, true); }
|
WITH META AS DATABASE db_name(C). { pCxt->pRootNode = createCreateTopicStmtUseDb(pCxt, A, &B, &C, true); }
|
||||||
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
||||||
AS STABLE full_table_name(C). { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, A, &B, C, false); }
|
AS STABLE full_table_name(C) where_clause_opt(D). { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, A, &B, C, false, D); }
|
||||||
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
cmd ::= CREATE TOPIC not_exists_opt(A) topic_name(B)
|
||||||
WITH META AS STABLE full_table_name(C). { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, A, &B, C, true); }
|
WITH META AS STABLE full_table_name(C) where_clause_opt(D). { pCxt->pRootNode = createCreateTopicStmtUseTable(pCxt, A, &B, C, true, D); }
|
||||||
cmd ::= DROP TOPIC exists_opt(A) topic_name(B). { pCxt->pRootNode = createDropTopicStmt(pCxt, A, &B); }
|
cmd ::= DROP TOPIC exists_opt(A) topic_name(B). { pCxt->pRootNode = createDropTopicStmt(pCxt, A, &B); }
|
||||||
cmd ::= DROP CONSUMER GROUP exists_opt(A) cgroup_name(B) ON topic_name(C). { pCxt->pRootNode = createDropCGroupStmt(pCxt, A, &B, &C); }
|
cmd ::= DROP CONSUMER GROUP exists_opt(A) cgroup_name(B) ON topic_name(C). { pCxt->pRootNode = createDropCGroupStmt(pCxt, A, &B, &C); }
|
||||||
|
|
||||||
|
|
|
@ -1713,6 +1713,33 @@ SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists,
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
||||||
pStmt->ignoreExists = ignoreExists;
|
pStmt->ignoreExists = ignoreExists;
|
||||||
pStmt->withMeta = withMeta;
|
pStmt->withMeta = withMeta;
|
||||||
|
|
||||||
|
// SSelectStmt* pSelect = (SSelectStmt*)nodesMakeNode(QUERY_NODE_SELECT_STMT);
|
||||||
|
// if (NULL == pSelect) {
|
||||||
|
// return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
// }
|
||||||
|
// sprintf(pSelect->stmtName, "%p", pSelect);
|
||||||
|
//
|
||||||
|
// SRealTableNode* pRealTable = (SRealTableNode*)nodesMakeNode(QUERY_NODE_REAL_TABLE);
|
||||||
|
// if (NULL == pRealTable) {
|
||||||
|
// nodesDestroyNode((SNode*)pSelect);
|
||||||
|
// return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
// }
|
||||||
|
// snprintf(pRealTable->table.dbName, sizeof(pRealTable->table.dbName), "%s", pDb);
|
||||||
|
// snprintf(pRealTable->table.tableName, sizeof(pRealTable->table.tableName), "%s", pTable);
|
||||||
|
// snprintf(pRealTable->table.tableAlias, sizeof(pRealTable->table.tableAlias), "%s", pTable);
|
||||||
|
// pSelect->pFromTable = (SNode*)pRealTable;
|
||||||
|
//
|
||||||
|
// if (numOfProjs >= 0) {
|
||||||
|
// pSelect->pProjectionList = createProjectCols(numOfProjs, pProjCol);
|
||||||
|
// if (NULL == pSelect->pProjectionList) {
|
||||||
|
// nodesDestroyNode((SNode*)pSelect);
|
||||||
|
// return TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// pStmt->pQuery = pSelect;
|
||||||
|
|
||||||
strcpy(pStmt->subDbName, ((SRealTableNode*)pRealTable)->table.dbName);
|
strcpy(pStmt->subDbName, ((SRealTableNode*)pRealTable)->table.dbName);
|
||||||
strcpy(pStmt->subSTbName, ((SRealTableNode*)pRealTable)->table.tableName);
|
strcpy(pStmt->subSTbName, ((SRealTableNode*)pRealTable)->table.tableName);
|
||||||
nodesDestroyNode(pRealTable);
|
nodesDestroyNode(pRealTable);
|
||||||
|
|
Loading…
Reference in New Issue