Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7f05f82e
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7f05f82e
编写于
11月 30, 2021
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-11592]<fix>: show create table column and tag result lose escape character
上级
f49aea64
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
80 addition
and
6 deletion
+80
-6
src/client/src/tscLocal.c
src/client/src/tscLocal.c
+6
-6
tests/script/general/parser/columnName_escape.sim
tests/script/general/parser/columnName_escape.sim
+44
-0
tests/script/general/parser/tagName_escape.sim
tests/script/general/parser/tagName_escape.sim
+30
-0
未找到文件。
src/client/src/tscLocal.c
浏览文件 @
7f05f82e
...
...
@@ -636,9 +636,9 @@ static int32_t tscRebuildDDLForNormalTable(SSqlObj *pSql, const char *tableName,
if
(
type
==
TSDB_DATA_TYPE_NCHAR
)
{
bytes
=
bytes
/
TSDB_NCHAR_SIZE
;
}
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
}
else
{
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
);
}
}
sprintf
(
result
+
strlen
(
result
)
-
1
,
"%s"
,
")"
);
...
...
@@ -663,9 +663,9 @@ static int32_t tscRebuildDDLForSuperTable(SSqlObj *pSql, const char *tableName,
if
(
type
==
TSDB_DATA_TYPE_NCHAR
)
{
bytes
=
bytes
/
TSDB_NCHAR_SIZE
;
}
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
}
else
{
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
type
].
name
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
type
].
name
);
}
}
snprintf
(
result
+
strlen
(
result
)
-
1
,
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"%s %s"
,
")"
,
"TAGS ("
);
...
...
@@ -677,9 +677,9 @@ static int32_t tscRebuildDDLForSuperTable(SSqlObj *pSql, const char *tableName,
if
(
type
==
TSDB_DATA_TYPE_NCHAR
)
{
bytes
=
bytes
/
TSDB_NCHAR_SIZE
;
}
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s(%d),"
,
pSchema
[
i
].
name
,
tDataTypes
[
pSchema
[
i
].
type
].
name
,
bytes
);
}
else
{
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
%s
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
type
].
name
);
snprintf
(
result
+
strlen
(
result
),
TSDB_MAX_BINARY_LEN
-
strlen
(
result
),
"
`%s`
%s,"
,
pSchema
[
i
].
name
,
tDataTypes
[
type
].
name
);
}
}
sprintf
(
result
+
strlen
(
result
)
-
1
,
"%s"
,
")"
);
...
...
tests/script/general/parser/columnName_escape.sim
浏览文件 @
7f05f82e
...
...
@@ -423,4 +423,48 @@ if $data04 != 1 then
return -1
endi
print ======================= test show create table/stable
sql create table tb3 (ts timestamp, `123` int, `123 456` int, `123.abc` int)
sql create table stb3 (ts timestamp, `123` int, `123 456` int, `123.abc` int) tags (t1 int)
sql create table ctb3 using stb3 tags (1)
sql show create table tb3;
if $rows != 1 then
return -1
endi
if $data00 != @tb3@ then
return -1
endi
if $data01 != @create table `tb3` (`ts` TIMESTAMP,`123` INT,`123 456` INT,`123.abc` INT)@ then
return -1
endi
sql show create stable stb3;
if $rows != 1 then
return -1
endi
if $data00 != @stb3@ then
return -1
endi
if $data01 != @create table `stb3` (`ts` TIMESTAMP,`123` INT,`123 456` INT,`123.abc` INT) TAGS (`t1` INT)@ then
return -1
endi
sql show create table ctb3;
if $rows != 1 then
return -1
endi
if $data00 != @ctb3@ then
return -1
endi
if $data01 != @CREATE TABLE `ctb3` USING `stb3` TAGS (1)@ then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/general/parser/tagName_escape.sim
浏览文件 @
7f05f82e
...
...
@@ -203,5 +203,35 @@ if $data24 != NULL then
return -1
endi
print ======================= test show create table/stable
sql create stable stb3 (ts timestamp, c0 int) tags (`123` int, `123 456` int, `123.abc` int)
sql create table ctb3 using stb3 (`123`, `123 456`, `123.abc`) tags (1, 1, 1)
sql show create table stb3;
if $rows != 1 then
return -1
endi
if $data00 != @stb3@ then
return -1
endi
if $data01 != @create table `stb3` (`ts` TIMESTAMP,`c0` INT) TAGS (`123` INT,`123 456` INT,`123.abc` INT)@ then
return -1
endi
sql show create table ctb3;
if $rows != 1 then
return -1
endi
if $data00 != @ctb3@ then
return -1
endi
if $data01 != @CREATE TABLE `ctb3` USING `stb3` TAGS (1,1,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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录