提交 57b60923 编写于 作者: G Ganlin Zhao

[TD-10700]<enhance>: The escape char backstick can be used for both tag name and column name

上级 0ecf6625
...@@ -1251,10 +1251,18 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat ...@@ -1251,10 +1251,18 @@ static int32_t parseBoundColumns(SInsertStatementParam *pInsertParam, SParsedDat
sToken = tStrGetToken(str, &index, false); sToken = tStrGetToken(str, &index, false);
str += index; str += index;
char tmpTokenBuf[TSDB_MAX_BYTES_PER_ROW] = {0}; // used for deleting Escape character backstick(`)
strncpy(tmpTokenBuf, sToken.z, sToken.n);
sToken.z = tmpTokenBuf;
if (TK_STRING == sToken.type) { if (TK_STRING == sToken.type) {
tscDequoteAndTrimToken(&sToken); tscDequoteAndTrimToken(&sToken);
} }
if (TK_ID == sToken.type) {
tscRmEscapeAndTrimToken(&sToken);
}
if (sToken.type == TK_RP) { if (sToken.type == TK_RP) {
if (end != NULL) { // set the end position if (end != NULL) { // set the end position
*end = str; *end = str;
......
...@@ -628,7 +628,7 @@ SStrToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr) { ...@@ -628,7 +628,7 @@ SStrToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr) {
t0.n = 0; t0.n = 0;
return t0; return t0;
} }
t = str[++(*i)]; t = str[++(*i)];
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册