From 3342d6aad1866db78ed1e60652137b51401fa6f4 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Fri, 29 Oct 2021 17:54:26 +0800 Subject: [PATCH] reverted tag/column length fix --- src/inc/taos.h | 2 +- src/query/src/qSqlParser.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inc/taos.h b/src/inc/taos.h index d7ec5c263f..4afec942ff 100644 --- a/src/inc/taos.h +++ b/src/inc/taos.h @@ -57,7 +57,7 @@ typedef enum { } TSDB_OPTION; typedef struct taosField { - char name[67]; //65 + 2(for backstick escape characters) + char name[65]; uint8_t type; int16_t bytes; } TAOS_FIELD; diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index 0ffda6083a..dd0e6db876 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -68,6 +68,9 @@ SSqlInfo qSqlParse(const char *pStr) { sqlInfo.valid = false; goto abort_parse; } + case TK_ID: + tscRmEscapeAndTrimToken(&t0); + //fall through default: Parse(pParser, t0.type, t0, &sqlInfo); if (sqlInfo.valid == false) { @@ -617,10 +620,7 @@ void tSetDbName(SStrToken *pCpxName, SStrToken *pDb) { } void tSetColumnInfo(TAOS_FIELD *pField, SStrToken *pName, TAOS_FIELD *pType) { - int32_t maxLen = sizeof(pField->name) / sizeof(pField->name[0]) - TS_ESCAPE_CHAR_SIZE; - if (pName->z[0] == '`' && pName->z[pName->n - 1] == '`') { - maxLen = maxLen + TS_ESCAPE_CHAR_SIZE; - } + int32_t maxLen = sizeof(pField->name) / sizeof(pField->name[0]); // column name is too long, set the it to be invalid. if ((int32_t) pName->n >= maxLen) { -- GitLab