add error

This commit is contained in:
Yihao Deng 2024-05-31 09:34:41 +00:00
parent b8e63fa5f4
commit 9f0d6eddae
1 changed files with 5 additions and 1 deletions

View File

@ -1907,9 +1907,13 @@ SNode* createAlterTableAddModifyColOptions2(SAstCreateContext* pCxt, SNode* pRea
COPY_STRING_FORM_ID_TOKEN(pStmt->colName, pColName);
pStmt->dataType = dataType;
// if pOptions is NULL, it means that the column has no options
if (pOptions != NULL) {
SColumnOptions* pOption = (SColumnOptions*)pOptions;
if (strlen(pOption->compress) != 0 || strlen(pOption->compressLevel) || strlen(pOption->encode) != 0) {
pStmt->alterType = TSDB_ALTER_TABLE_ADD_COLUMN_WITH_COMPRESS_OPTION;
}
}
pStmt->pColOptions = (SColumnOptions*)pOptions;
return createAlterTableStmtFinalize(pRealTable, pStmt);
}