[TD-5324]<fix>:check max row bytes when alter tag/column width
This commit is contained in:
parent
411a035c32
commit
9a5402b010
|
@ -6006,6 +6006,16 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
return invalidOperationMsg(pMsg, msg22);
|
return invalidOperationMsg(pMsg, msg22);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSchema* pSchema = (SSchema*) pTableMetaInfo->pTableMeta->schema;
|
||||||
|
int16_t numOfColumns = pTableMetaInfo->pTableMeta->tableInfo.numOfColumns;
|
||||||
|
int16_t i;
|
||||||
|
uint32_t nLen = 0;
|
||||||
|
for (i = 0; i < numOfColumns; ++i) {
|
||||||
|
nLen += pSchema[i].colId != columnIndex.columnIndex ? pSchema[i].bytes : pItem->bytes;
|
||||||
|
}
|
||||||
|
if (nLen >= TSDB_MAX_BYTES_PER_ROW) {
|
||||||
|
return invalidOperationMsg(pMsg, msg24);
|
||||||
|
}
|
||||||
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
|
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
|
||||||
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
|
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
|
||||||
}else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) {
|
}else if (pAlterSQL->type == TSDB_ALTER_TABLE_MODIFY_TAG_COLUMN) {
|
||||||
|
@ -6047,6 +6057,17 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
return invalidOperationMsg(pMsg, msg22);
|
return invalidOperationMsg(pMsg, msg22);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSchema* pSchema = (SSchema*) pTableMetaInfo->pTableMeta->schema;
|
||||||
|
int16_t numOfColumns = pTableMetaInfo->pTableMeta->tableInfo.numOfColumns;
|
||||||
|
int16_t i;
|
||||||
|
uint32_t nLen = 0;
|
||||||
|
for (i = 0; i < numOfColumns; ++i) {
|
||||||
|
nLen += pSchema[i].colId != columnIndex.columnIndex ? pSchema[i].bytes : pItem->bytes;
|
||||||
|
}
|
||||||
|
if (nLen >= TSDB_MAX_BYTES_PER_ROW) {
|
||||||
|
return invalidOperationMsg(pMsg, msg24);
|
||||||
|
}
|
||||||
|
|
||||||
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
|
TAOS_FIELD f = tscCreateField(pColSchema->type, name.z, pItem->bytes);
|
||||||
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
|
tscFieldInfoAppend(&pQueryInfo->fieldsInfo, &f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue