未验证 提交 41939f11 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #7552 from taosdata/hotfix/TD-5466

[TD-5466]<fix> handle invalid Escapes
...@@ -64,12 +64,15 @@ int32_t strRmquote(char *z, int32_t len){ ...@@ -64,12 +64,15 @@ int32_t strRmquote(char *z, int32_t len){
int32_t j = 0; int32_t j = 0;
for (uint32_t k = 1; k < len - 1; ++k) { for (uint32_t k = 1; k < len - 1; ++k) {
if (z[k] == '\\' || (z[k] == delim && z[k + 1] == delim)) { if (z[k] == '\\' || (z[k] == delim && z[k + 1] == delim)) {
if (z[k] == '\\' && z[k + 1] == '_') {
//match '_' self
} else {
z[j] = z[k + 1]; z[j] = z[k + 1];
cnt++;
cnt++; j++;
j++; k++;
k++; continue;
continue; }
} }
z[j] = z[k]; z[j] = z[k];
......
...@@ -221,3 +221,4 @@ run general/stream/table_replica1_vnoden.sim ...@@ -221,3 +221,4 @@ run general/stream/table_replica1_vnoden.sim
run general/stream/metrics_replica1_vnoden.sim run general/stream/metrics_replica1_vnoden.sim
run general/db/show_create_db.sim run general/db/show_create_db.sim
run general/db/show_create_table.sim run general/db/show_create_table.sim
run general/parser/like.sim
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
system sh/exec.sh -n dnode1 -s start
sleep 10
sql connect
print ======================== dnode1 start
$db = testdb
sql drop database if exists $db
sql create database $db cachelast 2
sql use $db
$table1 = table_name
$table2 = tablexname
sql create table $table1 (ts timestamp, b binary(20))
sql create table $table2 (ts timestamp, b binary(20))
sql insert into $table1 values(now, "table_name")
sql insert into $table1 values(now-1m, "tablexname")
sql insert into $table1 values(now-2m, "tablexxx")
sql insert into $table1 values(now-2m, "table")
sql select b from $table1
if $rows != 4 then
return -1
endi
sql select b from $table1 where b like 'table_name'
if $rows != 2 then
return -1
endi
sql select b from $table1 where b like 'table\_name'
if $rows != 1 then
return -1
endi
sql show tables;
if $rows != 2 then
return -1
endi
sql show tables like 'table_name'
if $rows != 2 then
return -1
endi
sql show tables like 'table\_name'
if $rows != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册