Merge pull request #15097 from taosdata/feature/TD-14761

fix:tag is too long if type is nchar in schemaless influxdb
This commit is contained in:
WANG MINGMING 2022-07-19 16:48:03 +08:00 committed by GitHub
commit 321ea5eb81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1217,6 +1217,9 @@ static int32_t smlParseCols(const char *data, int32_t len, SArray *cols, char *c
kv->value = value; kv->value = value;
kv->length = valueLen; kv->length = valueLen;
if (isTag) { if (isTag) {
if(valueLen > (TSDB_MAX_NCHAR_LEN - VARSTR_HEADER_SIZE) / TSDB_NCHAR_SIZE){
return TSDB_CODE_PAR_INVALID_VAR_COLUMN_LEN;
}
kv->type = TSDB_DATA_TYPE_NCHAR; kv->type = TSDB_DATA_TYPE_NCHAR;
} else { } else {
int32_t ret = smlParseValue(kv, msg); int32_t ret = smlParseValue(kv, msg);