提交 d78ac984 编写于 作者: H Haojun Liao

[td-3967]1) refactor.

上级 bdc88774
......@@ -462,13 +462,19 @@ int tsParseOneRow(char **str, STableDataBlocks *pDataBlocks, SSqlCmd *pCmd, int1
// Remove quotation marks
if (TK_STRING == sToken.type) {
// delete escape character: \\, \', \"
char delim = sToken.z[0];
int32_t cnt = 0;
int32_t j = 0;
for (uint32_t k = 1; k < sToken.n - 1; ++k) {
if (sToken.z[k] == '\\' || (sToken.z[k] == delim && sToken.z[k + 1] == delim)) {
if (sToken.z[k] == '\\') {
cnt++;
tmpTokenBuf[j] = GET_ESCAPE_CHAR(sToken.z[k+1]);
} else {
tmpTokenBuf[j] = sToken.z[k + 1];
}
cnt++;
j++;
k++;
continue;
......
......@@ -93,5 +93,14 @@ if $data41 != @udp005@ then
print "[ERROR] expect: udp005, act:$data41"
endi
print ---------------------> TD-3967
sql insert into tb values(now, '\\abc\\\\');
sql insert into tb values(now, '\\abc\\\\');
sql insert into tb values(now, '\\\\');
print ------------->sim bug
# sql_error insert into tb values(now, '\\\');
# sql_error insert into tb values(now, '\\');
# sql_error insert into tb values(now, '\\n');
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
......@@ -55,4 +55,5 @@ run general/parser/sliding.sim
run general/parser/function.sim
run general/parser/stableOp.sim
run general/parser/slimit_alter_tags.sim
run general/parser/binary_escapeCharacter.sim
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册