diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 3c52c32f0d88abdb00d4cc3b213c3a8fc2a2e2ce..bb31b752a1bd5856f45dde901c6c589c92063279 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7401,6 +7401,9 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } SColumnIndex idx = COLUMN_INDEX_INITIALIZER; + if (pItem->pVar.nType != TSDB_DATA_TYPE_BINARY) { + return invalidOperationMsg(pMsg, msg17); + } SStrToken name = {.z = pItem->pVar.pz, .n = pItem->pVar.nLen}; if (getColumnIndexByName(&name, pQueryInfo, &idx, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { @@ -7474,6 +7477,9 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { int16_t numOfTags = tscGetNumOfTags(pTableMeta); SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; + if (item->pVar.nType != TSDB_DATA_TYPE_BINARY) { + return invalidOperationMsg(pMsg, msg17); + } SStrToken name = {.z = item->pVar.pz, .n = item->pVar.nLen}; if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) { return TSDB_CODE_TSC_INVALID_OPERATION; @@ -7619,6 +7625,9 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { tVariantListItem* pItem = taosArrayGet(pAlterSQL->varList, 0); SColumnIndex columnIndex = COLUMN_INDEX_INITIALIZER; + if (pItem->pVar.nType != TSDB_DATA_TYPE_BINARY) { + return invalidOperationMsg(pMsg, msg17); + } SStrToken name = {.z = pItem->pVar.pz, .n = pItem->pVar.nLen}; if (getColumnIndexByName(&name, pQueryInfo, &columnIndex, tscGetErrorMsgPayload(pCmd)) != TSDB_CODE_SUCCESS) {