refactor
This commit is contained in:
parent
1251245c2a
commit
782566ad08
|
@ -12,7 +12,7 @@
|
|||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef TDENGINE_SYSTABLE_H
|
||||
#define TDENGINE_SYSTABLE_H
|
||||
|
||||
|
@ -77,7 +77,6 @@ void getInfosDbMeta(const SSysTableMeta** pInfosTableMeta, size_t* size);
|
|||
void getPerfDbMeta(const SSysTableMeta** pPerfsTableMeta, size_t* size);
|
||||
void getVisibleInfosTablesNum(bool sysInfo, size_t* size);
|
||||
bool invisibleColumn(bool sysInfo, int8_t tableType, int8_t flags);
|
||||
bool isSystemDb(const char *dbName);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -448,7 +448,3 @@ bool invisibleColumn(bool sysInfo, int8_t tableType, int8_t flags) {
|
|||
}
|
||||
return 0 != (flags & COL_IS_SYSINFO);
|
||||
}
|
||||
|
||||
bool isSystemDb(const char *dbName) {
|
||||
return ((strcasecmp(dbName, TSDB_INFORMATION_SCHEMA_DB) == 0) || (strcasecmp(dbName, TSDB_PERFORMANCE_SCHEMA_DB) == 0));
|
||||
}
|
||||
|
|
|
@ -2580,6 +2580,10 @@ static int32_t translateTable(STranslateContext* pCxt, SNode* pTable) {
|
|||
if (TSDB_SYSTEM_TABLE == pRealTable->pMeta->tableType && isSelectStmt(pCxt->pCurrStmt)) {
|
||||
((SSelectStmt*)pCxt->pCurrStmt)->isTimeLineResult = false;
|
||||
}
|
||||
if (TSDB_SYSTEM_TABLE == pRealTable->pMeta->tableType && isDeleteStmt(pCxt->pCurrStmt)) {
|
||||
code = TSDB_CODE_TSC_INVALID_OPERATION;
|
||||
break;
|
||||
}
|
||||
code = addNamespace(pCxt, pRealTable);
|
||||
}
|
||||
break;
|
||||
|
@ -3792,11 +3796,6 @@ 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) {
|
||||
|
|
Loading…
Reference in New Issue