Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1f6715c0
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看板
提交
1f6715c0
编写于
7月 06, 2021
作者:
haoranc
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of github.com:taosdata/TDengine into release/ver-2.1.4.1
上级
24a56eb1
7c869c76
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
47 addition
and
120 deletion
+47
-120
packaging/tools/install.sh
packaging/tools/install.sh
+1
-0
packaging/tools/install_arbi.sh
packaging/tools/install_arbi.sh
+1
-0
packaging/tools/install_arbi_power.sh
packaging/tools/install_arbi_power.sh
+1
-0
packaging/tools/install_client.sh
packaging/tools/install_client.sh
+1
-0
packaging/tools/install_client_power.sh
packaging/tools/install_client_power.sh
+1
-0
packaging/tools/install_power.sh
packaging/tools/install_power.sh
+1
-0
packaging/tools/install_tq.sh
packaging/tools/install_tq.sh
+1
-0
packaging/tools/make_install.sh
packaging/tools/make_install.sh
+2
-0
src/kit/taosdemo/taosdemo.c
src/kit/taosdemo/taosdemo.c
+38
-120
未找到文件。
packaging/tools/install.sh
浏览文件 @
1f6715c0
...
@@ -270,6 +270,7 @@ function install_jemalloc() {
...
@@ -270,6 +270,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_arbi.sh
浏览文件 @
1f6715c0
...
@@ -165,6 +165,7 @@ function install_jemalloc() {
...
@@ -165,6 +165,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_arbi_power.sh
浏览文件 @
1f6715c0
...
@@ -158,6 +158,7 @@ function install_jemalloc() {
...
@@ -158,6 +158,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_client.sh
浏览文件 @
1f6715c0
...
@@ -182,6 +182,7 @@ function install_jemalloc() {
...
@@ -182,6 +182,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_client_power.sh
浏览文件 @
1f6715c0
...
@@ -182,6 +182,7 @@ function install_jemalloc() {
...
@@ -182,6 +182,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_power.sh
浏览文件 @
1f6715c0
...
@@ -263,6 +263,7 @@ function install_jemalloc() {
...
@@ -263,6 +263,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/install_tq.sh
浏览文件 @
1f6715c0
...
@@ -270,6 +270,7 @@ function install_jemalloc() {
...
@@ -270,6 +270,7 @@ function install_jemalloc() {
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-d
/usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
${
csudo
}
/usr/bin/install
-c
-m
644
${
jemalloc_dir
}
/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
packaging/tools/make_install.sh
浏览文件 @
1f6715c0
...
@@ -176,6 +176,7 @@ function install_bin() {
...
@@ -176,6 +176,7 @@ function install_bin() {
[
-x
${
install_main_dir
}
/bin/remove_client.sh
]
&&
${
csudo
}
ln
-s
${
install_main_dir
}
/bin/remove_client.sh
${
bin_link_dir
}
/rmtaos
||
:
[
-x
${
install_main_dir
}
/bin/remove_client.sh
]
&&
${
csudo
}
ln
-s
${
install_main_dir
}
/bin/remove_client.sh
${
bin_link_dir
}
/rmtaos
||
:
fi
fi
}
}
function
install_jemalloc
()
{
function
install_jemalloc
()
{
if
[
"
$osType
"
!=
"Darwin"
]
;
then
if
[
"
$osType
"
!=
"Darwin"
]
;
then
/usr/bin/install
-c
-d
/usr/local/bin
/usr/bin/install
-c
-d
/usr/local/bin
...
@@ -217,6 +218,7 @@ function install_jemalloc() {
...
@@ -217,6 +218,7 @@ function install_jemalloc() {
/usr/bin/install
-c
-d
/usr/local/share/man/man3
/usr/bin/install
-c
-d
/usr/local/share/man/man3
/usr/bin/install
-c
-m
644
${
binary_dir
}
/build/share/man/man3/jemalloc.3 /usr/local/share/man/man3
/usr/bin/install
-c
-m
644
${
binary_dir
}
/build/share/man/man3/jemalloc.3 /usr/local/share/man/man3
fi
fi
${
csudo
}
ldconfig
fi
fi
}
}
...
...
src/kit/taosdemo/taosdemo.c
浏览文件 @
1f6715c0
...
@@ -3216,6 +3216,13 @@ static int readTagFromCsvFileToMem(SSuperTable * superTblInfo) {
...
@@ -3216,6 +3216,13 @@ static int readTagFromCsvFileToMem(SSuperTable * superTblInfo) {
return
0
;
return
0
;
}
}
#if 0
int readSampleFromJsonFileToMem(SSuperTable * superTblInfo) {
// TODO
return 0;
}
#endif
/*
/*
Read 10000 lines at most. If more than 10000 lines, continue to read after using
Read 10000 lines at most. If more than 10000 lines, continue to read after using
*/
*/
...
@@ -5331,7 +5338,7 @@ static int64_t generateInterlaceDataWithoutStb(
...
@@ -5331,7 +5338,7 @@ static int64_t generateInterlaceDataWithoutStb(
#if STMT_IFACE_ENABLED == 1
#if STMT_IFACE_ENABLED == 1
static
int32_t
prepareStmtBindArrayByType
(
TAOS_BIND
*
bind
,
static
int32_t
prepareStmtBindArrayByType
(
TAOS_BIND
*
bind
,
char
*
dataType
,
int32_t
dataLen
,
char
**
ptr
,
char
*
value
)
char
*
dataType
,
int32_t
dataLen
,
char
**
ptr
)
{
{
if
(
0
==
strncasecmp
(
dataType
,
if
(
0
==
strncasecmp
(
dataType
,
"BINARY"
,
strlen
(
"BINARY"
)))
{
"BINARY"
,
strlen
(
"BINARY"
)))
{
...
@@ -5341,18 +5348,12 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5341,18 +5348,12 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
return
-
1
;
return
-
1
;
}
}
char
*
bind_binary
=
(
char
*
)
*
ptr
;
char
*
bind_binary
=
(
char
*
)
*
ptr
;
rand_string
(
bind_binary
,
dataLen
);
bind
->
buffer_type
=
TSDB_DATA_TYPE_BINARY
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_BINARY
;
if
(
value
)
{
bind
->
buffer_length
=
dataLen
;
strncpy
(
bind_binary
,
value
,
strlen
(
value
));
bind
->
buffer_length
=
strlen
(
bind_binary
);
}
else
{
rand_string
(
bind_binary
,
dataLen
);
bind
->
buffer_length
=
dataLen
;
}
bind
->
length
=
&
bind
->
buffer_length
;
bind
->
buffer
=
bind_binary
;
bind
->
buffer
=
bind_binary
;
bind
->
length
=
&
bind
->
buffer_length
;
bind
->
is_null
=
NULL
;
bind
->
is_null
=
NULL
;
*
ptr
+=
bind
->
buffer_length
;
*
ptr
+=
bind
->
buffer_length
;
...
@@ -5364,14 +5365,9 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5364,14 +5365,9 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
return
-
1
;
return
-
1
;
}
}
char
*
bind_nchar
=
(
char
*
)
*
ptr
;
char
*
bind_nchar
=
(
char
*
)
*
ptr
;
rand_string
(
bind_nchar
,
dataLen
);
bind
->
buffer_type
=
TSDB_DATA_TYPE_NCHAR
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_NCHAR
;
if
(
value
)
{
strncpy
(
bind_nchar
,
value
,
strlen
(
value
));
}
else
{
rand_string
(
bind_nchar
,
dataLen
);
}
bind
->
buffer_length
=
strlen
(
bind_nchar
);
bind
->
buffer_length
=
strlen
(
bind_nchar
);
bind
->
buffer
=
bind_nchar
;
bind
->
buffer
=
bind_nchar
;
bind
->
length
=
&
bind
->
buffer_length
;
bind
->
length
=
&
bind
->
buffer_length
;
...
@@ -5382,11 +5378,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5382,11 +5378,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"INT"
,
strlen
(
"INT"
)))
{
"INT"
,
strlen
(
"INT"
)))
{
int32_t
*
bind_int
=
(
int32_t
*
)
*
ptr
;
int32_t
*
bind_int
=
(
int32_t
*
)
*
ptr
;
if
(
value
)
{
*
bind_int
=
rand_int
();
*
bind_int
=
atoi
(
value
);
}
else
{
*
bind_int
=
rand_int
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_INT
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_INT
;
bind
->
buffer_length
=
sizeof
(
int32_t
);
bind
->
buffer_length
=
sizeof
(
int32_t
);
bind
->
buffer
=
bind_int
;
bind
->
buffer
=
bind_int
;
...
@@ -5398,11 +5390,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5398,11 +5390,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"BIGINT"
,
strlen
(
"BIGINT"
)))
{
"BIGINT"
,
strlen
(
"BIGINT"
)))
{
int64_t
*
bind_bigint
=
(
int64_t
*
)
*
ptr
;
int64_t
*
bind_bigint
=
(
int64_t
*
)
*
ptr
;
if
(
value
)
{
*
bind_bigint
=
rand_bigint
();
*
bind_bigint
=
atoll
(
value
);
}
else
{
*
bind_bigint
=
rand_bigint
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_BIGINT
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_BIGINT
;
bind
->
buffer_length
=
sizeof
(
int64_t
);
bind
->
buffer_length
=
sizeof
(
int64_t
);
bind
->
buffer
=
bind_bigint
;
bind
->
buffer
=
bind_bigint
;
...
@@ -5414,11 +5402,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5414,11 +5402,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"FLOAT"
,
strlen
(
"FLOAT"
)))
{
"FLOAT"
,
strlen
(
"FLOAT"
)))
{
float
*
bind_float
=
(
float
*
)
*
ptr
;
float
*
bind_float
=
(
float
*
)
*
ptr
;
if
(
value
)
{
*
bind_float
=
rand_float
();
*
bind_float
=
(
float
)
atof
(
value
);
}
else
{
*
bind_float
=
rand_float
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_FLOAT
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_FLOAT
;
bind
->
buffer_length
=
sizeof
(
float
);
bind
->
buffer_length
=
sizeof
(
float
);
bind
->
buffer
=
bind_float
;
bind
->
buffer
=
bind_float
;
...
@@ -5430,11 +5414,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5430,11 +5414,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"DOUBLE"
,
strlen
(
"DOUBLE"
)))
{
"DOUBLE"
,
strlen
(
"DOUBLE"
)))
{
double
*
bind_double
=
(
double
*
)
*
ptr
;
double
*
bind_double
=
(
double
*
)
*
ptr
;
if
(
value
)
{
*
bind_double
=
rand_double
();
*
bind_double
=
atof
(
value
);
}
else
{
*
bind_double
=
rand_double
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_DOUBLE
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_DOUBLE
;
bind
->
buffer_length
=
sizeof
(
double
);
bind
->
buffer_length
=
sizeof
(
double
);
bind
->
buffer
=
bind_double
;
bind
->
buffer
=
bind_double
;
...
@@ -5446,11 +5426,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5446,11 +5426,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"SMALLINT"
,
strlen
(
"SMALLINT"
)))
{
"SMALLINT"
,
strlen
(
"SMALLINT"
)))
{
int16_t
*
bind_smallint
=
(
int16_t
*
)
*
ptr
;
int16_t
*
bind_smallint
=
(
int16_t
*
)
*
ptr
;
if
(
value
)
{
*
bind_smallint
=
rand_smallint
();
*
bind_smallint
=
(
int16_t
)
atoi
(
value
);
}
else
{
*
bind_smallint
=
rand_smallint
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_SMALLINT
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_SMALLINT
;
bind
->
buffer_length
=
sizeof
(
int16_t
);
bind
->
buffer_length
=
sizeof
(
int16_t
);
bind
->
buffer
=
bind_smallint
;
bind
->
buffer
=
bind_smallint
;
...
@@ -5462,11 +5438,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5462,11 +5438,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"TINYINT"
,
strlen
(
"TINYINT"
)))
{
"TINYINT"
,
strlen
(
"TINYINT"
)))
{
int8_t
*
bind_tinyint
=
(
int8_t
*
)
*
ptr
;
int8_t
*
bind_tinyint
=
(
int8_t
*
)
*
ptr
;
if
(
value
)
{
*
bind_tinyint
=
rand_tinyint
();
*
bind_tinyint
=
(
int8_t
)
atoi
(
value
);
}
else
{
*
bind_tinyint
=
rand_tinyint
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_TINYINT
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_TINYINT
;
bind
->
buffer_length
=
sizeof
(
int8_t
);
bind
->
buffer_length
=
sizeof
(
int8_t
);
bind
->
buffer
=
bind_tinyint
;
bind
->
buffer
=
bind_tinyint
;
...
@@ -5489,11 +5461,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
...
@@ -5489,11 +5461,7 @@ static int32_t prepareStmtBindArrayByType(TAOS_BIND *bind,
"TIMESTAMP"
,
strlen
(
"TIMESTAMP"
)))
{
"TIMESTAMP"
,
strlen
(
"TIMESTAMP"
)))
{
int64_t
*
bind_ts2
=
(
int64_t
*
)
*
ptr
;
int64_t
*
bind_ts2
=
(
int64_t
*
)
*
ptr
;
if
(
value
)
{
*
bind_ts2
=
rand_bigint
();
*
bind_ts2
=
atoll
(
value
);
}
else
{
*
bind_ts2
=
rand_bigint
();
}
bind
->
buffer_type
=
TSDB_DATA_TYPE_TIMESTAMP
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_TIMESTAMP
;
bind
->
buffer_length
=
sizeof
(
int64_t
);
bind
->
buffer_length
=
sizeof
(
int64_t
);
bind
->
buffer
=
bind_ts2
;
bind
->
buffer
=
bind_ts2
;
...
@@ -5559,13 +5527,12 @@ static int32_t prepareStmtWithoutStb(
...
@@ -5559,13 +5527,12 @@ static int32_t prepareStmtWithoutStb(
ptr
+=
bind
->
buffer_length
;
ptr
+=
bind
->
buffer_length
;
for
(
int
i
=
0
;
i
<
g_args
.
num_of_CPR
;
i
++
)
{
for
(
int
i
=
0
;
i
<
g_args
.
num_of_CPR
;
i
++
)
{
bind
=
(
TAOS_BIND
*
)((
char
*
)
bindArray
bind
=
(
TAOS_BIND
*
)((
char
*
)
bindArray
+
(
sizeof
(
TAOS_BIND
)
*
(
i
+
1
)));
+
(
sizeof
(
TAOS_BIND
)
*
(
i
+
1
)));
if
(
-
1
==
prepareStmtBindArrayByType
(
if
(
-
1
==
prepareStmtBindArrayByType
(
bind
,
bind
,
data_type
[
i
],
data_type
[
i
],
g_args
.
len_of_binary
,
g_args
.
len_of_binary
,
&
ptr
,
NULL
))
{
&
ptr
))
{
return
-
1
;
return
-
1
;
}
}
}
}
...
@@ -5584,14 +5551,12 @@ static int32_t prepareStmtWithoutStb(
...
@@ -5584,14 +5551,12 @@ static int32_t prepareStmtWithoutStb(
return
k
;
return
k
;
}
}
static
int32_t
prepareStbStmt
(
static
int32_t
prepareStbStmt
(
SSuperTable
*
stbInfo
,
SSuperTable
*
stbInfo
,
TAOS_STMT
*
stmt
,
TAOS_STMT
*
stmt
,
char
*
tableName
,
uint32_t
batch
,
char
*
tableName
,
uint32_t
batch
,
uint64_t
insertRows
,
uint64_t
insertRows
,
uint64_t
recordFrom
,
uint64_t
recordFrom
,
int64_t
startTime
,
int64_t
startTime
,
char
*
buffer
)
int64_t
*
pSamplePos
)
{
{
int
ret
=
taos_stmt_set_tbname
(
stmt
,
tableName
);
int
ret
=
taos_stmt_set_tbname
(
stmt
,
tableName
);
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
...
@@ -5602,24 +5567,16 @@ static int32_t prepareStbStmt(
...
@@ -5602,24 +5567,16 @@ static int32_t prepareStbStmt(
char
*
bindArray
=
malloc
(
sizeof
(
TAOS_BIND
)
*
(
stbInfo
->
columnCount
+
1
));
char
*
bindArray
=
malloc
(
sizeof
(
TAOS_BIND
)
*
(
stbInfo
->
columnCount
+
1
));
if
(
bindArray
==
NULL
)
{
if
(
bindArray
==
NULL
)
{
errorPrint
(
"
%s() LN%d,
Failed to allocate %d bind params
\n
"
,
errorPrint
(
"Failed to allocate %d bind params
\n
"
,
__func__
,
__LINE__
,
(
stbInfo
->
columnCount
+
1
));
(
stbInfo
->
columnCount
+
1
));
return
-
1
;
return
-
1
;
}
}
bool
source
Rand
;
bool
ts
Rand
;
if
(
0
==
strncasecmp
(
stbInfo
->
dataSource
,
"rand"
,
strlen
(
"rand"
)))
{
if
(
0
==
strncasecmp
(
stbInfo
->
dataSource
,
"rand"
,
strlen
(
"rand"
)))
{
source
Rand
=
true
;
ts
Rand
=
true
;
}
else
{
}
else
{
sourceRand
=
false
;
// from sample data file
tsRand
=
false
;
}
char
*
bindBuffer
=
malloc
(
g_args
.
len_of_binary
);
if
(
bindBuffer
==
NULL
)
{
errorPrint
(
"%s() LN%d, Failed to allocate %d bind buffer
\n
"
,
__func__
,
__LINE__
,
g_args
.
len_of_binary
);
free
(
bindArray
);
return
-
1
;
}
}
uint32_t
k
;
uint32_t
k
;
...
@@ -5635,7 +5592,7 @@ static int32_t prepareStbStmt(
...
@@ -5635,7 +5592,7 @@ static int32_t prepareStbStmt(
bind_ts
=
(
int64_t
*
)
ptr
;
bind_ts
=
(
int64_t
*
)
ptr
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_TIMESTAMP
;
bind
->
buffer_type
=
TSDB_DATA_TYPE_TIMESTAMP
;
if
(
source
Rand
)
{
if
(
ts
Rand
)
{
*
bind_ts
=
startTime
+
getTSRandTail
(
*
bind_ts
=
startTime
+
getTSRandTail
(
stbInfo
->
timeStampStep
,
k
,
stbInfo
->
timeStampStep
,
k
,
stbInfo
->
disorderRatio
,
stbInfo
->
disorderRatio
,
...
@@ -5650,46 +5607,14 @@ static int32_t prepareStbStmt(
...
@@ -5650,46 +5607,14 @@ static int32_t prepareStbStmt(
ptr
+=
bind
->
buffer_length
;
ptr
+=
bind
->
buffer_length
;
int
cursor
=
0
;
for
(
int
i
=
0
;
i
<
stbInfo
->
columnCount
;
i
++
)
{
for
(
int
i
=
0
;
i
<
stbInfo
->
columnCount
;
i
++
)
{
bind
=
(
TAOS_BIND
*
)((
char
*
)
bindArray
+
(
sizeof
(
TAOS_BIND
)
*
(
i
+
1
)));
bind
=
(
TAOS_BIND
*
)((
char
*
)
bindArray
+
(
sizeof
(
TAOS_BIND
)
*
(
i
+
1
)));
if
(
-
1
==
prepareStmtBindArrayByType
(
if
(
sourceRand
)
{
bind
,
if
(
-
1
==
prepareStmtBindArrayByType
(
stbInfo
->
columns
[
i
].
dataType
,
bind
,
stbInfo
->
columns
[
i
].
dataLen
,
stbInfo
->
columns
[
i
].
dataType
,
&
ptr
))
{
stbInfo
->
columns
[
i
].
dataLen
,
return
-
1
;
&
ptr
,
NULL
))
{
free
(
bindArray
);
free
(
bindBuffer
);
return
-
1
;
}
}
else
{
char
*
restStr
=
stbInfo
->
sampleDataBuf
+
cursor
;
int
lengthOfRest
=
strlen
(
restStr
);
int
index
=
0
;
for
(
index
=
0
;
index
<
lengthOfRest
;
index
++
)
{
if
(
restStr
[
index
]
==
','
)
{
break
;
}
}
memset
(
bindBuffer
,
0
,
g_args
.
len_of_binary
);
strncpy
(
bindBuffer
,
restStr
,
index
);
cursor
+=
index
+
1
;
// skip ',' too
if
(
-
1
==
prepareStmtBindArrayByType
(
bind
,
stbInfo
->
columns
[
i
].
dataType
,
stbInfo
->
columns
[
i
].
dataLen
,
&
ptr
,
bindBuffer
))
{
free
(
bindArray
);
free
(
bindBuffer
);
return
-
1
;
}
}
}
}
}
taos_stmt_bind_param
(
stmt
,
(
TAOS_BIND
*
)
bindArray
);
taos_stmt_bind_param
(
stmt
,
(
TAOS_BIND
*
)
bindArray
);
...
@@ -5698,16 +5623,11 @@ static int32_t prepareStbStmt(
...
@@ -5698,16 +5623,11 @@ static int32_t prepareStbStmt(
k
++
;
k
++
;
recordFrom
++
;
recordFrom
++
;
if
(
!
sourceRand
)
{
(
*
pSamplePos
)
++
;
}
if
(
recordFrom
>=
insertRows
)
{
if
(
recordFrom
>=
insertRows
)
{
break
;
break
;
}
}
}
}
free
(
bindBuffer
);
free
(
bindArray
);
free
(
bindArray
);
return
k
;
return
k
;
}
}
...
@@ -5900,14 +5820,13 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
...
@@ -5900,14 +5820,13 @@ static void* syncWriteInterlace(threadInfo *pThreadInfo) {
if
(
superTblInfo
)
{
if
(
superTblInfo
)
{
if
(
superTblInfo
->
iface
==
STMT_IFACE
)
{
if
(
superTblInfo
->
iface
==
STMT_IFACE
)
{
#if STMT_IFACE_ENABLED == 1
#if STMT_IFACE_ENABLED == 1
generated
=
prepareStbStmt
(
generated
=
prepareStbStmt
(
superTblInfo
,
superTblInfo
,
pThreadInfo
->
stmt
,
pThreadInfo
->
stmt
,
tableName
,
tableName
,
batchPerTbl
,
batchPerTbl
,
insertRows
,
i
,
insertRows
,
i
,
startTime
,
startTime
,
&
(
pThreadInfo
->
samplePos
)
);
pThreadInfo
->
buffer
);
#else
#else
generated
=
-
1
;
generated
=
-
1
;
#endif
#endif
...
@@ -6132,8 +6051,7 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
...
@@ -6132,8 +6051,7 @@ static void* syncWriteProgressive(threadInfo *pThreadInfo) {
pThreadInfo
->
stmt
,
pThreadInfo
->
stmt
,
tableName
,
tableName
,
g_args
.
num_of_RPR
,
g_args
.
num_of_RPR
,
insertRows
,
i
,
start_time
,
insertRows
,
i
,
start_time
,
pstr
);
&
(
pThreadInfo
->
samplePos
));
#else
#else
generated
=
-
1
;
generated
=
-
1
;
#endif
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录