Merge pull request #19250 from taosdata/fix/main_bugfix_wxy
fix: escape error in create topic/stream
This commit is contained in:
commit
3c331dc145
|
@ -189,12 +189,13 @@ typedef enum ELogicConditionType {
|
||||||
#define TSDB_MAX_COLUMNS 4096
|
#define TSDB_MAX_COLUMNS 4096
|
||||||
#define TSDB_MIN_COLUMNS 2 // PRIMARY COLUMN(timestamp) + other columns
|
#define TSDB_MIN_COLUMNS 2 // PRIMARY COLUMN(timestamp) + other columns
|
||||||
|
|
||||||
#define TSDB_NODE_NAME_LEN 64
|
#define TSDB_NODE_NAME_LEN 64
|
||||||
#define TSDB_TABLE_NAME_LEN 193 // it is a null-terminated string
|
#define TSDB_TABLE_NAME_LEN 193 // it is a null-terminated string
|
||||||
#define TSDB_TOPIC_NAME_LEN 193 // it is a null-terminated string
|
#define TSDB_TOPIC_NAME_LEN 193 // it is a null-terminated string
|
||||||
#define TSDB_CGROUP_LEN 193 // it is a null-terminated string
|
#define TSDB_CGROUP_LEN 193 // it is a null-terminated string
|
||||||
#define TSDB_DB_NAME_LEN 65
|
#define TSDB_STREAM_NAME_LEN 193 // it is a null-terminated string
|
||||||
#define TSDB_DB_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
#define TSDB_DB_NAME_LEN 65
|
||||||
|
#define TSDB_DB_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_DB_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
||||||
|
|
||||||
#define TSDB_FUNC_NAME_LEN 65
|
#define TSDB_FUNC_NAME_LEN 65
|
||||||
#define TSDB_FUNC_COMMENT_LEN 1024 * 1024
|
#define TSDB_FUNC_COMMENT_LEN 1024 * 1024
|
||||||
|
@ -212,8 +213,8 @@ typedef enum ELogicConditionType {
|
||||||
#define TSDB_INDEX_FNAME_LEN (TSDB_DB_FNAME_LEN + TSDB_INDEX_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
#define TSDB_INDEX_FNAME_LEN (TSDB_DB_FNAME_LEN + TSDB_INDEX_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
||||||
#define TSDB_TYPE_STR_MAX_LEN 32
|
#define TSDB_TYPE_STR_MAX_LEN 32
|
||||||
#define TSDB_TABLE_FNAME_LEN (TSDB_DB_FNAME_LEN + TSDB_TABLE_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
#define TSDB_TABLE_FNAME_LEN (TSDB_DB_FNAME_LEN + TSDB_TABLE_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
||||||
#define TSDB_TOPIC_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_TABLE_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
#define TSDB_TOPIC_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_TOPIC_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
||||||
#define TSDB_STREAM_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_TABLE_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
#define TSDB_STREAM_FNAME_LEN (TSDB_ACCT_ID_LEN + TSDB_STREAM_NAME_LEN + TSDB_NAME_DELIMITER_LEN)
|
||||||
#define TSDB_SUBSCRIBE_KEY_LEN (TSDB_CGROUP_LEN + TSDB_TOPIC_FNAME_LEN + 2)
|
#define TSDB_SUBSCRIBE_KEY_LEN (TSDB_CGROUP_LEN + TSDB_TOPIC_FNAME_LEN + 2)
|
||||||
#define TSDB_PARTITION_KEY_LEN (TSDB_SUBSCRIBE_KEY_LEN + 20)
|
#define TSDB_PARTITION_KEY_LEN (TSDB_SUBSCRIBE_KEY_LEN + 20)
|
||||||
#define TSDB_COL_NAME_LEN 65
|
#define TSDB_COL_NAME_LEN 65
|
||||||
|
@ -310,7 +311,7 @@ typedef enum ELogicConditionType {
|
||||||
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
|
#define TSDB_MIN_KEEP (1 * 1440) // data in db to be reserved. unit minute
|
||||||
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
|
#define TSDB_MAX_KEEP (365000 * 1440) // data in db to be reserved.
|
||||||
#define TSDB_MAX_KEEP_NS (365 * 292 * 1440) // data in db to be reserved.
|
#define TSDB_MAX_KEEP_NS (365 * 292 * 1440) // data in db to be reserved.
|
||||||
#define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years
|
#define TSDB_DEFAULT_KEEP (3650 * 1440) // ten years
|
||||||
#define TSDB_MIN_MINROWS_FBLOCK 10
|
#define TSDB_MIN_MINROWS_FBLOCK 10
|
||||||
#define TSDB_MAX_MINROWS_FBLOCK 1000
|
#define TSDB_MAX_MINROWS_FBLOCK 1000
|
||||||
#define TSDB_DEFAULT_MINROWS_FBLOCK 100
|
#define TSDB_DEFAULT_MINROWS_FBLOCK 100
|
||||||
|
|
|
@ -186,6 +186,7 @@ SNode* createDropUserStmt(SAstCreateContext* pCxt, SToken* pUserName);
|
||||||
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
SNode* createCreateDnodeStmt(SAstCreateContext* pCxt, const SToken* pFqdn, const SToken* pPort);
|
||||||
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force);
|
SNode* createDropDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, bool force);
|
||||||
SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
|
SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const SToken* pConfig, const SToken* pValue);
|
||||||
|
SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName);
|
||||||
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
||||||
SNode* pRealTable, SNodeList* pCols, SNode* pOptions);
|
SNode* pRealTable, SNodeList* pCols, SNode* pOptions);
|
||||||
SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding,
|
SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInterval, SNode* pOffset, SNode* pSliding,
|
||||||
|
@ -193,15 +194,13 @@ SNode* createIndexOption(SAstCreateContext* pCxt, SNodeList* pFuncs, SNode* pInt
|
||||||
SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName);
|
SNode* createDropIndexStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SNode* pIndexName);
|
||||||
SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
SNode* createCreateComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
||||||
SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pDnodeId);
|
||||||
SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pQuery);
|
||||||
SNode* pQuery);
|
SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SToken* pSubDbName,
|
||||||
SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
bool withMeta);
|
||||||
SToken* pSubDbName, bool withMeta);
|
SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pRealTable,
|
||||||
SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
bool withMeta);
|
||||||
SNode* pRealTable, bool withMeta);
|
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pTopicName);
|
||||||
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName);
|
SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pCGroupId, SToken* pTopicName);
|
||||||
SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pCGroupId,
|
|
||||||
const SToken* pTopicName);
|
|
||||||
SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue);
|
SNode* createAlterLocalStmt(SAstCreateContext* pCxt, const SToken* pConfig, const SToken* pValue);
|
||||||
SNode* createDefaultExplainOptions(SAstCreateContext* pCxt);
|
SNode* createDefaultExplainOptions(SAstCreateContext* pCxt);
|
||||||
SNode* setExplainVerbose(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal);
|
SNode* setExplainVerbose(SAstCreateContext* pCxt, SNode* pOptions, const SToken* pVal);
|
||||||
|
@ -214,9 +213,9 @@ SNode* createCreateFunctionStmt(SAstCreateContext* pCxt, bool ignoreExists, bool
|
||||||
const SToken* pLibPath, SDataType dataType, int32_t bufSize);
|
const SToken* pLibPath, SDataType dataType, int32_t bufSize);
|
||||||
SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName);
|
SNode* createDropFunctionStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pFuncName);
|
||||||
SNode* createStreamOptions(SAstCreateContext* pCxt);
|
SNode* createStreamOptions(SAstCreateContext* pCxt);
|
||||||
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pStreamName, SNode* pRealTable,
|
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pStreamName, SNode* pRealTable,
|
||||||
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery);
|
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery);
|
||||||
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pStreamName);
|
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pStreamName);
|
||||||
SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId);
|
SNode* createKillStmt(SAstCreateContext* pCxt, ENodeType type, const SToken* pId);
|
||||||
SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId);
|
SNode* createKillQueryStmt(SAstCreateContext* pCxt, const SToken* pQueryId);
|
||||||
SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt);
|
SNode* createBalanceVgroupStmt(SAstCreateContext* pCxt);
|
||||||
|
|
|
@ -459,8 +459,11 @@ tag_item(A) ::= column_name(B) AS column_alias(C).
|
||||||
|
|
||||||
/************************************************ create index ********************************************************/
|
/************************************************ create index ********************************************************/
|
||||||
cmd ::= CREATE SMA INDEX not_exists_opt(D)
|
cmd ::= CREATE SMA INDEX not_exists_opt(D)
|
||||||
full_table_name(A) ON full_table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, A, B, NULL, C); }
|
full_index_name(A) ON full_table_name(B) index_options(C). { pCxt->pRootNode = createCreateIndexStmt(pCxt, INDEX_TYPE_SMA, D, A, B, NULL, C); }
|
||||||
cmd ::= DROP INDEX exists_opt(B) full_table_name(A). { pCxt->pRootNode = createDropIndexStmt(pCxt, B, A); }
|
cmd ::= DROP INDEX exists_opt(B) full_index_name(A). { pCxt->pRootNode = createDropIndexStmt(pCxt, B, A); }
|
||||||
|
|
||||||
|
full_index_name(A) ::= index_name(B). { A = createRealTableNodeForIndexName(pCxt, NULL, &B); }
|
||||||
|
full_index_name(A) ::= db_name(B) NK_DOT index_name(C). { A = createRealTableNodeForIndexName(pCxt, &B, &C); }
|
||||||
|
|
||||||
index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL
|
index_options(A) ::= FUNCTION NK_LP func_list(B) NK_RP INTERVAL
|
||||||
NK_LP duration_literal(C) NK_RP sliding_opt(D) sma_stream_opt(E). { A = createIndexOption(pCxt, B, releaseRawExprNode(pCxt, C), NULL, D, E); }
|
NK_LP duration_literal(C) NK_RP sliding_opt(D) sma_stream_opt(E). { A = createIndexOption(pCxt, B, releaseRawExprNode(pCxt, C), NULL, D, E); }
|
||||||
|
@ -657,6 +660,10 @@ stream_name(A) ::= NK_ID(B).
|
||||||
%destructor cgroup_name { }
|
%destructor cgroup_name { }
|
||||||
cgroup_name(A) ::= NK_ID(B). { A = B; }
|
cgroup_name(A) ::= NK_ID(B). { A = B; }
|
||||||
|
|
||||||
|
%type index_name { SToken }
|
||||||
|
%destructor index_name { }
|
||||||
|
index_name(A) ::= NK_ID(B). { A = B; }
|
||||||
|
|
||||||
/************************************************ expression **********************************************************/
|
/************************************************ expression **********************************************************/
|
||||||
expr_or_subquery(A) ::= expression(B). { A = B; }
|
expr_or_subquery(A) ::= expression(B). { A = B; }
|
||||||
//expr_or_subquery(A) ::= subquery(B). { A = createTempTableNode(pCxt, releaseRawExprNode(pCxt, B), NULL); }
|
//expr_or_subquery(A) ::= subquery(B). { A = createTempTableNode(pCxt, releaseRawExprNode(pCxt, B), NULL); }
|
||||||
|
|
|
@ -201,6 +201,24 @@ static bool checkIndexName(SAstCreateContext* pCxt, SToken* pIndexName) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool checkTopicName(SAstCreateContext* pCxt, SToken* pTopicName) {
|
||||||
|
trimEscape(pTopicName);
|
||||||
|
if (pTopicName->n >= TSDB_TOPIC_NAME_LEN) {
|
||||||
|
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, pTopicName->z);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool checkStreamName(SAstCreateContext* pCxt, SToken* pStreamName) {
|
||||||
|
trimEscape(pStreamName);
|
||||||
|
if (pStreamName->n >= TSDB_STREAM_NAME_LEN) {
|
||||||
|
pCxt->errCode = generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_IDENTIFIER_NAME, pStreamName->z);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
static bool checkComment(SAstCreateContext* pCxt, const SToken* pCommentToken, bool demand) {
|
static bool checkComment(SAstCreateContext* pCxt, const SToken* pCommentToken, bool demand) {
|
||||||
if (NULL == pCommentToken) {
|
if (NULL == pCommentToken) {
|
||||||
pCxt->errCode = demand ? TSDB_CODE_PAR_SYNTAX_ERROR : TSDB_CODE_SUCCESS;
|
pCxt->errCode = demand ? TSDB_CODE_PAR_SYNTAX_ERROR : TSDB_CODE_SUCCESS;
|
||||||
|
@ -1509,6 +1527,13 @@ SNode* createAlterDnodeStmt(SAstCreateContext* pCxt, const SToken* pDnode, const
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SNode* createRealTableNodeForIndexName(SAstCreateContext* pCxt, SToken* pDbName, SToken* pIndexName) {
|
||||||
|
if (!checkIndexName(pCxt, pIndexName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
return createRealTableNode(pCxt, pDbName, pIndexName, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
SNode* createCreateIndexStmt(SAstCreateContext* pCxt, EIndexType type, bool ignoreExists, SNode* pIndexName,
|
||||||
SNode* pRealTable, SNodeList* pCols, SNode* pOptions) {
|
SNode* pRealTable, SNodeList* pCols, SNode* pOptions) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
@ -1567,9 +1592,11 @@ SNode* createDropComponentNodeStmt(SAstCreateContext* pCxt, ENodeType type, cons
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pQuery) {
|
||||||
SNode* pQuery) {
|
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkTopicName(pCxt, pTopicName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
||||||
|
@ -1578,10 +1605,10 @@ SNode* createCreateTopicStmtUseQuery(SAstCreateContext* pCxt, bool ignoreExists,
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SToken* pSubDbName,
|
||||||
SToken* pSubDbName, bool withMeta) {
|
bool withMeta) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
if (!checkDbName(pCxt, pSubDbName, true)) {
|
if (!checkTopicName(pCxt, pTopicName) || !checkDbName(pCxt, pSubDbName, true)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
||||||
|
@ -1593,9 +1620,12 @@ SNode* createCreateTopicStmtUseDb(SAstCreateContext* pCxt, bool ignoreExists, co
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pTopicName,
|
SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists, SToken* pTopicName, SNode* pRealTable,
|
||||||
SNode* pRealTable, bool withMeta) {
|
bool withMeta) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkTopicName(pCxt, pTopicName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
SCreateTopicStmt* pStmt = (SCreateTopicStmt*)nodesMakeNode(QUERY_NODE_CREATE_TOPIC_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
||||||
|
@ -1607,8 +1637,11 @@ SNode* createCreateTopicStmtUseTable(SAstCreateContext* pCxt, bool ignoreExists,
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pTopicName) {
|
SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pTopicName) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkTopicName(pCxt, pTopicName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SDropTopicStmt* pStmt = (SDropTopicStmt*)nodesMakeNode(QUERY_NODE_DROP_TOPIC_STMT);
|
SDropTopicStmt* pStmt = (SDropTopicStmt*)nodesMakeNode(QUERY_NODE_DROP_TOPIC_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->topicName, pTopicName);
|
||||||
|
@ -1617,8 +1650,11 @@ SNode* createDropTopicStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pCGroupId,
|
SNode* createDropCGroupStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pCGroupId,
|
||||||
const SToken* pTopicName) {
|
SToken* pTopicName) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkTopicName(pCxt, pTopicName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SDropCGroupStmt* pStmt = (SDropCGroupStmt*)nodesMakeNode(QUERY_NODE_DROP_CGROUP_STMT);
|
SDropCGroupStmt* pStmt = (SDropCGroupStmt*)nodesMakeNode(QUERY_NODE_DROP_CGROUP_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
pStmt->ignoreNotExists = ignoreNotExists;
|
pStmt->ignoreNotExists = ignoreNotExists;
|
||||||
|
@ -1730,9 +1766,12 @@ SNode* createStreamOptions(SAstCreateContext* pCxt) {
|
||||||
return (SNode*)pOptions;
|
return (SNode*)pOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const SToken* pStreamName, SNode* pRealTable,
|
SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, SToken* pStreamName, SNode* pRealTable,
|
||||||
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery) {
|
SNode* pOptions, SNodeList* pTags, SNode* pSubtable, SNode* pQuery) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkStreamName(pCxt, pStreamName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SCreateStreamStmt* pStmt = (SCreateStreamStmt*)nodesMakeNode(QUERY_NODE_CREATE_STREAM_STMT);
|
SCreateStreamStmt* pStmt = (SCreateStreamStmt*)nodesMakeNode(QUERY_NODE_CREATE_STREAM_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->streamName, pStreamName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->streamName, pStreamName);
|
||||||
|
@ -1749,8 +1788,11 @@ SNode* createCreateStreamStmt(SAstCreateContext* pCxt, bool ignoreExists, const
|
||||||
return (SNode*)pStmt;
|
return (SNode*)pStmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, const SToken* pStreamName) {
|
SNode* createDropStreamStmt(SAstCreateContext* pCxt, bool ignoreNotExists, SToken* pStreamName) {
|
||||||
CHECK_PARSER_STATUS(pCxt);
|
CHECK_PARSER_STATUS(pCxt);
|
||||||
|
if (!checkStreamName(pCxt, pStreamName)) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
SDropStreamStmt* pStmt = (SDropStreamStmt*)nodesMakeNode(QUERY_NODE_DROP_STREAM_STMT);
|
SDropStreamStmt* pStmt = (SDropStreamStmt*)nodesMakeNode(QUERY_NODE_DROP_STREAM_STMT);
|
||||||
CHECK_OUT_OF_MEM(pStmt);
|
CHECK_OUT_OF_MEM(pStmt);
|
||||||
COPY_STRING_FORM_ID_TOKEN(pStmt->streamName, pStreamName);
|
COPY_STRING_FORM_ID_TOKEN(pStmt->streamName, pStreamName);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue