提交 1251245c 编写于 作者: G Ganlin Zhao

move code to parser

上级 bdd2c8b8
......@@ -3792,6 +3792,11 @@ static int32_t translateDeleteWhere(STranslateContext* pCxt, SDeleteStmt* pDelet
}
static int32_t translateDelete(STranslateContext* pCxt, SDeleteStmt* pDelete) {
// check delete from system tables
if (isSystemDb(((SRealTableNode*)pDelete->pFromTable)->table.dbName)) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
pCxt->pCurrStmt = (SNode*)pDelete;
int32_t code = translateFrom(pCxt, pDelete->pFromTable);
if (TSDB_CODE_SUCCESS == code) {
......
......@@ -1442,12 +1442,8 @@ static int32_t createDeleteRootLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* p
}
static int32_t createDeleteScanLogicNode(SLogicPlanContext* pCxt, SDeleteStmt* pDelete, SLogicNode** pLogicNode) {
if (isSystemDb(((SRealTableNode*)pDelete->pFromTable)->table.dbName)) {
return TSDB_CODE_TSC_INVALID_OPERATION;
}
SScanLogicNode* pScan = NULL;
int32_t code = makeScanLogicNode(pCxt, (SRealTableNode*)pDelete->pFromTable, false, (SLogicNode**)&pScan);
int32_t code = makeScanLogicNode(pCxt, (SRealTableNode*)pDelete->pFromTable, false, (SLogicNode**)&pScan);
// set columns to scan
if (TSDB_CODE_SUCCESS == code) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册