move code to parser

This commit is contained in:
Ganlin Zhao 2023-04-24 09:49:03 +08:00
parent bdd2c8b81f
commit 1251245c2a
2 changed files with 6 additions and 5 deletions

View File

@ -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) {

View File

@ -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) {