Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
7f18cc5b
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
7f18cc5b
编写于
12月 20, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
12月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19030 from taosdata/main
merge from main to 3.0
上级
d39268ee
247342c4
变更
29
显示空白变更内容
内联
并排
Showing
29 changed file
with
2816 addition
and
104 deletion
+2816
-104
examples/c/tmq.c
examples/c/tmq.c
+18
-16
include/client/taos.h
include/client/taos.h
+9
-6
include/common/tglobal.h
include/common/tglobal.h
+1
-0
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+3
-0
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+1
-0
source/client/src/clientTmq.c
source/client/src/clientTmq.c
+12
-1
source/common/src/tglobal.c
source/common/src/tglobal.c
+4
-3
source/dnode/mnode/impl/inc/mndDef.h
source/dnode/mnode/impl/inc/mndDef.h
+1
-0
source/dnode/mnode/impl/src/mndTrans.c
source/dnode/mnode/impl/src/mndTrans.c
+10
-2
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+4
-4
source/dnode/vnode/src/meta/metaSnapshot.c
source/dnode/vnode/src/meta/metaSnapshot.c
+3
-0
source/dnode/vnode/src/meta/metaTable.c
source/dnode/vnode/src/meta/metaTable.c
+3
-0
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
+1
-1
source/libs/command/src/command.c
source/libs/command/src/command.c
+3
-7
source/libs/parser/src/parAstParser.c
source/libs/parser/src/parAstParser.c
+43
-14
source/libs/parser/src/parAuthenticator.c
source/libs/parser/src/parAuthenticator.c
+20
-0
source/libs/parser/src/parInsertSql.c
source/libs/parser/src/parInsertSql.c
+6
-9
source/libs/planner/src/planLogicCreater.c
source/libs/planner/src/planLogicCreater.c
+4
-0
source/libs/scheduler/src/schRemote.c
source/libs/scheduler/src/schRemote.c
+1
-0
source/libs/sync/src/syncPipeline.c
source/libs/sync/src/syncPipeline.c
+20
-4
source/libs/tdb/src/db/tdbPage.c
source/libs/tdb/src/db/tdbPage.c
+3
-0
source/libs/tdb/src/db/tdbPager.c
source/libs/tdb/src/db/tdbPager.c
+15
-5
source/libs/tdb/src/db/tdbTable.c
source/libs/tdb/src/db/tdbTable.c
+8
-8
source/libs/tdb/src/inc/tdbInt.h
source/libs/tdb/src/inc/tdbInt.h
+1
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+4
-0
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+5
-0
tests/script/tmp/data.sim
tests/script/tmp/data.sim
+7
-1
tests/system-test/2-query/insert_null_none.py
tests/system-test/2-query/insert_null_none.py
+2579
-0
tools/shell/src/shellAuto.c
tools/shell/src/shellAuto.c
+27
-22
未找到文件。
examples/c/tmq.c
浏览文件 @
7f18cc5b
...
@@ -40,7 +40,7 @@ static int32_t msg_process(TAOS_RES* msg) {
...
@@ -40,7 +40,7 @@ static int32_t msg_process(TAOS_RES* msg) {
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
msg
);
TAOS_FIELD
*
fields
=
taos_fetch_fields
(
msg
);
int32_t
numOfFields
=
taos_field_count
(
msg
);
int32_t
numOfFields
=
taos_field_count
(
msg
);
//int32_t* length = taos_fetch_lengths(msg);
//
int32_t* length = taos_fetch_lengths(msg);
int32_t
precision
=
taos_result_precision
(
msg
);
int32_t
precision
=
taos_result_precision
(
msg
);
rows
++
;
rows
++
;
taos_print_row
(
buf
,
row
,
fields
,
numOfFields
);
taos_print_row
(
buf
,
row
,
fields
,
numOfFields
);
...
@@ -62,14 +62,12 @@ static int32_t init_env() {
...
@@ -62,14 +62,12 @@ static int32_t init_env() {
pRes
=
taos_query
(
pConn
,
"drop topic topicname"
);
pRes
=
taos_query
(
pConn
,
"drop topic topicname"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in drop tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"error in drop tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"drop database if exists tmqdb"
);
pRes
=
taos_query
(
pConn
,
"drop database if exists tmqdb"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in drop tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"error in drop tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
...
@@ -77,7 +75,7 @@ static int32_t init_env() {
...
@@ -77,7 +75,7 @@ static int32_t init_env() {
pRes
=
taos_query
(
pConn
,
"create database tmqdb precision 'ns'"
);
pRes
=
taos_query
(
pConn
,
"create database tmqdb precision 'ns'"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"error in create tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"error in create tmqdb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
...
@@ -87,7 +85,7 @@ static int32_t init_env() {
...
@@ -87,7 +85,7 @@ static int32_t init_env() {
pConn
,
"create table tmqdb.stb (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
);
pConn
,
"create table tmqdb.stb (ts timestamp, c1 int, c2 float, c3 varchar(16)) tags(t1 int, t3 varchar(16))"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table stb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to create super table stb, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
...
@@ -96,28 +94,28 @@ static int32_t init_env() {
...
@@ -96,28 +94,28 @@ static int32_t init_env() {
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb0 using tmqdb.stb tags(0, 'subtable0')"
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb0 using tmqdb.stb tags(0, 'subtable0')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to create super table ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb1 using tmqdb.stb tags(1, 'subtable1')"
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb1 using tmqdb.stb tags(1, 'subtable1')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table ctb1, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to create super table ctb1, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb2 using tmqdb.stb tags(2, 'subtable2')"
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb2 using tmqdb.stb tags(2, 'subtable2')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table ctb2, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to create super table ctb2, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb3 using tmqdb.stb tags(3, 'subtable3')"
);
pRes
=
taos_query
(
pConn
,
"create table tmqdb.ctb3 using tmqdb.stb tags(3, 'subtable3')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to create super table ctb3, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to create super table ctb3, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
...
@@ -126,33 +124,37 @@ static int32_t init_env() {
...
@@ -126,33 +124,37 @@ static int32_t init_env() {
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb0 values(now, 0, 0, 'a0')(now+1s, 0, 0, 'a00')"
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb0 values(now, 0, 0, 'a0')(now+1s, 0, 0, 'a00')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb1 values(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11')"
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb1 values(now, 1, 1, 'a1')(now+1s, 11, 11, 'a11')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb2 values(now, 2, 2, 'a1')(now+1s, 22, 22, 'a22')"
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb2 values(now, 2, 2, 'a1')(now+1s, 22, 22, 'a22')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb3 values(now, 3, 3, 'a1')(now+1s, 33, 33, 'a33')"
);
pRes
=
taos_query
(
pConn
,
"insert into tmqdb.ctb3 values(now, 3, 3, 'a1')(now+1s, 33, 33, 'a33')"
);
if
(
taos_errno
(
pRes
)
!=
0
)
{
if
(
taos_errno
(
pRes
)
!=
0
)
{
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
printf
(
"failed to insert into ctb0, reason:%s
\n
"
,
taos_errstr
(
pRes
));
return
-
1
;
goto
END
;
}
}
taos_free_result
(
pRes
);
taos_free_result
(
pRes
);
taos_close
(
pConn
);
taos_close
(
pConn
);
return
0
;
return
0
;
END:
taos_free_result
(
pRes
);
taos_close
(
pConn
);
return
-
1
;
}
}
int32_t
create_topic
()
{
int32_t
create_topic
()
{
...
...
include/client/taos.h
浏览文件 @
7f18cc5b
...
@@ -59,6 +59,7 @@ typedef enum {
...
@@ -59,6 +59,7 @@ typedef enum {
TSDB_OPTION_TIMEZONE
,
TSDB_OPTION_TIMEZONE
,
TSDB_OPTION_CONFIGDIR
,
TSDB_OPTION_CONFIGDIR
,
TSDB_OPTION_SHELL_ACTIVITY_TIMER
,
TSDB_OPTION_SHELL_ACTIVITY_TIMER
,
TSDB_OPTION_USE_ADAPTER
,
TSDB_MAX_OPTIONS
TSDB_MAX_OPTIONS
}
TSDB_OPTION
;
}
TSDB_OPTION
;
...
@@ -229,7 +230,8 @@ DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len
...
@@ -229,7 +230,8 @@ DLL_EXPORT TAOS_RES *taos_schemaless_insert_raw(TAOS *taos, char *lines, int len
int
precision
);
int
precision
);
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_raw_with_reqid
(
TAOS
*
taos
,
char
*
lines
,
int
len
,
int32_t
*
totalRows
,
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_raw_with_reqid
(
TAOS
*
taos
,
char
*
lines
,
int
len
,
int32_t
*
totalRows
,
int
protocol
,
int
precision
,
int64_t
reqid
);
int
protocol
,
int
precision
,
int64_t
reqid
);
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_ttl
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
int
precision
,
int32_t
ttl
);
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_ttl
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
int
precision
,
int32_t
ttl
);
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_ttl_with_reqid
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_ttl_with_reqid
(
TAOS
*
taos
,
char
*
lines
[],
int
numLines
,
int
protocol
,
int
precision
,
int32_t
ttl
,
int64_t
reqid
);
int
precision
,
int32_t
ttl
,
int64_t
reqid
);
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_raw_ttl
(
TAOS
*
taos
,
char
*
lines
,
int
len
,
int32_t
*
totalRows
,
int
protocol
,
DLL_EXPORT
TAOS_RES
*
taos_schemaless_insert_raw_ttl
(
TAOS
*
taos
,
char
*
lines
,
int
len
,
int32_t
*
totalRows
,
int
protocol
,
...
@@ -308,7 +310,8 @@ DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);
...
@@ -308,7 +310,8 @@ DLL_EXPORT tmq_res_t tmq_get_res_type(TAOS_RES *res);
DLL_EXPORT
int32_t
tmq_get_raw
(
TAOS_RES
*
res
,
tmq_raw_data
*
raw
);
DLL_EXPORT
int32_t
tmq_get_raw
(
TAOS_RES
*
res
,
tmq_raw_data
*
raw
);
DLL_EXPORT
int32_t
tmq_write_raw
(
TAOS
*
taos
,
tmq_raw_data
raw
);
DLL_EXPORT
int32_t
tmq_write_raw
(
TAOS
*
taos
,
tmq_raw_data
raw
);
DLL_EXPORT
int
taos_write_raw_block
(
TAOS
*
taos
,
int
numOfRows
,
char
*
pData
,
const
char
*
tbname
);
DLL_EXPORT
int
taos_write_raw_block
(
TAOS
*
taos
,
int
numOfRows
,
char
*
pData
,
const
char
*
tbname
);
DLL_EXPORT
int
taos_write_raw_block_with_fields
(
TAOS
*
taos
,
int
rows
,
char
*
pData
,
const
char
*
tbname
,
TAOS_FIELD
*
fields
,
int
numFields
);
DLL_EXPORT
int
taos_write_raw_block_with_fields
(
TAOS
*
taos
,
int
rows
,
char
*
pData
,
const
char
*
tbname
,
TAOS_FIELD
*
fields
,
int
numFields
);
DLL_EXPORT
void
tmq_free_raw
(
tmq_raw_data
raw
);
DLL_EXPORT
void
tmq_free_raw
(
tmq_raw_data
raw
);
// Returning null means error. Returned result need to be freed by tmq_free_json_meta
// Returning null means error. Returned result need to be freed by tmq_free_json_meta
DLL_EXPORT
char
*
tmq_get_json_meta
(
TAOS_RES
*
res
);
DLL_EXPORT
char
*
tmq_get_json_meta
(
TAOS_RES
*
res
);
...
...
include/common/tglobal.h
浏览文件 @
7f18cc5b
...
@@ -101,6 +101,7 @@ extern int32_t tsRedirectPeriod;
...
@@ -101,6 +101,7 @@ extern int32_t tsRedirectPeriod;
extern
int32_t
tsRedirectFactor
;
extern
int32_t
tsRedirectFactor
;
extern
int32_t
tsRedirectMaxPeriod
;
extern
int32_t
tsRedirectMaxPeriod
;
extern
int32_t
tsMaxRetryWaitTime
;
extern
int32_t
tsMaxRetryWaitTime
;
extern
bool
tsUseAdapter
;
// client
// client
extern
int32_t
tsMinSlidingTime
;
extern
int32_t
tsMinSlidingTime
;
...
...
source/client/src/clientEnv.c
浏览文件 @
7f18cc5b
...
@@ -469,6 +469,9 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
...
@@ -469,6 +469,9 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
case
TSDB_OPTION_TIMEZONE
:
case
TSDB_OPTION_TIMEZONE
:
pItem
=
cfgGetItem
(
pCfg
,
"timezone"
);
pItem
=
cfgGetItem
(
pCfg
,
"timezone"
);
break
;
break
;
case
TSDB_OPTION_USE_ADAPTER
:
pItem
=
cfgGetItem
(
pCfg
,
"useAdapter"
);
break
;
default:
default:
break
;
break
;
}
}
...
...
source/client/src/clientImpl.c
浏览文件 @
7f18cc5b
...
@@ -739,6 +739,7 @@ int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog
...
@@ -739,6 +739,7 @@ int32_t handleSubmitExecRes(SRequestObj* pRequest, void* res, SCatalog* pCatalog
SArray
*
pArray
=
NULL
;
SArray
*
pArray
=
NULL
;
SSubmitRsp
*
pRsp
=
(
SSubmitRsp
*
)
res
;
SSubmitRsp
*
pRsp
=
(
SSubmitRsp
*
)
res
;
if
(
pRsp
->
nBlocks
<=
0
)
{
if
(
pRsp
->
nBlocks
<=
0
)
{
taosMemoryFreeClear
(
pRsp
->
pBlocks
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
source/client/src/clientTmq.c
浏览文件 @
7f18cc5b
...
@@ -438,6 +438,7 @@ int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
...
@@ -438,6 +438,7 @@ int32_t tmqCommitCb(void* param, SDataBuf* pBuf, int32_t code) {
taosMemoryFree
(
pParam
->
pOffset
);
taosMemoryFree
(
pParam
->
pOffset
);
taosMemoryFree
(
pBuf
->
pData
);
taosMemoryFree
(
pBuf
->
pData
);
taosMemoryFree
(
pBuf
->
pEpSet
);
/*tscDebug("receive offset commit cb of %s on vgId:%d, offset is %" PRId64, pParam->pOffset->subKey, pParam->->vgId,
/*tscDebug("receive offset commit cb of %s on vgId:%d, offset is %" PRId64, pParam->pOffset->subKey, pParam->->vgId,
* pOffset->version);*/
* pOffset->version);*/
...
@@ -724,7 +725,10 @@ void tmqAssignDelayedReportTask(void* param, void* tmrId) {
...
@@ -724,7 +725,10 @@ void tmqAssignDelayedReportTask(void* param, void* tmrId) {
}
}
int32_t
tmqHbCb
(
void
*
param
,
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
tmqHbCb
(
void
*
param
,
SDataBuf
*
pMsg
,
int32_t
code
)
{
if
(
pMsg
&&
pMsg
->
pData
)
taosMemoryFree
(
pMsg
->
pData
);
if
(
pMsg
)
{
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pEpSet
);
}
return
0
;
return
0
;
}
}
...
@@ -869,6 +873,8 @@ void tmqClearUnhandleMsg(tmq_t* tmq) {
...
@@ -869,6 +873,8 @@ void tmqClearUnhandleMsg(tmq_t* tmq) {
int32_t
tmqSubscribeCb
(
void
*
param
,
SDataBuf
*
pMsg
,
int32_t
code
)
{
int32_t
tmqSubscribeCb
(
void
*
param
,
SDataBuf
*
pMsg
,
int32_t
code
)
{
SMqSubscribeCbParam
*
pParam
=
(
SMqSubscribeCbParam
*
)
param
;
SMqSubscribeCbParam
*
pParam
=
(
SMqSubscribeCbParam
*
)
param
;
pParam
->
rspErr
=
code
;
pParam
->
rspErr
=
code
;
taosMemoryFree
(
pMsg
->
pEpSet
);
tsem_post
(
&
pParam
->
rspSem
);
tsem_post
(
&
pParam
->
rspSem
);
return
0
;
return
0
;
}
}
...
@@ -1166,6 +1172,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
...
@@ -1166,6 +1172,8 @@ int32_t tmqPollCb(void* param, SDataBuf* pMsg, int32_t code) {
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
tscWarn
(
"msg discard from vgId:%d, epoch %d, since %s"
,
vgId
,
epoch
,
terrstr
());
tscWarn
(
"msg discard from vgId:%d, epoch %d, since %s"
,
vgId
,
epoch
,
terrstr
());
if
(
pMsg
->
pData
)
taosMemoryFree
(
pMsg
->
pData
);
if
(
pMsg
->
pData
)
taosMemoryFree
(
pMsg
->
pData
);
if
(
pMsg
->
pEpSet
)
taosMemoryFree
(
pMsg
->
pEpSet
);
if
(
code
==
TSDB_CODE_TMQ_CONSUMER_MISMATCH
)
{
if
(
code
==
TSDB_CODE_TMQ_CONSUMER_MISMATCH
)
{
atomic_store_8
(
&
tmq
->
status
,
TMQ_CONSUMER_STATUS__RECOVER
);
atomic_store_8
(
&
tmq
->
status
,
TMQ_CONSUMER_STATUS__RECOVER
);
goto
CREATE_MSG_FAIL
;
goto
CREATE_MSG_FAIL
;
...
@@ -1365,6 +1373,7 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) {
...
@@ -1365,6 +1373,7 @@ int32_t tmqAskEpCb(void* param, SDataBuf* pMsg, int32_t code) {
taosMemoryFree
(
pParam
);
taosMemoryFree
(
pParam
);
}
}
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pEpSet
);
terrno
=
TSDB_CODE_TMQ_CONSUMER_CLOSED
;
terrno
=
TSDB_CODE_TMQ_CONSUMER_CLOSED
;
return
-
1
;
return
-
1
;
}
}
...
@@ -1416,6 +1425,8 @@ END:
...
@@ -1416,6 +1425,8 @@ END:
}
else
{
}
else
{
taosMemoryFree
(
pParam
);
taosMemoryFree
(
pParam
);
}
}
taosMemoryFree
(
pMsg
->
pEpSet
);
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pData
);
return
code
;
return
code
;
}
}
...
...
source/common/src/tglobal.c
浏览文件 @
7f18cc5b
...
@@ -96,6 +96,7 @@ int32_t tsRedirectPeriod = 10;
...
@@ -96,6 +96,7 @@ int32_t tsRedirectPeriod = 10;
int32_t
tsRedirectFactor
=
2
;
int32_t
tsRedirectFactor
=
2
;
int32_t
tsRedirectMaxPeriod
=
1000
;
int32_t
tsRedirectMaxPeriod
=
1000
;
int32_t
tsMaxRetryWaitTime
=
10000
;
int32_t
tsMaxRetryWaitTime
=
10000
;
bool
tsUseAdapter
=
false
;
/*
/*
* denote if the server needs to compress response message at the application layer to client, including query rsp,
* denote if the server needs to compress response message at the application layer to client, including query rsp,
...
@@ -201,9 +202,7 @@ int32_t taosSetTfsCfg(SConfig *pCfg) {
...
@@ -201,9 +202,7 @@ int32_t taosSetTfsCfg(SConfig *pCfg) {
int32_t
taosSetTfsCfg
(
SConfig
*
pCfg
);
int32_t
taosSetTfsCfg
(
SConfig
*
pCfg
);
#endif
#endif
struct
SConfig
*
taosGetCfg
()
{
struct
SConfig
*
taosGetCfg
()
{
return
tsCfg
;
}
return
tsCfg
;
}
static
int32_t
taosLoadCfg
(
SConfig
*
pCfg
,
const
char
**
envCmd
,
const
char
*
inputCfgDir
,
const
char
*
envFile
,
static
int32_t
taosLoadCfg
(
SConfig
*
pCfg
,
const
char
**
envCmd
,
const
char
*
inputCfgDir
,
const
char
*
envFile
,
char
*
apolloUrl
)
{
char
*
apolloUrl
)
{
...
@@ -314,6 +313,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
...
@@ -314,6 +313,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) {
if
(
cfgAddInt32
(
pCfg
,
"smlBatchSize"
,
tsSmlBatchSize
,
1
,
INT32_MAX
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"smlBatchSize"
,
tsSmlBatchSize
,
1
,
INT32_MAX
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxMemUsedByInsert"
,
tsMaxMemUsedByInsert
,
1
,
INT32_MAX
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxMemUsedByInsert"
,
tsMaxMemUsedByInsert
,
1
,
INT32_MAX
,
true
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxRetryWaitTime"
,
tsMaxRetryWaitTime
,
0
,
86400000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddInt32
(
pCfg
,
"maxRetryWaitTime"
,
tsMaxRetryWaitTime
,
0
,
86400000
,
0
)
!=
0
)
return
-
1
;
if
(
cfgAddBool
(
pCfg
,
"useAdapter"
,
tsUseAdapter
,
true
)
!=
0
)
return
-
1
;
tsNumOfTaskQueueThreads
=
tsNumOfCores
/
2
;
tsNumOfTaskQueueThreads
=
tsNumOfCores
/
2
;
tsNumOfTaskQueueThreads
=
TMAX
(
tsNumOfTaskQueueThreads
,
4
);
tsNumOfTaskQueueThreads
=
TMAX
(
tsNumOfTaskQueueThreads
,
4
);
...
@@ -668,6 +668,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
...
@@ -668,6 +668,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) {
tsQueryNodeChunkSize
=
cfgGetItem
(
pCfg
,
"queryNodeChunkSize"
)
->
i32
;
tsQueryNodeChunkSize
=
cfgGetItem
(
pCfg
,
"queryNodeChunkSize"
)
->
i32
;
tsQueryUseNodeAllocator
=
cfgGetItem
(
pCfg
,
"queryUseNodeAllocator"
)
->
bval
;
tsQueryUseNodeAllocator
=
cfgGetItem
(
pCfg
,
"queryUseNodeAllocator"
)
->
bval
;
tsKeepColumnName
=
cfgGetItem
(
pCfg
,
"keepColumnName"
)
->
bval
;
tsKeepColumnName
=
cfgGetItem
(
pCfg
,
"keepColumnName"
)
->
bval
;
tsUseAdapter
=
cfgGetItem
(
pCfg
,
"useAdapter"
)
->
bval
;
tsMaxRetryWaitTime
=
cfgGetItem
(
pCfg
,
"maxRetryWaitTime"
)
->
i32
;
tsMaxRetryWaitTime
=
cfgGetItem
(
pCfg
,
"maxRetryWaitTime"
)
->
i32
;
return
0
;
return
0
;
...
...
source/dnode/mnode/impl/inc/mndDef.h
浏览文件 @
7f18cc5b
...
@@ -174,6 +174,7 @@ typedef struct {
...
@@ -174,6 +174,7 @@ typedef struct {
void
*
param
;
void
*
param
;
char
opername
[
TSDB_TRANS_OPER_LEN
];
char
opername
[
TSDB_TRANS_OPER_LEN
];
SArray
*
pRpcArray
;
SArray
*
pRpcArray
;
SRWLatch
lockRpcArray
;
}
STrans
;
}
STrans
;
typedef
struct
{
typedef
struct
{
...
...
source/dnode/mnode/impl/src/mndTrans.c
浏览文件 @
7f18cc5b
...
@@ -628,6 +628,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict,
...
@@ -628,6 +628,7 @@ STrans *mndTransCreate(SMnode *pMnode, ETrnPolicy policy, ETrnConflct conflict,
pTrans
->
undoActions
=
taosArrayInit
(
TRANS_ARRAY_SIZE
,
sizeof
(
STransAction
));
pTrans
->
undoActions
=
taosArrayInit
(
TRANS_ARRAY_SIZE
,
sizeof
(
STransAction
));
pTrans
->
commitActions
=
taosArrayInit
(
TRANS_ARRAY_SIZE
,
sizeof
(
STransAction
));
pTrans
->
commitActions
=
taosArrayInit
(
TRANS_ARRAY_SIZE
,
sizeof
(
STransAction
));
pTrans
->
pRpcArray
=
taosArrayInit
(
1
,
sizeof
(
SRpcHandleInfo
));
pTrans
->
pRpcArray
=
taosArrayInit
(
1
,
sizeof
(
SRpcHandleInfo
));
taosInitRWLatch
(
&
pTrans
->
lockRpcArray
);
if
(
pTrans
->
redoActions
==
NULL
||
pTrans
->
undoActions
==
NULL
||
pTrans
->
commitActions
==
NULL
||
if
(
pTrans
->
redoActions
==
NULL
||
pTrans
->
undoActions
==
NULL
||
pTrans
->
commitActions
==
NULL
||
pTrans
->
pRpcArray
==
NULL
)
{
pTrans
->
pRpcArray
==
NULL
)
{
...
@@ -737,12 +738,14 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c
...
@@ -737,12 +738,14 @@ int32_t mndSetRpcInfoForDbTrans(SMnode *pMnode, SRpcMsg *pMsg, EOperType oper, c
if
(
pTrans
->
oper
==
oper
)
{
if
(
pTrans
->
oper
==
oper
)
{
if
(
strcasecmp
(
dbname
,
pTrans
->
dbname
)
==
0
)
{
if
(
strcasecmp
(
dbname
,
pTrans
->
dbname
)
==
0
)
{
mInfo
(
"trans:%d, db:%s oper:%d matched with input"
,
pTrans
->
id
,
dbname
,
oper
);
mInfo
(
"trans:%d, db:%s oper:%d matched with input"
,
pTrans
->
id
,
dbname
,
oper
);
taosWLockLatch
(
&
pTrans
->
lockRpcArray
);
if
(
pTrans
->
pRpcArray
==
NULL
)
{
if
(
pTrans
->
pRpcArray
==
NULL
)
{
pTrans
->
pRpcArray
=
taosArrayInit
(
1
,
sizeof
(
SRpcHandleInfo
));
pTrans
->
pRpcArray
=
taosArrayInit
(
4
,
sizeof
(
SRpcHandleInfo
));
}
}
if
(
pTrans
->
pRpcArray
!=
NULL
&&
taosArrayPush
(
pTrans
->
pRpcArray
,
&
pMsg
->
info
)
!=
NULL
)
{
if
(
pTrans
->
pRpcArray
!=
NULL
&&
taosArrayPush
(
pTrans
->
pRpcArray
,
&
pMsg
->
info
)
!=
NULL
)
{
code
=
0
;
code
=
0
;
}
}
taosWUnLockLatch
(
&
pTrans
->
lockRpcArray
);
sdbRelease
(
pMnode
->
pSdb
,
pTrans
);
sdbRelease
(
pMnode
->
pSdb
,
pTrans
);
break
;
break
;
...
@@ -944,8 +947,12 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
...
@@ -944,8 +947,12 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
pTrans
->
failedTimes
,
code
);
pTrans
->
failedTimes
,
code
);
}
}
taosWLockLatch
(
&
pTrans
->
lockRpcArray
);
int32_t
size
=
taosArrayGetSize
(
pTrans
->
pRpcArray
);
int32_t
size
=
taosArrayGetSize
(
pTrans
->
pRpcArray
);
if
(
size
<=
0
)
return
;
if
(
size
<=
0
)
{
taosWUnLockLatch
(
&
pTrans
->
lockRpcArray
);
return
;
}
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
SRpcHandleInfo
*
pInfo
=
taosArrayGet
(
pTrans
->
pRpcArray
,
i
);
SRpcHandleInfo
*
pInfo
=
taosArrayGet
(
pTrans
->
pRpcArray
,
i
);
...
@@ -997,6 +1004,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
...
@@ -997,6 +1004,7 @@ static void mndTransSendRpcRsp(SMnode *pMnode, STrans *pTrans) {
}
}
}
}
taosArrayClear
(
pTrans
->
pRpcArray
);
taosArrayClear
(
pTrans
->
pRpcArray
);
taosWUnLockLatch
(
&
pTrans
->
lockRpcArray
);
}
}
int32_t
mndTransProcessRsp
(
SRpcMsg
*
pRsp
)
{
int32_t
mndTransProcessRsp
(
SRpcMsg
*
pRsp
)
{
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
7f18cc5b
...
@@ -838,9 +838,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
...
@@ -838,9 +838,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
if
(
pUser
->
superUser
)
{
if
(
pUser
->
superUser
)
{
cols
=
0
;
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
char
userName
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
userName
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
userName
,
pUser
->
user
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
STR_WITH_MAXSIZE_TO_VARSTR
(
userName
,
pUser
->
user
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
userName
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
userName
,
false
);
char
privilege
[
20
]
=
{
0
};
char
privilege
[
20
]
=
{
0
};
...
@@ -859,9 +859,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
...
@@ -859,9 +859,9 @@ static int32_t mndRetrievePrivileges(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock
char
*
db
=
taosHashIterate
(
pUser
->
readDbs
,
NULL
);
char
*
db
=
taosHashIterate
(
pUser
->
readDbs
,
NULL
);
while
(
db
!=
NULL
)
{
while
(
db
!=
NULL
)
{
cols
=
0
;
cols
=
0
;
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
char
userName
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
char
userName
[
TSDB_USER_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
STR_WITH_MAXSIZE_TO_VARSTR
(
userName
,
pUser
->
user
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
STR_WITH_MAXSIZE_TO_VARSTR
(
userName
,
pUser
->
user
,
pShow
->
pMeta
->
pSchemas
[
cols
].
bytes
);
SColumnInfoData
*
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
userName
,
false
);
colDataAppend
(
pColInfo
,
numOfRows
,
(
const
char
*
)
userName
,
false
);
char
privilege
[
20
]
=
{
0
};
char
privilege
[
20
]
=
{
0
};
...
...
source/dnode/vnode/src/meta/metaSnapshot.c
浏览文件 @
7f18cc5b
...
@@ -161,7 +161,10 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) {
...
@@ -161,7 +161,10 @@ int32_t metaSnapWriterClose(SMetaSnapWriter** ppWriter, int8_t rollback) {
SMetaSnapWriter
*
pWriter
=
*
ppWriter
;
SMetaSnapWriter
*
pWriter
=
*
ppWriter
;
if
(
rollback
)
{
if
(
rollback
)
{
metaInfo
(
"vgId:%d, meta snapshot writer close and rollback start "
,
TD_VID
(
pWriter
->
pMeta
->
pVnode
));
code
=
metaAbort
(
pWriter
->
pMeta
);
code
=
metaAbort
(
pWriter
->
pMeta
);
metaInfo
(
"vgId:%d, meta snapshot writer close and rollback finished, code:0x%x"
,
TD_VID
(
pWriter
->
pMeta
->
pVnode
),
code
);
if
(
code
)
goto
_err
;
if
(
code
)
goto
_err
;
}
else
{
}
else
{
code
=
metaCommit
(
pWriter
->
pMeta
,
pWriter
->
pMeta
->
txn
);
code
=
metaCommit
(
pWriter
->
pMeta
,
pWriter
->
pMeta
->
txn
);
...
...
source/dnode/vnode/src/meta/metaTable.c
浏览文件 @
7f18cc5b
...
@@ -710,6 +710,9 @@ int metaUpdateCtimeIdx(SMeta *pMeta, const SMetaEntry *pME) {
...
@@ -710,6 +710,9 @@ int metaUpdateCtimeIdx(SMeta *pMeta, const SMetaEntry *pME) {
if
(
metaBuildCtimeIdxKey
(
&
ctimeKey
,
pME
)
<
0
)
{
if
(
metaBuildCtimeIdxKey
(
&
ctimeKey
,
pME
)
<
0
)
{
return
0
;
return
0
;
}
}
metaDebug
(
"vgId:%d, start to save ctime:%"
PRId64
" uid:%"
PRId64
" ct:%"
PRId64
,
TD_VID
(
pMeta
->
pVnode
),
pME
->
version
,
pME
->
uid
,
ctimeKey
.
ctime
);
return
tdbTbInsert
(
pMeta
->
pCtimeIdx
,
&
ctimeKey
,
sizeof
(
ctimeKey
),
NULL
,
0
,
pMeta
->
txn
);
return
tdbTbInsert
(
pMeta
->
pCtimeIdx
,
&
ctimeKey
,
sizeof
(
ctimeKey
),
NULL
,
0
,
pMeta
->
txn
);
}
}
...
...
source/dnode/vnode/src/tsdb/tsdbSnapshot.c
浏览文件 @
7f18cc5b
...
@@ -1109,7 +1109,7 @@ static int32_t tsdbSnapWriteData(STsdbSnapWriter* pWriter, uint8_t* pData, uint3
...
@@ -1109,7 +1109,7 @@ static int32_t tsdbSnapWriteData(STsdbSnapWriter* pWriter, uint8_t* pData, uint3
if
(
pWriter
->
dWriter
.
pWriter
==
NULL
||
pWriter
->
fid
!=
fid
)
{
if
(
pWriter
->
dWriter
.
pWriter
==
NULL
||
pWriter
->
fid
!=
fid
)
{
if
(
pWriter
->
dWriter
.
pWriter
)
{
if
(
pWriter
->
dWriter
.
pWriter
)
{
ASSERT
(
fid
>
pWriter
->
fid
);
//
ASSERT(fid > pWriter->fid);
code
=
tsdbSnapWriteCloseFile
(
pWriter
);
code
=
tsdbSnapWriteCloseFile
(
pWriter
);
if
(
code
)
goto
_err
;
if
(
code
)
goto
_err
;
...
...
source/libs/command/src/command.c
浏览文件 @
7f18cc5b
...
@@ -231,10 +231,6 @@ static const char* cacheModelStr(int8_t cacheModel) {
...
@@ -231,10 +231,6 @@ static const char* cacheModelStr(int8_t cacheModel) {
return
TSDB_CACHE_MODEL_NONE_STR
;
return
TSDB_CACHE_MODEL_NONE_STR
;
}
}
static
const
char
*
strictStr
(
int8_t
strict
)
{
return
TSDB_DB_STRICT_ON
==
strict
?
TSDB_DB_STRICT_ON_STR
:
TSDB_DB_STRICT_OFF_STR
;
}
static
void
setCreateDBResultIntoDataBlock
(
SSDataBlock
*
pBlock
,
char
*
dbFName
,
SDbCfgInfo
*
pCfg
)
{
static
void
setCreateDBResultIntoDataBlock
(
SSDataBlock
*
pBlock
,
char
*
dbFName
,
SDbCfgInfo
*
pCfg
)
{
blockDataEnsureCapacity
(
pBlock
,
1
);
blockDataEnsureCapacity
(
pBlock
,
1
);
pBlock
->
info
.
rows
=
1
;
pBlock
->
info
.
rows
=
1
;
...
@@ -269,11 +265,11 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
...
@@ -269,11 +265,11 @@ static void setCreateDBResultIntoDataBlock(SSDataBlock* pBlock, char* dbFName, S
buf2
+
VARSTR_HEADER_SIZE
,
buf2
+
VARSTR_HEADER_SIZE
,
"CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm "
"CREATE DATABASE `%s` BUFFER %d CACHESIZE %d CACHEMODEL '%s' COMP %d DURATION %dm "
"WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"WAL_FSYNC_PERIOD %d MAXROWS %d MINROWS %d KEEP %dm,%dm,%dm PAGES %d PAGESIZE %d PRECISION '%s' REPLICA %d "
"
STRICT '%s'
WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d"
,
"WAL_LEVEL %d VGROUPS %d SINGLE_STABLE %d"
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheSize
,
cacheModelStr
(
pCfg
->
cacheLast
),
pCfg
->
compression
,
pCfg
->
daysPerFile
,
dbFName
,
pCfg
->
buffer
,
pCfg
->
cacheSize
,
cacheModelStr
(
pCfg
->
cacheLast
),
pCfg
->
compression
,
pCfg
->
daysPerFile
,
pCfg
->
walFsyncPeriod
,
pCfg
->
maxRows
,
pCfg
->
minRows
,
pCfg
->
daysToKeep0
,
pCfg
->
daysToKeep1
,
pCfg
->
daysToKeep2
,
pCfg
->
walFsyncPeriod
,
pCfg
->
maxRows
,
pCfg
->
minRows
,
pCfg
->
daysToKeep0
,
pCfg
->
daysToKeep1
,
pCfg
->
daysToKeep2
,
pCfg
->
pages
,
pCfg
->
pageSize
,
prec
,
pCfg
->
replications
,
strictStr
(
pCfg
->
strict
),
pCfg
->
walLevel
,
pCfg
->
pages
,
pCfg
->
pageSize
,
prec
,
pCfg
->
replications
,
pCfg
->
walLevel
,
pCfg
->
numOfVgroups
,
pCfg
->
numOfVgroups
,
1
==
pCfg
->
numOfStables
);
1
==
pCfg
->
numOfStables
);
if
(
retentions
)
{
if
(
retentions
)
{
len
+=
sprintf
(
buf2
+
VARSTR_HEADER_SIZE
+
len
,
" RETENTIONS %s"
,
retentions
);
len
+=
sprintf
(
buf2
+
VARSTR_HEADER_SIZE
+
len
,
" RETENTIONS %s"
,
retentions
);
...
...
source/libs/parser/src/parAstParser.c
浏览文件 @
7f18cc5b
...
@@ -245,6 +245,10 @@ static int32_t collectMetaKeyFromCreateTable(SCollectMetaKeyCxt* pCxt, SCreateTa
...
@@ -245,6 +245,10 @@ static int32_t collectMetaKeyFromCreateTable(SCollectMetaKeyCxt* pCxt, SCreateTa
if
(
TSDB_CODE_SUCCESS
==
code
&&
NULL
==
pStmt
->
pTags
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
NULL
==
pStmt
->
pTags
)
{
code
=
reserveTableVgroupInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
pCxt
->
pMetaCache
);
code
=
reserveTableVgroupInCache
(
pCxt
->
pParseCxt
->
acctId
,
pStmt
->
dbName
,
pStmt
->
tableName
,
pCxt
->
pMetaCache
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveUserAuthInCache
(
pCxt
->
pParseCxt
->
acctId
,
pCxt
->
pParseCxt
->
pUser
,
pStmt
->
dbName
,
AUTH_TYPE_WRITE
,
pCxt
->
pMetaCache
);
}
return
code
;
return
code
;
}
}
...
@@ -261,6 +265,10 @@ static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCre
...
@@ -261,6 +265,10 @@ static int32_t collectMetaKeyFromCreateMultiTable(SCollectMetaKeyCxt* pCxt, SCre
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveTableVgroupInCache
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
pCxt
->
pMetaCache
);
code
=
reserveTableVgroupInCache
(
pCxt
->
pParseCxt
->
acctId
,
pClause
->
dbName
,
pClause
->
tableName
,
pCxt
->
pMetaCache
);
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
reserveUserAuthInCache
(
pCxt
->
pParseCxt
->
acctId
,
pCxt
->
pParseCxt
->
pUser
,
pClause
->
dbName
,
AUTH_TYPE_WRITE
,
pCxt
->
pMetaCache
);
}
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
break
;
}
}
...
@@ -351,38 +359,59 @@ static int32_t collectMetaKeyFromCreateStream(SCollectMetaKeyCxt* pCxt, SCreateS
...
@@ -351,38 +359,59 @@ static int32_t collectMetaKeyFromCreateStream(SCollectMetaKeyCxt* pCxt, SCreateS
}
}
static
int32_t
collectMetaKeyFromShowDnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowDnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_DNODES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_DNODES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowMnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowMnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_MNODES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_MNODES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowModules
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowModules
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_MODULES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_MODULES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowQnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowQnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_QNODES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_QNODES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowSnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowSnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_SNODES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_SNODES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowBnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowBnodes
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_BNODES
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_BNODES
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowCluster
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowCluster
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
if
(
pCxt
->
pParseCxt
->
enableSysInfo
)
{
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_CLUSTER
,
return
reserveTableMetaInCache
(
pCxt
->
pParseCxt
->
acctId
,
TSDB_INFORMATION_SCHEMA_DB
,
TSDB_INS_TABLE_CLUSTER
,
pCxt
->
pMetaCache
);
pCxt
->
pMetaCache
);
}
return
TSDB_CODE_SUCCESS
;
}
}
static
int32_t
collectMetaKeyFromShowDatabases
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
static
int32_t
collectMetaKeyFromShowDatabases
(
SCollectMetaKeyCxt
*
pCxt
,
SShowStmt
*
pStmt
)
{
...
...
source/libs/parser/src/parAuthenticator.c
浏览文件 @
7f18cc5b
...
@@ -104,6 +104,22 @@ static int32_t authShowCreateTable(SAuthCxt* pCxt, SShowCreateTableStmt* pStmt)
...
@@ -104,6 +104,22 @@ static int32_t authShowCreateTable(SAuthCxt* pCxt, SShowCreateTableStmt* pStmt)
return
checkAuth
(
pCxt
,
pStmt
->
dbName
,
AUTH_TYPE_READ
);
return
checkAuth
(
pCxt
,
pStmt
->
dbName
,
AUTH_TYPE_READ
);
}
}
static
int32_t
authCreateTable
(
SAuthCxt
*
pCxt
,
SCreateTableStmt
*
pStmt
)
{
return
checkAuth
(
pCxt
,
pStmt
->
dbName
,
AUTH_TYPE_WRITE
);
}
static
int32_t
authCreateMultiTable
(
SAuthCxt
*
pCxt
,
SCreateMultiTableStmt
*
pStmt
)
{
int32_t
code
=
TSDB_CODE_SUCCESS
;
SNode
*
pNode
=
NULL
;
FOREACH
(
pNode
,
pStmt
->
pSubTables
)
{
code
=
checkAuth
(
pCxt
,
((
SCreateSubTableClause
*
)
pNode
)
->
dbName
,
AUTH_TYPE_WRITE
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
break
;
}
}
return
code
;
}
static
int32_t
authQuery
(
SAuthCxt
*
pCxt
,
SNode
*
pStmt
)
{
static
int32_t
authQuery
(
SAuthCxt
*
pCxt
,
SNode
*
pStmt
)
{
switch
(
nodeType
(
pStmt
))
{
switch
(
nodeType
(
pStmt
))
{
case
QUERY_NODE_SET_OPERATOR
:
case
QUERY_NODE_SET_OPERATOR
:
...
@@ -116,6 +132,10 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) {
...
@@ -116,6 +132,10 @@ static int32_t authQuery(SAuthCxt* pCxt, SNode* pStmt) {
return
authDelete
(
pCxt
,
(
SDeleteStmt
*
)
pStmt
);
return
authDelete
(
pCxt
,
(
SDeleteStmt
*
)
pStmt
);
case
QUERY_NODE_INSERT_STMT
:
case
QUERY_NODE_INSERT_STMT
:
return
authInsert
(
pCxt
,
(
SInsertStmt
*
)
pStmt
);
return
authInsert
(
pCxt
,
(
SInsertStmt
*
)
pStmt
);
case
QUERY_NODE_CREATE_TABLE_STMT
:
return
authCreateTable
(
pCxt
,
(
SCreateTableStmt
*
)
pStmt
);
case
QUERY_NODE_CREATE_MULTI_TABLE_STMT
:
return
authCreateMultiTable
(
pCxt
,
(
SCreateMultiTableStmt
*
)
pStmt
);
case
QUERY_NODE_SHOW_DNODES_STMT
:
case
QUERY_NODE_SHOW_DNODES_STMT
:
case
QUERY_NODE_SHOW_MNODES_STMT
:
case
QUERY_NODE_SHOW_MNODES_STMT
:
case
QUERY_NODE_SHOW_MODULES_STMT
:
case
QUERY_NODE_SHOW_MODULES_STMT
:
...
...
source/libs/parser/src/parInsertSql.c
浏览文件 @
7f18cc5b
...
@@ -875,18 +875,9 @@ static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt
...
@@ -875,18 +875,9 @@ static int32_t getTargetTableSchema(SInsertParseContext* pCxt, SVnodeModifOpStmt
}
}
int32_t
code
=
checkAuth
(
pCxt
->
pComCxt
,
&
pStmt
->
targetTableName
,
&
pCxt
->
missCache
);
int32_t
code
=
checkAuth
(
pCxt
->
pComCxt
,
&
pStmt
->
targetTableName
,
&
pCxt
->
missCache
);
#if 0
if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) {
code = getTableMeta(pCxt, &pStmt->targetTableName, false, &pStmt->pTableMeta, &pCxt->missCache);
}
if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) {
code = getTableVgroup(pCxt->pComCxt, pStmt, false, &pCxt->missCache);
}
#else
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
missCache
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
missCache
)
{
code
=
getTableMetaAndVgroup
(
pCxt
,
pStmt
,
&
pCxt
->
missCache
);
code
=
getTableMetaAndVgroup
(
pCxt
,
pStmt
,
&
pCxt
->
missCache
);
}
}
#endif
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
pComCxt
->
async
)
{
if
(
TSDB_CODE_SUCCESS
==
code
&&
!
pCxt
->
pComCxt
->
async
)
{
code
=
collectUseDatabase
(
&
pStmt
->
targetTableName
,
pStmt
->
pDbFNameHashObj
);
code
=
collectUseDatabase
(
&
pStmt
->
targetTableName
,
pStmt
->
pDbFNameHashObj
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
...
@@ -1503,6 +1494,10 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* p
...
@@ -1503,6 +1494,10 @@ static int32_t parseDataFromFile(SInsertParseContext* pCxt, SVnodeModifOpStmt* p
static
int32_t
parseFileClause
(
SInsertParseContext
*
pCxt
,
SVnodeModifOpStmt
*
pStmt
,
STableDataBlocks
*
pDataBuf
,
static
int32_t
parseFileClause
(
SInsertParseContext
*
pCxt
,
SVnodeModifOpStmt
*
pStmt
,
STableDataBlocks
*
pDataBuf
,
SToken
*
pToken
)
{
SToken
*
pToken
)
{
if
(
tsUseAdapter
)
{
return
buildInvalidOperationMsg
(
&
pCxt
->
msg
,
"proxy mode does not support csv loading"
);
}
NEXT_TOKEN
(
pStmt
->
pSql
,
*
pToken
);
NEXT_TOKEN
(
pStmt
->
pSql
,
*
pToken
);
if
(
0
==
pToken
->
n
||
(
TK_NK_STRING
!=
pToken
->
type
&&
TK_NK_ID
!=
pToken
->
type
))
{
if
(
0
==
pToken
->
n
||
(
TK_NK_STRING
!=
pToken
->
type
&&
TK_NK_ID
!=
pToken
->
type
))
{
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
"file path is required following keyword FILE"
,
pToken
->
z
);
return
buildSyntaxErrMsg
(
&
pCxt
->
msg
,
"file path is required following keyword FILE"
,
pToken
->
z
);
...
@@ -1726,6 +1721,8 @@ static int32_t getTableMetaFromMetaData(const SArray* pTables, STableMeta** pMet
...
@@ -1726,6 +1721,8 @@ static int32_t getTableMetaFromMetaData(const SArray* pTables, STableMeta** pMet
if
(
1
!=
taosArrayGetSize
(
pTables
))
{
if
(
1
!=
taosArrayGetSize
(
pTables
))
{
return
TSDB_CODE_FAILED
;
return
TSDB_CODE_FAILED
;
}
}
taosMemoryFreeClear
(
*
pMeta
);
SMetaRes
*
pRes
=
taosArrayGet
(
pTables
,
0
);
SMetaRes
*
pRes
=
taosArrayGet
(
pTables
,
0
);
if
(
TSDB_CODE_SUCCESS
==
pRes
->
code
)
{
if
(
TSDB_CODE_SUCCESS
==
pRes
->
code
)
{
*
pMeta
=
tableMetaDup
((
const
STableMeta
*
)
pRes
->
pRes
);
*
pMeta
=
tableMetaDup
((
const
STableMeta
*
)
pRes
->
pRes
);
...
...
source/libs/planner/src/planLogicCreater.c
浏览文件 @
7f18cc5b
...
@@ -953,6 +953,10 @@ static int32_t createFillLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
...
@@ -953,6 +953,10 @@ static int32_t createFillLogicNode(SLogicPlanContext* pCxt, SSelectStmt* pSelect
code
=
TSDB_CODE_OUT_OF_MEMORY
;
code
=
TSDB_CODE_OUT_OF_MEMORY
;
}
}
if
(
TSDB_CODE_SUCCESS
==
code
&&
0
==
LIST_LENGTH
(
pFill
->
node
.
pTargets
))
{
code
=
createColumnByRewriteExpr
(
pFill
->
pWStartTs
,
&
pFill
->
node
.
pTargets
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
TSDB_CODE_SUCCESS
==
code
)
{
*
pLogicNode
=
(
SLogicNode
*
)
pFill
;
*
pLogicNode
=
(
SLogicNode
*
)
pFill
;
}
else
{
}
else
{
...
...
source/libs/scheduler/src/schRemote.c
浏览文件 @
7f18cc5b
...
@@ -456,6 +456,7 @@ int32_t schHandleLinkBrokenCallback(void *param, SDataBuf *pMsg, int32_t code) {
...
@@ -456,6 +456,7 @@ int32_t schHandleLinkBrokenCallback(void *param, SDataBuf *pMsg, int32_t code) {
if
(
head
->
isHbParam
)
{
if
(
head
->
isHbParam
)
{
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pData
);
taosMemoryFree
(
pMsg
->
pEpSet
);
SSchHbCallbackParam
*
hbParam
=
(
SSchHbCallbackParam
*
)
param
;
SSchHbCallbackParam
*
hbParam
=
(
SSchHbCallbackParam
*
)
param
;
SSchTrans
trans
=
{.
pTrans
=
hbParam
->
pTrans
,
.
pHandle
=
NULL
};
SSchTrans
trans
=
{.
pTrans
=
hbParam
->
pTrans
,
.
pHandle
=
NULL
};
...
...
source/libs/sync/src/syncPipeline.c
浏览文件 @
7f18cc5b
...
@@ -275,6 +275,8 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
...
@@ -275,6 +275,8 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
SyncIndex
index
=
pEntry
->
index
;
SyncIndex
index
=
pEntry
->
index
;
SyncIndex
prevIndex
=
pEntry
->
index
-
1
;
SyncIndex
prevIndex
=
pEntry
->
index
-
1
;
SyncTerm
lastMatchTerm
=
syncLogBufferGetLastMatchTerm
(
pBuf
);
SyncTerm
lastMatchTerm
=
syncLogBufferGetLastMatchTerm
(
pBuf
);
SSyncRaftEntry
*
pExist
=
NULL
;
bool
inBuf
=
true
;
if
(
index
<=
pBuf
->
commitIndex
)
{
if
(
index
<=
pBuf
->
commitIndex
)
{
sTrace
(
"vgId:%d, already committed. index: %"
PRId64
", term: %"
PRId64
". log buffer: [%"
PRId64
" %"
PRId64
sTrace
(
"vgId:%d, already committed. index: %"
PRId64
", term: %"
PRId64
". log buffer: [%"
PRId64
" %"
PRId64
...
@@ -306,10 +308,9 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
...
@@ -306,10 +308,9 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
}
}
// check current in buffer
// check current in buffer
SSyncRaftEntry
*
pExist
=
pBuf
->
entries
[
index
%
pBuf
->
size
].
pItem
;
pExist
=
syncLogBufferGetOneEntry
(
pBuf
,
pNode
,
index
,
&
inBuf
)
;
if
(
pExist
!=
NULL
)
{
if
(
pExist
!=
NULL
)
{
ASSERT
(
pEntry
->
index
==
pExist
->
index
);
ASSERT
(
pEntry
->
index
==
pExist
->
index
);
if
(
pEntry
->
term
!=
pExist
->
term
)
{
if
(
pEntry
->
term
!=
pExist
->
term
)
{
(
void
)
syncLogBufferRollback
(
pBuf
,
pNode
,
index
);
(
void
)
syncLogBufferRollback
(
pBuf
,
pNode
,
index
);
}
else
{
}
else
{
...
@@ -317,14 +318,15 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
...
@@ -317,14 +318,15 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
" %"
PRId64
" %"
PRId64
", %"
PRId64
")"
,
pNode
->
vgId
,
pEntry
->
index
,
pEntry
->
term
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pNode
->
vgId
,
pEntry
->
index
,
pEntry
->
term
,
pBuf
->
startIndex
,
pBuf
->
commitIndex
,
pBuf
->
matchIndex
,
pBuf
->
endIndex
);
pBuf
->
endIndex
);
SyncTerm
existPrevTerm
=
pBuf
->
entries
[
index
%
pBuf
->
size
].
prevLogTerm
;
SyncTerm
existPrevTerm
=
syncLogReplMgrGetPrevLogTerm
(
NULL
,
pNode
,
index
)
;
ASSERT
(
pEntry
->
term
==
pExist
->
term
&&
prevTerm
==
existPrevTerm
);
ASSERT
(
pEntry
->
term
==
pExist
->
term
&&
(
pEntry
->
index
>
pBuf
->
matchIndex
||
prevTerm
==
existPrevTerm
)
);
ret
=
0
;
ret
=
0
;
goto
_out
;
goto
_out
;
}
}
}
}
// update
// update
ASSERT
(
pBuf
->
entries
[
index
%
pBuf
->
size
].
pItem
==
NULL
);
SSyncLogBufEntry
tmp
=
{.
pItem
=
pEntry
,
.
prevLogIndex
=
prevIndex
,
.
prevLogTerm
=
prevTerm
};
SSyncLogBufEntry
tmp
=
{.
pItem
=
pEntry
,
.
prevLogIndex
=
prevIndex
,
.
prevLogTerm
=
prevTerm
};
pEntry
=
NULL
;
pEntry
=
NULL
;
pBuf
->
entries
[
index
%
pBuf
->
size
]
=
tmp
;
pBuf
->
entries
[
index
%
pBuf
->
size
]
=
tmp
;
...
@@ -337,6 +339,10 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
...
@@ -337,6 +339,10 @@ int32_t syncLogBufferAccept(SSyncLogBuffer* pBuf, SSyncNode* pNode, SSyncRaftEnt
_out:
_out:
syncEntryDestroy
(
pEntry
);
syncEntryDestroy
(
pEntry
);
if
(
!
inBuf
)
{
syncEntryDestroy
(
pExist
);
pExist
=
NULL
;
}
syncLogBufferValidate
(
pBuf
);
syncLogBufferValidate
(
pBuf
);
taosThreadMutexUnlock
(
&
pBuf
->
mutex
);
taosThreadMutexUnlock
(
&
pBuf
->
mutex
);
return
ret
;
return
ret
;
...
@@ -1008,6 +1014,16 @@ int32_t syncLogBufferRollback(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncIndex
...
@@ -1008,6 +1014,16 @@ int32_t syncLogBufferRollback(SSyncLogBuffer* pBuf, SSyncNode* pNode, SyncIndex
lastVer
=
pNode
->
pLogStore
->
syncLogLastIndex
(
pNode
->
pLogStore
);
lastVer
=
pNode
->
pLogStore
->
syncLogLastIndex
(
pNode
->
pLogStore
);
ASSERT
(
toIndex
==
lastVer
+
1
);
ASSERT
(
toIndex
==
lastVer
+
1
);
// refill buffer on need
if
(
toIndex
<=
pBuf
->
startIndex
)
{
int32_t
ret
=
syncLogBufferInitWithoutLock
(
pBuf
,
pNode
);
if
(
ret
<
0
)
{
sError
(
"vgId:%d, failed to refill sync log buffer since %s"
,
pNode
->
vgId
,
terrstr
());
return
-
1
;
}
}
ASSERT
(
pBuf
->
endIndex
==
toIndex
);
syncLogBufferValidate
(
pBuf
);
syncLogBufferValidate
(
pBuf
);
return
0
;
return
0
;
}
}
...
...
source/libs/tdb/src/db/tdbPage.c
浏览文件 @
7f18cc5b
...
@@ -111,6 +111,9 @@ void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell
...
@@ -111,6 +111,9 @@ void tdbPageZero(SPage *pPage, u8 szAmHdr, int (*xCellSize)(const SPage *, SCell
void
tdbPageInit
(
SPage
*
pPage
,
u8
szAmHdr
,
int
(
*
xCellSize
)(
const
SPage
*
,
SCell
*
,
int
,
TXN
*
,
SBTree
*
pBt
))
{
void
tdbPageInit
(
SPage
*
pPage
,
u8
szAmHdr
,
int
(
*
xCellSize
)(
const
SPage
*
,
SCell
*
,
int
,
TXN
*
,
SBTree
*
pBt
))
{
tdbTrace
(
"page/init: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
tdbTrace
(
"page/init: %p %"
PRIu8
" %p"
,
pPage
,
szAmHdr
,
xCellSize
);
pPage
->
pPageHdr
=
pPage
->
pData
+
szAmHdr
;
pPage
->
pPageHdr
=
pPage
->
pData
+
szAmHdr
;
if
(
TDB_PAGE_NCELLS
(
pPage
)
==
0
)
{
return
tdbPageZero
(
pPage
,
szAmHdr
,
xCellSize
);
}
pPage
->
pCellIdx
=
pPage
->
pPageHdr
+
TDB_PAGE_HDR_SIZE
(
pPage
);
pPage
->
pCellIdx
=
pPage
->
pPageHdr
+
TDB_PAGE_HDR_SIZE
(
pPage
);
pPage
->
pFreeStart
=
pPage
->
pCellIdx
+
TDB_PAGE_OFFSET_SIZE
(
pPage
)
*
TDB_PAGE_NCELLS
(
pPage
);
pPage
->
pFreeStart
=
pPage
->
pCellIdx
+
TDB_PAGE_OFFSET_SIZE
(
pPage
)
*
TDB_PAGE_NCELLS
(
pPage
);
pPage
->
pFreeEnd
=
pPage
->
pData
+
TDB_PAGE_CCELLS
(
pPage
);
pPage
->
pFreeEnd
=
pPage
->
pData
+
TDB_PAGE_CCELLS
(
pPage
);
...
...
source/libs/tdb/src/db/tdbPager.c
浏览文件 @
7f18cc5b
...
@@ -466,11 +466,19 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
...
@@ -466,11 +466,19 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
if
(
tdbOsLSeek
(
jfd
,
0L
,
SEEK_SET
)
<
0
)
{
tdbError
(
"failed to lseek jfd due to %s. file:%s, offset:0"
,
strerror
(
errno
),
pPager
->
dbFileName
);
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
return
-
1
;
}
u8
*
pageBuf
=
tdbOsCalloc
(
1
,
pPager
->
pageSize
);
u8
*
pageBuf
=
tdbOsCalloc
(
1
,
pPager
->
pageSize
);
if
(
pageBuf
==
NULL
)
{
if
(
pageBuf
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
tdbDebug
(
"tdb/abort: pager:%p,"
,
pPager
);
for
(
int
pgIndex
=
0
;
pgIndex
<
journalSize
;
++
pgIndex
)
{
for
(
int
pgIndex
=
0
;
pgIndex
<
journalSize
;
++
pgIndex
)
{
// read pgno & the page from journal
// read pgno & the page from journal
SPgno
pgno
;
SPgno
pgno
;
...
@@ -481,6 +489,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
...
@@ -481,6 +489,8 @@ int tdbPagerAbort(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
tdbTrace
(
"tdb/abort: pgno:%d,"
,
pgno
);
ret
=
tdbOsRead
(
jfd
,
pageBuf
,
pPager
->
pageSize
);
ret
=
tdbOsRead
(
jfd
,
pageBuf
,
pPager
->
pageSize
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbOsFree
(
pageBuf
);
tdbOsFree
(
pageBuf
);
...
@@ -578,12 +588,12 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) {
...
@@ -578,12 +588,12 @@ int tdbPagerFlushPage(SPager *pPager, TXN *pTxn) {
return
-
1
;
return
-
1
;
}
}
tdbTrace
(
"tdb/flush:%p,
%d/%d/%d"
,
pPager
,
pPager
->
dbOrigSize
,
pPager
->
dbFileSize
,
maxPgno
);
tdbTrace
(
"tdb/flush:%p,
pgno:%d, %d/%d/%d"
,
pPager
,
pgno
,
pPager
->
dbOrigSize
,
pPager
->
dbFileSize
,
maxPgno
);
pPager
->
dbOrigSize
=
maxPgno
;
pPager
->
dbOrigSize
=
maxPgno
;
pPage
->
isDirty
=
0
;
pPage
->
isDirty
=
0
;
tdbTrace
(
"pager/flush drop page: %p
%d
from dirty tree: %p"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
&
pPager
->
rbt
);
tdbTrace
(
"pager/flush drop page: %p
, pgno:%d,
from dirty tree: %p"
,
pPage
,
TDB_PAGE_PGNO
(
pPage
),
&
pPager
->
rbt
);
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tRBTreeDrop
(
&
pPager
->
rbt
,
(
SRBTreeNode
*
)
pPage
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
tdbPCacheRelease
(
pPager
->
pCache
,
pPage
,
pTxn
);
...
@@ -830,7 +840,7 @@ static int tdbPagerPWritePageToDB(SPager *pPager, SPage *pPage) {
...
@@ -830,7 +840,7 @@ static int tdbPagerPWritePageToDB(SPager *pPager, SPage *pPage) {
return
0
;
return
0
;
}
}
static
int
tdbPagerRestore
(
SPager
*
pPager
,
SBTree
*
pBt
,
const
char
*
jFileName
)
{
static
int
tdbPagerRestore
(
SPager
*
pPager
,
const
char
*
jFileName
)
{
int
ret
=
0
;
int
ret
=
0
;
SPgno
journalSize
=
0
;
SPgno
journalSize
=
0
;
u8
*
pageBuf
=
NULL
;
u8
*
pageBuf
=
NULL
;
...
@@ -908,7 +918,7 @@ static int tdbPagerRestore(SPager *pPager, SBTree *pBt, const char *jFileName) {
...
@@ -908,7 +918,7 @@ static int tdbPagerRestore(SPager *pPager, SBTree *pBt, const char *jFileName) {
return
0
;
return
0
;
}
}
int
tdbPagerRestoreJournals
(
SPager
*
pPager
,
SBTree
*
pBt
)
{
int
tdbPagerRestoreJournals
(
SPager
*
pPager
)
{
tdbDirEntryPtr
pDirEntry
;
tdbDirEntryPtr
pDirEntry
;
tdbDirPtr
pDir
=
taosOpenDir
(
pPager
->
pEnv
->
dbName
);
tdbDirPtr
pDir
=
taosOpenDir
(
pPager
->
pEnv
->
dbName
);
if
(
pDir
==
NULL
)
{
if
(
pDir
==
NULL
)
{
...
@@ -919,7 +929,7 @@ int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) {
...
@@ -919,7 +929,7 @@ int tdbPagerRestoreJournals(SPager *pPager, SBTree *pBt) {
while
((
pDirEntry
=
tdbReadDir
(
pDir
))
!=
NULL
)
{
while
((
pDirEntry
=
tdbReadDir
(
pDir
))
!=
NULL
)
{
char
*
name
=
tdbDirEntryBaseName
(
tdbGetDirEntryName
(
pDirEntry
));
char
*
name
=
tdbDirEntryBaseName
(
tdbGetDirEntryName
(
pDirEntry
));
if
(
strncmp
(
TDB_MAINDB_NAME
"-journal"
,
name
,
16
)
==
0
)
{
if
(
strncmp
(
TDB_MAINDB_NAME
"-journal"
,
name
,
16
)
==
0
)
{
if
(
tdbPagerRestore
(
pPager
,
pBt
,
name
)
<
0
)
{
if
(
tdbPagerRestore
(
pPager
,
name
)
<
0
)
{
tdbCloseDir
(
&
pDir
);
tdbCloseDir
(
&
pDir
);
tdbError
(
"failed to restore file due to %s. jFileName:%s"
,
strerror
(
errno
),
name
);
tdbError
(
"failed to restore file due to %s. jFileName:%s"
,
strerror
(
errno
),
name
);
...
...
source/libs/tdb/src/db/tdbTable.c
浏览文件 @
7f18cc5b
...
@@ -107,22 +107,22 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF
...
@@ -107,22 +107,22 @@ int tdbTbOpen(const char *tbname, int keyLen, int valLen, tdb_cmpr_fn_t keyCmprF
ASSERT
(
pPager
!=
NULL
);
ASSERT
(
pPager
!=
NULL
);
// pTb->pBt
if
(
rollback
)
{
ret
=
tdbBtreeOpen
(
keyLen
,
valLen
,
pPager
,
tbname
,
pgno
,
keyCmprFn
,
pEnv
,
&
(
pTb
->
pBt
));
tdbPagerRollback
(
pPager
);
}
else
{
ret
=
tdbPagerRestoreJournals
(
pPager
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbOsFree
(
pTb
);
tdbOsFree
(
pTb
);
return
-
1
;
return
-
1
;
}
}
}
if
(
rollback
)
{
// pTb->pBt
tdbPagerRollback
(
pPager
);
ret
=
tdbBtreeOpen
(
keyLen
,
valLen
,
pPager
,
tbname
,
pgno
,
keyCmprFn
,
pEnv
,
&
(
pTb
->
pBt
));
}
else
{
ret
=
tdbPagerRestoreJournals
(
pPager
,
pTb
->
pBt
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
tdbOsFree
(
pTb
);
tdbOsFree
(
pTb
);
return
-
1
;
return
-
1
;
}
}
}
*
ppTb
=
pTb
;
*
ppTb
=
pTb
;
return
0
;
return
0
;
...
...
source/libs/tdb/src/inc/tdbInt.h
浏览文件 @
7f18cc5b
...
@@ -197,7 +197,7 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initP
...
@@ -197,7 +197,7 @@ int tdbPagerFetchPage(SPager *pPager, SPgno *ppgno, SPage **ppPage, int (*initP
TXN
*
pTxn
);
TXN
*
pTxn
);
void
tdbPagerReturnPage
(
SPager
*
pPager
,
SPage
*
pPage
,
TXN
*
pTxn
);
void
tdbPagerReturnPage
(
SPager
*
pPager
,
SPage
*
pPage
,
TXN
*
pTxn
);
int
tdbPagerAllocPage
(
SPager
*
pPager
,
SPgno
*
ppgno
);
int
tdbPagerAllocPage
(
SPager
*
pPager
,
SPgno
*
ppgno
);
int
tdbPagerRestoreJournals
(
SPager
*
pPager
,
SBTree
*
pBt
);
int
tdbPagerRestoreJournals
(
SPager
*
pPager
);
int
tdbPagerRollback
(
SPager
*
pPager
);
int
tdbPagerRollback
(
SPager
*
pPager
);
// tdbPCache.c ====================================
// tdbPCache.c ====================================
...
...
source/libs/transport/src/transCli.c
浏览文件 @
7f18cc5b
...
@@ -599,6 +599,10 @@ static int32_t allocConnRef(SCliConn* conn, bool update) {
...
@@ -599,6 +599,10 @@ static int32_t allocConnRef(SCliConn* conn, bool update) {
exh
->
pThrd
=
conn
->
hostThrd
;
exh
->
pThrd
=
conn
->
hostThrd
;
exh
->
refId
=
transAddExHandle
(
transGetRefMgt
(),
exh
);
exh
->
refId
=
transAddExHandle
(
transGetRefMgt
(),
exh
);
conn
->
refId
=
exh
->
refId
;
conn
->
refId
=
exh
->
refId
;
if
(
conn
->
refId
==
-
1
)
{
taosMemoryFree
(
exh
);
}
return
0
;
return
0
;
}
}
...
...
tests/parallel_test/cases.task
浏览文件 @
7f18cc5b
...
@@ -1022,6 +1022,11 @@
...
@@ -1022,6 +1022,11 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -R
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 2
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 3
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_null_none.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-20582.py
#develop test
#develop test
...
...
tests/script/tmp/data.sim
浏览文件 @
7f18cc5b
...
@@ -3,6 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,6 +3,9 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode4 -i 4
system sh/deploy.sh -n dnode5 -i 5
system sh/deploy.sh -n dnode6 -i 6
system sh/deploy.sh -n dnode7 -i 7
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
system sh/cfg.sh -n dnode1 -c supportVnodes -v 0
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
...
@@ -14,6 +17,9 @@ print =============== step1: create dnodes
...
@@ -14,6 +17,9 @@ print =============== step1: create dnodes
sql create dnode $hostname port 7200
sql create dnode $hostname port 7200
sql create dnode $hostname port 7300
sql create dnode $hostname port 7300
sql create dnode $hostname port 7400
sql create dnode $hostname port 7400
sql create dnode $hostname port 7500
sql create dnode $hostname port 7600
sql create dnode $hostname port 7700
$x = 0
$x = 0
step1:
step1:
...
@@ -29,7 +35,7 @@ print ===> $data00 $data01 $data02 $data03 $data04 $data05
...
@@ -29,7 +35,7 @@ print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data30 $data31 $data32 $data33 $data24 $data35
print ===> $data30 $data31 $data32 $data33 $data24 $data35
if $rows !=
4
then
if $rows !=
7
then
return -1
return -1
endi
endi
if $data(1)[4] != ready then
if $data(1)[4] != ready then
...
...
tests/system-test/2-query/insert_null_none.py
0 → 100755
浏览文件 @
7f18cc5b
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
random
import
os
import
time
import
taos
import
subprocess
from
faker
import
Faker
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
from
util.dnodes
import
tdDnodes
from
util.dnodes
import
*
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"querySmaOptimize"
:
1
}
def
init
(
self
,
conn
,
logSql
,
replicaVar
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
self
.
testcasePath
=
os
.
path
.
split
(
__file__
)[
0
]
self
.
testcaseFilename
=
os
.
path
.
split
(
__file__
)[
-
1
]
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
db
=
"insert_null_none"
def
dropandcreateDB_random
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
tdSql
.
execute
(
'''drop database if exists %s ;'''
%
database
)
tdSql
.
execute
(
'''create database %s keep 36500 ;'''
%
(
database
))
tdSql
.
execute
(
'''use %s;'''
%
database
)
tdSql
.
execute
(
'''create stable %s.stable_1 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp ,
\
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp)
\
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);'''
%
database
)
tdSql
.
execute
(
'''create stable %s.stable_2 (ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp ,
\
q_int_null int , q_bigint_null bigint , q_smallint_null smallint , q_tinyint_null tinyint, q_float_null float , q_double_null double , q_bool_null bool , q_binary_null binary(20) , q_nchar_null nchar(20) , q_ts_null timestamp)
\
tags(loc nchar(100) , t_int int , t_bigint bigint , t_smallint smallint , t_tinyint tinyint, t_bool bool , t_binary binary(100) , t_nchar nchar(100) ,t_float float , t_double double , t_ts timestamp);'''
%
database
)
for
i
in
range
(
num_random
):
tdSql
.
execute
(
'''create table %s.table_%d
\
(ts timestamp , q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint , q_float float , q_double double , q_bool bool , q_binary binary(100) , q_nchar nchar(100) , q_ts timestamp ) ;'''
%
(
database
,
i
))
tdSql
.
execute
(
'''create table %s.stable_1_%d using %s.stable_1 tags('stable_1_%d', '%d' , '%d', '%d' , '%d' , 1 , 'binary1.%s' , 'nchar1.%s' , '%f', '%f' ,'%d') ;'''
%
(
database
,
i
,
database
,
i
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pyfloat
(),
fake
.
pyfloat
(),
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
)))
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
query
(
"select count(*) from %s.stable_1;"
%
database
)
tdSql
.
checkData
(
0
,
0
,
num_random
*
n
)
tdSql
.
query
(
"select count(*) from %s.table_0;"
%
database
)
tdSql
.
checkData
(
0
,
0
,
n
)
def
qint_none
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qint_null
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qint_none_null
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qint_none_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qint_null_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qint_none_null_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %s, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
'NULL'
,
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_none
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_null
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_none_null
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_none_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_null_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbigint_none_null_value
(
self
,
database
,
n
):
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %s, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
'NULL'
,
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qsmallint_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qsmallint_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %s, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
'NULL'
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qtinyint_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qtinyint_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %s, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qfloat_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qfloat_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %s, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
'NULL'
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
),
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
),
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qdouble_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qdouble_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %s, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
def
qbinary_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbinary_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, %s, 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
'NULL'
,
fake
.
pystr
()
,
ts
+
i
))
def
qnchar_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qnchar_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
def
qnchar_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
def
qnchar_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary ,q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qnchar_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s',%s, %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
def
qnchar_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qnchar_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary , q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %s , %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', %s , %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
'NULL'
,
ts
+
i
))
def
qts_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
def
qts_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
(),
fake
.
pystr
()
,
'NULL'
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
(),
fake
.
pystr
()
,
'NULL'
))
def
qts_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
(),
'NULL'
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
(),
'NULL'
))
def
qts_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary, q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qts_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s','nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
(),
'NULL'
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s','nchar.%s', %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
(),
'NULL'
))
def
qts_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qts_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_bool , q_binary , q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s') ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s' , %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
'NULL'
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s' , %s) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
fake
.
pystr
()
,
'NULL'
))
def
qbool_none
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_none"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
1
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbool_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
2
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbool_none_null
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_none_null"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
3
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
4
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbool_none_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_none_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d);'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
5
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbool_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %d, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
),
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
6
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
),
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
qbool_none_null_value
(
self
,
database
,
n
):
tdLog
.
info
(
"qbool_none_null_value"
)
ts
=
1630000000000
num_random
=
10
fake
=
Faker
(
'zh_CN'
)
# insert data
for
i
in
range
(
num_random
):
for
j
in
range
(
n
):
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float, q_double , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
7
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
(),
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double, q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d) ;'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.stable_1_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d );'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
(),
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
tdSql
.
execute
(
'''insert into %s.table_%d (ts , q_int , q_bigint , q_smallint , q_tinyint , q_float , q_double , q_bool , q_binary , q_nchar, q_ts)
\
values(%d, %d, %d, %d, %d, %f, %f, %s, 'binary.%s', 'nchar.%s', %d );'''
%
(
database
,
i
,
ts
+
i
*
1000
+
j
+
8
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
32767
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
random_int
(
min
=-
127
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
'NULL'
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
))
def
sqls
(
self
,
database
):
sql
=
"select * from %s.stable_1 ;"
%
database
tdSql
.
query
(
sql
)
sql
=
"select * from %s.table_1 ;"
%
database
tdSql
.
query
(
sql
)
sql1
=
"select count(*) from %s.stable_1 ;"
%
database
tdSql
.
query
(
sql1
)
sql1_value
=
tdSql
.
getData
(
0
,
0
)
sql2
=
"select count(ts) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql2
)
sql3
=
"select count(q_int) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql3
)
sql4
=
"select count(q_bigint) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql4
)
sql5
=
"select count(q_smallint) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql5
)
sql6
=
"select count(q_tinyint) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql6
)
sql7
=
"select count(q_float) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql7
)
sql8
=
"select count(q_double) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql8
)
sql9
=
"select count(q_bool) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql9
)
sql10
=
"select count(q_binary) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql10
)
sql11
=
"select count(q_nchar) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql11
)
sql12
=
"select count(q_ts) from %s.stable_1 ;"
%
database
self
.
constant_check
(
sql1
,
sql12
)
def
check_flushdb
(
self
,
database
):
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qint_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbigint_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qsmallint_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qtinyint_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qfloat_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qdouble_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbinary_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qnchar_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qts_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_none
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_none_null
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_none_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
self
.
qbool_none_null_value
(
database
,
10
);
self
.
sqls
(
database
);
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdLog
.
info
(
"flush database success"
)
self
.
sqls
(
database
);
def
constant_check
(
self
,
sql1
,
sql2
):
tdLog
.
info
(
"
\n
=============sql1:(%s)___sql2:(%s) ====================
\n
"
%
(
sql1
,
sql2
))
tdSql
.
query
(
sql1
)
sql1_value
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
sql2
)
sql2_value
=
tdSql
.
getData
(
0
,
0
)
self
.
value_check
(
sql1_value
,
sql2_value
)
def
value_check
(
self
,
base_value
,
check_value
):
if
base_value
==
check_value
:
tdLog
.
info
(
f
"checkEqual success, base_value=
{
base_value
}
,check_value=
{
check_value
}
"
)
elif
base_value
>
check_value
:
tdLog
.
info
(
f
"checkEqual success,but count not include NULL, base_value==
{
base_value
}
,check_value=
{
check_value
}
"
)
else
:
tdLog
.
exit
(
f
"checkEqual error, base_value==
{
base_value
}
,check_value=
{
check_value
}
"
)
def
run
(
self
):
startTime
=
time
.
time
()
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db
,
10
)
self
.
check_flushdb
(
"%s"
%
self
.
db
)
# #taos -f sql
# startTime1 = time.time()
# print("taos -f sql start!")
# taos_cmd1 = "taos -f %s/%s.sql" % (self.testcasePath,self.testcaseFilename)
# _ = subprocess.check_output(taos_cmd1, shell=True)
# print("taos -f sql over!")
# endTime1 = time.time()
# print("total time %ds" % (endTime1 - startTime1))
endTime
=
time
.
time
()
print
(
"total time %ds"
%
(
endTime
-
startTime
))
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tools/shell/src/shellAuto.c
浏览文件 @
7f18cc5b
...
@@ -969,38 +969,43 @@ bool matchVarWord(SWord* word1, SWord* word2) {
...
@@ -969,38 +969,43 @@ bool matchVarWord(SWord* word1, SWord* word2) {
// ------------------- match words --------------------------
// ------------------- match words --------------------------
//
//
// compare command cmd
1 come from shellCommands , cmd2
come from user input
// compare command cmd
Pattern come from shellCommands , cmdInput
come from user input
int32_t
compareCommand
(
SWords
*
cmd
1
,
SWords
*
cmd2
)
{
int32_t
compareCommand
(
SWords
*
cmd
Pattern
,
SWords
*
cmdInput
)
{
SWord
*
word
1
=
cmd1
->
head
;
SWord
*
word
Pattern
=
cmdPattern
->
head
;
SWord
*
word
2
=
cmd2
->
head
;
SWord
*
word
Input
=
cmdInput
->
head
;
if
(
word
1
==
NULL
||
word2
==
NULL
)
{
if
(
word
Pattern
==
NULL
||
wordInput
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
for
(
int32_t
i
=
0
;
i
<
cmd
1
->
count
;
i
++
)
{
for
(
int32_t
i
=
0
;
i
<
cmd
Pattern
->
count
;
i
++
)
{
if
(
word
1
->
type
==
WT_TEXT
)
{
if
(
word
Pattern
->
type
==
WT_TEXT
)
{
// WT_TEXT match
// WT_TEXT match
if
(
word
1
->
len
==
word2
->
len
)
{
if
(
word
Pattern
->
len
==
wordInput
->
len
)
{
if
(
strncasecmp
(
word
1
->
word
,
word2
->
word
,
word1
->
len
)
!=
0
)
return
-
1
;
if
(
strncasecmp
(
word
Pattern
->
word
,
wordInput
->
word
,
wordPattern
->
len
)
!=
0
)
return
-
1
;
}
else
if
(
word
1
->
len
<
word2
->
len
)
{
}
else
if
(
word
Pattern
->
len
<
wordInput
->
len
)
{
return
-
1
;
return
-
1
;
}
else
{
}
else
{
// word1->len > word2->len
// wordPattern->len > wordInput->len
if
(
strncasecmp
(
word1
->
word
,
word2
->
word
,
word2
->
len
)
==
0
)
{
if
(
strncasecmp
(
wordPattern
->
word
,
wordInput
->
word
,
wordInput
->
len
)
==
0
)
{
cmd1
->
matchIndex
=
i
;
if
(
i
+
1
==
cmdInput
->
count
)
{
cmd1
->
matchLen
=
word2
->
len
;
// last word return match
cmdPattern
->
matchIndex
=
i
;
cmdPattern
->
matchLen
=
wordInput
->
len
;
return
i
;
return
i
;
}
else
{
}
else
{
return
-
1
;
return
-
1
;
}
}
}
else
{
return
-
1
;
}
}
}
}
else
{
}
else
{
// WT_VAR auto match any one word
// WT_VAR auto match any one word
if
(
word
2
->
next
==
NULL
)
{
// input words last one
if
(
word
Input
->
next
==
NULL
)
{
// input words last one
if
(
matchVarWord
(
word
1
,
word2
))
{
if
(
matchVarWord
(
word
Pattern
,
wordInput
))
{
cmd
1
->
matchIndex
=
i
;
cmd
Pattern
->
matchIndex
=
i
;
cmd
1
->
matchLen
=
word2
->
len
;
cmd
Pattern
->
matchLen
=
wordInput
->
len
;
varMode
=
true
;
varMode
=
true
;
return
i
;
return
i
;
}
}
...
@@ -1009,9 +1014,9 @@ int32_t compareCommand(SWords* cmd1, SWords* cmd2) {
...
@@ -1009,9 +1014,9 @@ int32_t compareCommand(SWords* cmd1, SWords* cmd2) {
}
}
// move next
// move next
word
1
=
word1
->
next
;
word
Pattern
=
wordPattern
->
next
;
word
2
=
word2
->
next
;
word
Input
=
wordInput
->
next
;
if
(
word
1
==
NULL
||
word2
==
NULL
)
{
if
(
word
Pattern
==
NULL
||
wordInput
==
NULL
)
{
return
-
1
;
return
-
1
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录