Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1041396a
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看板
未验证
提交
1041396a
编写于
10月 19, 2021
作者:
Y
Yang Zhao
提交者:
GitHub
10月 19, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10712]<fix>taosdemo escape character (#8320)
* add -E to --help * add escape char to stable * stable escape char
上级
f5d9a1cf
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
7 deletion
+12
-7
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+12
-7
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
1041396a
...
@@ -800,6 +800,8 @@ static void printHelp() {
...
@@ -800,6 +800,8 @@ static void printHelp() {
"Set the replica parameters of the database, By default use 1, min: 1, max: 3."
);
"Set the replica parameters of the database, By default use 1, min: 1, max: 3."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-m, --table-prefix=TABLEPREFIX"
,
"
\t
"
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-m, --table-prefix=TABLEPREFIX"
,
"
\t
"
,
"Table prefix name. By default use 'd'."
);
"Table prefix name. By default use 'd'."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-E, --escape-character"
,
"
\t
"
,
"Use escape character for Both Stable and normmal table name"
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-s, --sql-file=FILE"
,
"
\t\t
"
,
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-s, --sql-file=FILE"
,
"
\t\t
"
,
"The select sql file."
);
"The select sql file."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-N, --normal-table"
,
"
\t\t
"
,
"Use normal table flag."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-N, --normal-table"
,
"
\t\t
"
,
"Use normal table flag."
);
...
@@ -3777,7 +3779,7 @@ static int calcRowLen(SSuperTable* superTbls) {
...
@@ -3777,7 +3779,7 @@ static int calcRowLen(SSuperTable* superTbls) {
static
int
getChildNameOfSuperTableWithLimitAndOffset
(
TAOS
*
taos
,
static
int
getChildNameOfSuperTableWithLimitAndOffset
(
TAOS
*
taos
,
char
*
dbName
,
char
*
stbName
,
char
**
childTblNameOfSuperTbl
,
char
*
dbName
,
char
*
stbName
,
char
**
childTblNameOfSuperTbl
,
int64_t
*
childTblCountOfSuperTbl
,
int64_t
limit
,
uint64_t
offset
)
{
int64_t
*
childTblCountOfSuperTbl
,
int64_t
limit
,
uint64_t
offset
,
bool
escapChar
)
{
char
command
[
1024
]
=
"
\0
"
;
char
command
[
1024
]
=
"
\0
"
;
char
limitBuf
[
100
]
=
"
\0
"
;
char
limitBuf
[
100
]
=
"
\0
"
;
...
@@ -3791,8 +3793,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
...
@@ -3791,8 +3793,8 @@ static int getChildNameOfSuperTableWithLimitAndOffset(TAOS * taos,
limit
,
offset
);
limit
,
offset
);
//get all child table name use cmd: select tbname from superTblName;
//get all child table name use cmd: select tbname from superTblName;
snprintf
(
command
,
1024
,
"select tbname from %s.%s %s"
,
snprintf
(
command
,
1024
,
escapChar
?
"select tbname from %s.`%s` %s"
:
dbName
,
stbName
,
limitBuf
);
"select tbname from %s.%s %s"
,
dbName
,
stbName
,
limitBuf
);
res
=
taos_query
(
taos
,
command
);
res
=
taos_query
(
taos
,
command
);
int32_t
code
=
taos_errno
(
res
);
int32_t
code
=
taos_errno
(
res
);
...
@@ -3863,7 +3865,7 @@ static int getAllChildNameOfSuperTable(TAOS * taos, char* dbName,
...
@@ -3863,7 +3865,7 @@ static int getAllChildNameOfSuperTable(TAOS * taos, char* dbName,
return
getChildNameOfSuperTableWithLimitAndOffset
(
taos
,
dbName
,
stbName
,
return
getChildNameOfSuperTableWithLimitAndOffset
(
taos
,
dbName
,
stbName
,
childTblNameOfSuperTbl
,
childTblCountOfSuperTbl
,
childTblNameOfSuperTbl
,
childTblCountOfSuperTbl
,
-
1
,
0
);
-
1
,
0
,
false
);
}
}
static
int
getSuperTableFromServer
(
TAOS
*
taos
,
char
*
dbName
,
static
int
getSuperTableFromServer
(
TAOS
*
taos
,
char
*
dbName
,
...
@@ -4320,9 +4322,12 @@ static int createSuperTable(
...
@@ -4320,9 +4322,12 @@ static int createSuperTable(
superTbl
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
superTbl
->
lenOfTagOfOneRow
=
lenOfTagOfOneRow
;
snprintf
(
command
,
BUFFER_SIZE
,
snprintf
(
command
,
BUFFER_SIZE
,
"CREATE TABLE IF NOT EXISTS %s.%s (ts TIMESTAMP%s) TAGS %s"
,
superTbl
->
escapeChar
?
dbName
,
superTbl
->
stbName
,
cols
,
tags
);
"CREATE TABLE IF NOT EXISTS %s.`%s` (ts TIMESTAMP%s) TAGS %s"
:
"CREATE TABLE IF NOT EXISTS %s.%s (ts TIMESTAMP%s) TAGS %s"
,
dbName
,
superTbl
->
stbName
,
cols
,
tags
);
if
(
0
!=
queryDbExec
(
taos
,
command
,
NO_INSERT_TYPE
,
false
))
{
if
(
0
!=
queryDbExec
(
taos
,
command
,
NO_INSERT_TYPE
,
false
))
{
errorPrint2
(
"create supertable %s failed!
\n\n
"
,
errorPrint2
(
"create supertable %s failed!
\n\n
"
,
superTbl
->
stbName
);
superTbl
->
stbName
);
...
@@ -10364,7 +10369,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
...
@@ -10364,7 +10369,7 @@ static void startMultiThreadInsertData(int threads, char* db_name,
db_name
,
stbInfo
->
stbName
,
db_name
,
stbInfo
->
stbName
,
&
stbInfo
->
childTblName
,
&
childTblCount
,
&
stbInfo
->
childTblName
,
&
childTblCount
,
limit
,
limit
,
offset
);
offset
,
stbInfo
->
escapeChar
);
ntables
=
childTblCount
;
ntables
=
childTblCount
;
}
else
{
}
else
{
ntables
=
g_args
.
ntables
;
ntables
=
g_args
.
ntables
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录