diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 39b1a5e8d3ce6e86d51a760f65f21052ced3b17c..9a3b36895da6e1e76735afbdd2b58c98b28949f2 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -6020,7 +6020,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { int16_t i; uint32_t nLen = 0; for (i = 0; i < numOfColumns; ++i) { - nLen += pSchema[i].colId != columnIndex.columnIndex ? pSchema[i].bytes : pItem->bytes; + nLen += (i != columnIndex.columnIndex) ? pSchema[i].bytes : pItem->bytes; } if (nLen >= TSDB_MAX_BYTES_PER_ROW) { return invalidOperationMsg(pMsg, msg24); @@ -6071,7 +6071,7 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { int16_t i; uint32_t nLen = 0; for (i = 0; i < numOfTags; ++i) { - nLen += pSchema[i].colId != columnIndex.columnIndex ? pSchema[i].bytes : pItem->bytes; + nLen += (i != columnIndex.columnIndex) ? pSchema[i].bytes : pItem->bytes; } if (nLen >= TSDB_MAX_TAGS_LEN) { return invalidOperationMsg(pMsg, msg24);