diff --git a/src/common/src/tvariant.c b/src/common/src/tvariant.c index 7798deaa60db0fb0616a5558d7e7419b697f3082..c872d8731b572661a35ca91248afd167fefca0bf 100644 --- a/src/common/src/tvariant.c +++ b/src/common/src/tvariant.c @@ -48,6 +48,13 @@ void tVariantCreate(tVariant *pVar, SStrToken *token) { case TSDB_DATA_TYPE_INT:{ ret = tStrToInteger(token->z, token->type, token->n, &pVar->i64, true); if (ret != 0) { + SStrToken t = {0}; + tSQLGetToken(token->z, &t.type); + if (t.type == TK_MINUS) { // it is a signed number which is greater than INT64_MAX or less than INT64_MIN + pVar->nType = -1; // -1 means error type + return; + } + // data overflow, try unsigned parse the input number ret = tStrToInteger(token->z, token->type, token->n, &pVar->i64, false); if (ret != 0) {