Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
2d0bcfbe
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2d0bcfbe
编写于
7月 15, 2021
作者:
sangshuduo
提交者:
GitHub
7月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5242]<feature>: taosdemo support max columns align with TSDB defines. (#6866)
上级
6fc8211a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
35 deletion
+32
-35
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+32
-35
未找到文件。
src/kit/taosdemo/taosdemo.c
浏览文件 @
2d0bcfbe
...
...
@@ -75,7 +75,7 @@ enum TEST_MODE {
#define MAX_RECORDS_PER_REQ 32766
#define HEAD_BUFF_LEN
1024*24 // 16*1024
+ (192+32)*2 + insert into ..
#define HEAD_BUFF_LEN
TSDB_MAX_COLUMNS*24 // 16*MAX_COLUMNS
+ (192+32)*2 + insert into ..
#define MAX_SQL_SIZE 65536
#define BUFFER_SIZE (65536*2)
...
...
@@ -84,26 +84,23 @@ enum TEST_MODE {
#define MAX_PASSWORD_SIZE 64
#define MAX_HOSTNAME_SIZE 64
#define MAX_TB_NAME_SIZE 64
#define MAX_DATA_SIZE (16*1024)+20 // max record len: 16*1024, timestamp string and ,('') need extra space
#define MAX_NUM_DATATYPE 10
#define MAX_DATA_SIZE (16*TSDB_MAX_COLUMNS)+20 // max record len: 16*MAX_COLUMNS, timestamp string and ,('') need extra space
#define OPT_ABORT 1
/* –abort */
#define STRING_LEN 60000
#define MAX_PREPARED_RAND 1000000
#define MAX_FILE_NAME_LEN 256 // max file name length on linux is 255.
#define
MAX_SAMPLES_ONCE_FROM_FILE 10000
#define
MAX_NUM_DATATYPE 10
#define MAX_SAMPLES_ONCE_FROM_FILE 10000
#define
MAX_NUM_COLUMNS (TSDB_MAX_COLUMNS - 1) // exclude first column timestamp
#define MAX_DB_COUNT 8
#define MAX_SUPER_TABLE_COUNT 200
#define MAX_COLUMN_COUNT 1024
#define MAX_TAG_COUNT 128
#define MAX_DB_COUNT 8
#define MAX_SUPER_TABLE_COUNT 200
#define
MAX_QUERY_SQL_COUNT
100
#define
MAX_QUERY_SQL_LENGTH
1024
#define
MAX_QUERY_SQL_COUNT
100
#define
MAX_QUERY_SQL_LENGTH
1024
#define
MAX_DATABASE_COUNT
256
#define INPUT_BUF_LEN 256
#define
MAX_DATABASE_COUNT
256
#define INPUT_BUF_LEN
256
#define DEFAULT_TIMESTAMP_STEP 1
...
...
@@ -218,7 +215,7 @@ typedef struct SArguments_S {
bool
performance_print
;
char
*
output_file
;
bool
async_mode
;
char
*
datatype
[
MAX_NUM_
DATATYPE
+
1
];
char
*
datatype
[
MAX_NUM_
COLUMNS
+
1
];
uint32_t
len_of_binary
;
uint32_t
num_of_CPR
;
uint32_t
num_of_threads
;
...
...
@@ -274,9 +271,9 @@ typedef struct SSuperTable_S {
char
tagsFile
[
MAX_FILE_NAME_LEN
];
uint32_t
columnCount
;
StrColumn
columns
[
MAX_COLUMN_COUNT
];
StrColumn
columns
[
TSDB_MAX_COLUMNS
];
uint32_t
tagCount
;
StrColumn
tags
[
MAX_TAG_COUNT
];
StrColumn
tags
[
TSDB_MAX_TAGS
];
char
*
childTblName
;
char
*
colsOfCreateChildTable
;
...
...
@@ -731,7 +728,7 @@ static void printHelp() {
"The number of columns per record. Default is "
,
DEFAULT_DATATYPE_NUM
,
". Max values is "
,
MAX_NUM_
DATATYPE
);
MAX_NUM_
COLUMNS
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
indent
,
indent
,
"All of the new column(s) type is INT. If use -b to specify column type, -l will be ignored."
);
printf
(
"%s%s%s%s
\n
"
,
indent
,
"-T"
,
indent
,
...
...
@@ -937,16 +934,16 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
arguments
->
num_of_CPR
=
atoi
(
argv
[
++
i
]);
if
(
arguments
->
num_of_CPR
>
MAX_NUM_
DATATYPE
)
{
printf
(
"WARNING: max acceptible columns count is %d
\n
"
,
MAX_NUM_
DATATYPE
);
if
(
arguments
->
num_of_CPR
>
MAX_NUM_
COLUMNS
)
{
printf
(
"WARNING: max acceptible columns count is %d
\n
"
,
MAX_NUM_
COLUMNS
);
prompt
();
arguments
->
num_of_CPR
=
MAX_NUM_
DATATYPE
;
arguments
->
num_of_CPR
=
MAX_NUM_
COLUMNS
;
}
for
(
int
col
=
DEFAULT_DATATYPE_NUM
;
col
<
arguments
->
num_of_CPR
;
col
++
)
{
arguments
->
datatype
[
col
]
=
"INT"
;
}
for
(
int
col
=
arguments
->
num_of_CPR
;
col
<
MAX_NUM_
DATATYPE
;
col
++
)
{
for
(
int
col
=
arguments
->
num_of_CPR
;
col
<
MAX_NUM_
COLUMNS
;
col
++
)
{
arguments
->
datatype
[
col
]
=
NULL
;
}
...
...
@@ -999,7 +996,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
arguments
->
datatype
[
index
++
]
=
token
;
token
=
strsep
(
&
running
,
","
);
if
(
index
>=
MAX_NUM_
DATATYPE
)
break
;
if
(
index
>=
MAX_NUM_
COLUMNS
)
break
;
}
arguments
->
datatype
[
index
]
=
NULL
;
}
...
...
@@ -1095,7 +1092,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
}
int
columnCount
;
for
(
columnCount
=
0
;
columnCount
<
MAX_NUM_
DATATYPE
;
columnCount
++
)
{
for
(
columnCount
=
0
;
columnCount
<
MAX_NUM_
COLUMNS
;
columnCount
++
)
{
if
(
g_args
.
datatype
[
columnCount
]
==
NULL
)
{
break
;
}
...
...
@@ -1120,7 +1117,7 @@ static void parse_args(int argc, char *argv[], SArguments *arguments) {
arguments
->
use_metric
?
"true"
:
"false"
);
if
(
*
(
arguments
->
datatype
))
{
printf
(
"# Specified data type: "
);
for
(
int
i
=
0
;
i
<
MAX_NUM_
DATATYPE
;
i
++
)
for
(
int
i
=
0
;
i
<
MAX_NUM_
COLUMNS
;
i
++
)
if
(
arguments
->
datatype
[
i
])
printf
(
"%s,"
,
arguments
->
datatype
[
i
]);
else
...
...
@@ -3378,9 +3375,9 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
}
int
columnSize
=
cJSON_GetArraySize
(
columns
);
if
((
columnSize
+
1
/* ts */
)
>
MAX_COLUMN_COUNT
)
{
if
((
columnSize
+
1
/* ts */
)
>
TSDB_MAX_COLUMNS
)
{
errorPrint
(
"%s() LN%d, failed to read json, column size overflow, max column size is %d
\n
"
,
__func__
,
__LINE__
,
MAX_COLUMN_COUNT
);
__func__
,
__LINE__
,
TSDB_MAX_COLUMNS
);
goto
PARSE_OVER
;
}
...
...
@@ -3436,9 +3433,9 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
}
}
if
((
index
+
1
/* ts */
)
>
MAX_
COLUMN_COUNT
)
{
if
((
index
+
1
/* ts */
)
>
MAX_
NUM_COLUMNS
)
{
errorPrint
(
"%s() LN%d, failed to read json, column size overflow, allowed max column size is %d
\n
"
,
__func__
,
__LINE__
,
MAX_
COLUMN_COUNT
);
__func__
,
__LINE__
,
MAX_
NUM_COLUMNS
);
goto
PARSE_OVER
;
}
...
...
@@ -3455,9 +3452,9 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
}
int
tagSize
=
cJSON_GetArraySize
(
tags
);
if
(
tagSize
>
MAX_TAG_COUNT
)
{
if
(
tagSize
>
TSDB_MAX_TAGS
)
{
errorPrint
(
"%s() LN%d, failed to read json, tags size overflow, max tag size is %d
\n
"
,
__func__
,
__LINE__
,
MAX_TAG_COUNT
);
__func__
,
__LINE__
,
TSDB_MAX_TAGS
);
goto
PARSE_OVER
;
}
...
...
@@ -3507,17 +3504,17 @@ static bool getColumnAndTagTypeFromInsertJsonFile(
}
}
if
(
index
>
MAX_TAG_COUNT
)
{
if
(
index
>
TSDB_MAX_TAGS
)
{
errorPrint
(
"%s() LN%d, failed to read json, tags size overflow, allowed max tag count is %d
\n
"
,
__func__
,
__LINE__
,
MAX_TAG_COUNT
);
__func__
,
__LINE__
,
TSDB_MAX_TAGS
);
goto
PARSE_OVER
;
}
superTbls
->
tagCount
=
index
;
if
((
superTbls
->
columnCount
+
superTbls
->
tagCount
+
1
/* ts */
)
>
MAX_COLUMN_COUNT
)
{
if
((
superTbls
->
columnCount
+
superTbls
->
tagCount
+
1
/* ts */
)
>
TSDB_MAX_COLUMNS
)
{
errorPrint
(
"%s() LN%d, columns + tags is more than allowed max columns count: %d
\n
"
,
__func__
,
__LINE__
,
MAX_COLUMN_COUNT
);
__func__
,
__LINE__
,
TSDB_MAX_COLUMNS
);
goto
PARSE_OVER
;
}
ret
=
true
;
...
...
@@ -7947,7 +7944,7 @@ static void setParaFromArg(){
g_Dbs
.
db
[
0
].
superTbls
[
0
].
maxSqlLen
=
g_args
.
max_sql_len
;
g_Dbs
.
db
[
0
].
superTbls
[
0
].
columnCount
=
0
;
for
(
int
i
=
0
;
i
<
MAX_NUM_
DATATYPE
;
i
++
)
{
for
(
int
i
=
0
;
i
<
MAX_NUM_
COLUMNS
;
i
++
)
{
if
(
data_type
[
i
]
==
NULL
)
{
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录