fix: report error when the ttl value is too large
This commit is contained in:
parent
c1df349d4e
commit
22aa4f1528
|
@ -1905,10 +1905,11 @@ SNode* setTableOption(SAstCreateContext* pCxt, SNode* pOptions, ETableOptionType
|
||||||
case TABLE_OPTION_TTL: {
|
case TABLE_OPTION_TTL: {
|
||||||
int64_t ttl = taosStr2Int64(((SToken*)pVal)->z, NULL, 10);
|
int64_t ttl = taosStr2Int64(((SToken*)pVal)->z, NULL, 10);
|
||||||
if (ttl > INT32_MAX) {
|
if (ttl > INT32_MAX) {
|
||||||
ttl = INT32_MAX;
|
pCxt->errCode = TSDB_CODE_TSC_VALUE_OUT_OF_RANGE;
|
||||||
|
} else {
|
||||||
|
// ttl can not be smaller than 0, because there is a limitation in sql.y (TTL NK_INTEGER)
|
||||||
|
((STableOptions*)pOptions)->ttl = ttl;
|
||||||
}
|
}
|
||||||
// ttl can not be smaller than 0, because there is a limitation in sql.y (TTL NK_INTEGER)
|
|
||||||
((STableOptions*)pOptions)->ttl = ttl;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TABLE_OPTION_SMA:
|
case TABLE_OPTION_SMA:
|
||||||
|
|
Loading…
Reference in New Issue