[TD-5765]<hotfix>:check max length when alter tag value
This commit is contained in:
parent
e45b047e5f
commit
8b37c4bba9
|
@ -5884,6 +5884,11 @@ int32_t setAlterTableInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
|
|
||||||
tVariantListItem* pItem = taosArrayGet(pVarList, 1);
|
tVariantListItem* pItem = taosArrayGet(pVarList, 1);
|
||||||
SSchema* pTagsSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex);
|
SSchema* pTagsSchema = tscGetTableColumnSchema(pTableMetaInfo->pTableMeta, columnIndex.columnIndex);
|
||||||
|
|
||||||
|
if (pItem->pVar.nLen > pTagsSchema->bytes * TSDB_NCHAR_SIZE) {
|
||||||
|
return invalidOperationMsg(pMsg, msg14);
|
||||||
|
}
|
||||||
|
|
||||||
pAlterSQL->tagData.data = calloc(1, pTagsSchema->bytes * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
|
pAlterSQL->tagData.data = calloc(1, pTagsSchema->bytes * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
|
||||||
|
|
||||||
if (tVariantDump(&pItem->pVar, pAlterSQL->tagData.data, pTagsSchema->type, true) != TSDB_CODE_SUCCESS) {
|
if (tVariantDump(&pItem->pVar, pAlterSQL->tagData.data, pTagsSchema->type, true) != TSDB_CODE_SUCCESS) {
|
||||||
|
|
Loading…
Reference in New Issue