Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2a819ec6
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2a819ec6
编写于
11月 30, 2022
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: column/row support up to 64k
上级
105469d1
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
131 addition
and
120 deletion
+131
-120
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+5
-4
src/inc/taosdef.h
src/inc/taosdef.h
+5
-30
tests/pytest/insert/openTsdbTelnetLinesInsert.py
tests/pytest/insert/openTsdbTelnetLinesInsert.py
+4
-4
tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
...demoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
+17
-17
tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
...t/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
+2
-2
tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py
...s/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py
+17
-6
tests/robust/robust.c
tests/robust/robust.c
+1
-1
tests/script/general/compute/cast_query1.sim
tests/script/general/compute/cast_query1.sim
+2
-2
tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
...t/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
+2
-2
tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py
...est/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py
+76
-52
未找到文件。
src/client/src/tscSQLParser.c
浏览文件 @
2a819ec6
...
@@ -1688,8 +1688,8 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
...
@@ -1688,8 +1688,8 @@ static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pC
return
false
;
return
false
;
}
}
if
((
p
->
type
==
TSDB_DATA_TYPE_BINARY
&&
p
->
bytes
<=
0
)
||
if
((
p
->
type
==
TSDB_DATA_TYPE_BINARY
&&
(
p
->
bytes
<=
0
||
p
->
bytes
>
TSDB_MAX_BINARY_LEN
)
)
||
(
p
->
type
==
TSDB_DATA_TYPE_NCHAR
&&
p
->
bytes
<=
0
))
{
(
p
->
type
==
TSDB_DATA_TYPE_NCHAR
&&
(
p
->
bytes
<=
0
||
p
->
bytes
>
TSDB_MAX_NCHAR_LEN
)
))
{
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg7
);
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg7
);
return
false
;
return
false
;
}
}
...
@@ -1803,7 +1803,8 @@ int32_t validateOneTag(SSqlCmd* pCmd, TAOS_FIELD* pTagField) {
...
@@ -1803,7 +1803,8 @@ int32_t validateOneTag(SSqlCmd* pCmd, TAOS_FIELD* pTagField) {
}
}
// binary(val), val can not be equalled to or less than 0
// binary(val), val can not be equalled to or less than 0
if
((
pTagField
->
type
==
TSDB_DATA_TYPE_BINARY
||
pTagField
->
type
==
TSDB_DATA_TYPE_NCHAR
)
&&
pTagField
->
bytes
<=
0
)
{
if
((
pTagField
->
type
==
TSDB_DATA_TYPE_BINARY
||
pTagField
->
type
==
TSDB_DATA_TYPE_NCHAR
)
&&
(
pTagField
->
bytes
<=
0
||
pTagField
->
bytes
>
TSDB_MAX_TAGS_LEN
))
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg5
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg5
);
}
}
...
@@ -5318,7 +5319,7 @@ static int32_t validateSQLExprItem(SSqlCmd* pCmd, tSqlExpr* pExpr,
...
@@ -5318,7 +5319,7 @@ static int32_t validateSQLExprItem(SSqlCmd* pCmd, tSqlExpr* pExpr,
pList
->
ids
[
pList
->
num
++
]
=
idx
;
pList
->
ids
[
pList
->
num
++
]
=
idx
;
*
type
=
SQLEXPR_TYPE_SCALAR
;
*
type
=
SQLEXPR_TYPE_SCALAR
;
}
else
if
(
pExpr
->
type
==
SQL_NODE_DATA_TYPE
)
{
}
else
if
(
pExpr
->
type
==
SQL_NODE_DATA_TYPE
)
{
if
(
pExpr
->
dataType
.
type
<
0
||
pExpr
->
dataType
.
bytes
<=
0
)
{
if
(
pExpr
->
dataType
.
type
<
0
||
pExpr
->
dataType
.
bytes
<=
0
||
pExpr
->
dataType
.
bytes
>
TSDB_MAX_FIELD_LEN
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg2
);
}
}
*
type
=
SQLEXPR_TYPE_VALUE
;
*
type
=
SQLEXPR_TYPE_VALUE
;
...
...
src/inc/taosdef.h
浏览文件 @
2a819ec6
...
@@ -226,30 +226,11 @@ do { \
...
@@ -226,30 +226,11 @@ do { \
#define TSDB_APPNAME_LEN TSDB_UNI_LEN
#define TSDB_APPNAME_LEN TSDB_UNI_LEN
#if 1
/**
/**
* In some scenarios uint16_t (0~65535) is used to store the row len.
* uint16_t (0~65535) is used to store the row len, and SDataRow contains 4 bits header.
* - Firstly, we use 65531(65535 - 4), as the SDataRow/SKVRow contains 4 bits header.
* history: 49151->65531
* - Secondly, if all cols are VarDataT type except primary key, we need 4 bits to store the offset, thus
* the final value is 65531-(4096-1)*4 = 49151.
*/
*/
#define TSDB_MAX_BYTES_PER_ROW 65527
#define TSDB_MAX_BYTES_PER_ROW 65531
// 49151
// 65527
#endif
/**
* In some scenarios uint16_t (0~65535) is used to store the row len.
* - Firstly, we use 65531(65535 - 4), as the SDataRow contains 4 bits header.
* - Secondly, if all cols are VarDataT type except primary key, we need 4 bits to store the offset, thus
* the final value is [65531 - (4096-1)*4 = 49151, 65531 - (2-1)*4 = 65527]
* -
*/
// [49151, min(65527, RPC_MAX_UDP_SIZE)]
#if 0
#define TSDB_MAX_BYTES_PER_ROW_BY_COL(c) (65535 - (c) << 2) // 65531 - (col-1)*4
#endif
#define TSDB_MAX_TAGS_LEN 16384
#define TSDB_MAX_TAGS_LEN 16384
#define TSDB_MAX_JSON_TAGS_LEN (4096 * TSDB_NCHAR_SIZE + 2 + 1) // 2->var_header_len 1->type
#define TSDB_MAX_JSON_TAGS_LEN (4096 * TSDB_NCHAR_SIZE + 2 + 1) // 2->var_header_len 1->type
...
@@ -391,14 +372,8 @@ do { \
...
@@ -391,14 +372,8 @@ do { \
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_MAX_UNION_CLAUSE 5
#define TSDB_MAX_FIELD_LEN 65519
#define TSDB_MAX_FIELD_LEN 65519
// 16384
#define TSDB_MAX_BINARY_LEN TSDB_MAX_FIELD_LEN // 16384:65519
// 65519
#define TSDB_MAX_NCHAR_LEN TSDB_MAX_FIELD_LEN // 16384:65519
// #define TSDB_MAX_BINARY_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 => 65511
// #define TSDB_MAX_NCHAR_LEN (TSDB_MAX_FIELD_LEN - TSDB_KEYSIZE) // keep 16384 => 65511
#define TSDB_MAX_BINARY_LEN TSDB_MAX_FIELD_LEN // keep 16384 => 65511
#define TSDB_MAX_NCHAR_LEN TSDB_MAX_FIELD_LEN // keep 16384 => 65511
#define PRIMARYKEY_TIMESTAMP_COL_INDEX 0
#define PRIMARYKEY_TIMESTAMP_COL_INDEX 0
...
...
tests/pytest/insert/openTsdbTelnetLinesInsert.py
浏览文件 @
2a819ec6
...
@@ -702,11 +702,11 @@ class TDTestCase:
...
@@ -702,11 +702,11 @@ class TDTestCase:
# # binary
# # binary
tdCom
.
cleanTb
()
tdCom
.
cleanTb
()
stb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
stb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
input_sql
=
f
'
{
stb_name
}
1626006833640 "
{
tdCom
.
getLongName
(
16374
,
"letters"
)
}
" t0=t'
input_sql
=
f
'
{
stb_name
}
1626006833640 "
{
tdCom
.
getLongName
(
65517
,
"letters"
)
}
" t0=t'
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
tdCom
.
cleanTb
()
tdCom
.
cleanTb
()
input_sql
=
f
'
{
stb_name
}
1626006833640 "
{
tdCom
.
getLongName
(
6551
4
,
"letters"
)
}
" t0=t'
input_sql
=
f
'
{
stb_name
}
1626006833640 "
{
tdCom
.
getLongName
(
6551
8
,
"letters"
)
}
" t0=t'
try
:
try
:
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
raise
Exception
(
"should not reach here"
)
raise
Exception
(
"should not reach here"
)
...
@@ -717,11 +717,11 @@ class TDTestCase:
...
@@ -717,11 +717,11 @@ class TDTestCase:
# * legal nchar could not be larger than 16374/4
# * legal nchar could not be larger than 16374/4
tdCom
.
cleanTb
()
tdCom
.
cleanTb
()
stb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
stb_name
=
tdCom
.
getLongName
(
7
,
"letters"
)
input_sql
=
f
'
{
stb_name
}
1626006833640 L"
{
tdCom
.
getLongName
(
4093
,
"letters"
)
}
" t0=t'
input_sql
=
f
'
{
stb_name
}
1626006833640 L"
{
tdCom
.
getLongName
(
16379
,
"letters"
)
}
" t0=t'
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
tdCom
.
cleanTb
()
tdCom
.
cleanTb
()
input_sql
=
f
'
{
stb_name
}
1626006833640 L"
{
tdCom
.
getLongName
(
163
79
,
"letters"
)
}
" t0=t'
input_sql
=
f
'
{
stb_name
}
1626006833640 L"
{
tdCom
.
getLongName
(
163
80
,
"letters"
)
}
" t0=t'
try
:
try
:
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
self
.
_conn
.
schemaless_insert
([
input_sql
],
TDSmlProtocolType
.
TELNET
.
value
,
None
)
raise
Exception
(
"should not reach here"
)
raise
Exception
(
"should not reach here"
)
...
...
tests/pytest/tools/taosdemoAllTest/TD-5213/insert4096columns_not_use_taosdemo.py
浏览文件 @
2a819ec6
...
@@ -288,9 +288,9 @@ class TDTestCase:
...
@@ -288,9 +288,9 @@ class TDTestCase:
tdSql
.
checkRows
(
4
*
self
.
num
)
tdSql
.
checkRows
(
4
*
self
.
num
)
tdSql
.
checkCols
(
4096
)
tdSql
.
checkCols
(
4096
)
#define TSDB_MAX_BYTES_PER_ROW 655
27
[old:1024 && 16384 && 49151]
#define TSDB_MAX_BYTES_PER_ROW 655
31
[old:1024 && 16384 && 49151]
#ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset]
#ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset]
tdLog
.
info
(
'test regular_table max bytes per row 655
27
'
)
tdLog
.
info
(
'test regular_table max bytes per row 655
31
'
)
sql
=
"create table regular_table_5(ts timestamp, "
sql
=
"create table regular_table_5(ts timestamp, "
for
i
in
range
(
500
):
for
i
in
range
(
500
):
sql
+=
"int_%d int, "
%
(
i
+
1
)
sql
+=
"int_%d int, "
%
(
i
+
1
)
...
@@ -312,12 +312,12 @@ class TDTestCase:
...
@@ -312,12 +312,12 @@ class TDTestCase:
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
for
i
in
range
(
4090
,
4094
):
for
i
in
range
(
4090
,
4094
):
sql
+=
"timestamp_%d timestamp, "
%
(
i
+
1
)
sql
+=
"timestamp_%d timestamp, "
%
(
i
+
1
)
sql
+=
"col4095 binary(1408
1
))"
sql
+=
"col4095 binary(1408
5
))"
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
tdSql
.
query
(
"select * from regular_table_5"
)
tdSql
.
query
(
"select * from regular_table_5"
)
tdSql
.
checkCols
(
4096
)
tdSql
.
checkCols
(
4096
)
# TD-5324
# TD-5324
sql
=
"alter table regular_table_5 modify column col4095 binary(1408
2
); "
sql
=
"alter table regular_table_5 modify column col4095 binary(1408
6
); "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
# drop and add
# drop and add
...
@@ -326,16 +326,16 @@ class TDTestCase:
...
@@ -326,16 +326,16 @@ class TDTestCase:
sql
=
"select * from regular_table_5; "
sql
=
"select * from regular_table_5; "
tdSql
.
query
(
sql
)
tdSql
.
query
(
sql
)
tdSql
.
checkCols
(
4095
)
tdSql
.
checkCols
(
4095
)
sql
=
"alter table regular_table_5 add column col4095 binary(1408
2
); "
sql
=
"alter table regular_table_5 add column col4095 binary(1408
6
); "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
sql
=
"alter table regular_table_5 add column col4095 binary(1408
1
); "
sql
=
"alter table regular_table_5 add column col4095 binary(1408
5
); "
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
"select * from regular_table_5; "
sql
=
"select * from regular_table_5; "
tdSql
.
query
(
sql
)
tdSql
.
query
(
sql
)
tdSql
.
checkCols
(
4096
)
tdSql
.
checkCols
(
4096
)
#out TSDB_MAX_BYTES_PER_ROW 655
27
#out TSDB_MAX_BYTES_PER_ROW 655
31
tdLog
.
info
(
'test regular_table max bytes per row out 655
27
'
)
tdLog
.
info
(
'test regular_table max bytes per row out 655
31
'
)
sql
=
"create table regular_table_6(ts timestamp, "
sql
=
"create table regular_table_6(ts timestamp, "
for
i
in
range
(
500
):
for
i
in
range
(
500
):
sql
+=
"int_%d int, "
%
(
i
+
1
)
sql
+=
"int_%d int, "
%
(
i
+
1
)
...
@@ -357,7 +357,7 @@ class TDTestCase:
...
@@ -357,7 +357,7 @@ class TDTestCase:
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
for
i
in
range
(
4090
,
4094
):
for
i
in
range
(
4090
,
4094
):
sql
+=
"timestamp_%d timestamp, "
%
(
i
+
1
)
sql
+=
"timestamp_%d timestamp, "
%
(
i
+
1
)
sql
+=
"col4095 binary(1408
2
))"
sql
+=
"col4095 binary(1408
6
))"
tdLog
.
info
(
len
(
sql
))
tdLog
.
info
(
len
(
sql
))
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
...
@@ -575,9 +575,9 @@ class TDTestCase:
...
@@ -575,9 +575,9 @@ class TDTestCase:
tdSql
.
checkRows
(
3
*
self
.
num
)
tdSql
.
checkRows
(
3
*
self
.
num
)
tdSql
.
checkCols
(
4092
)
tdSql
.
checkCols
(
4092
)
#define TSDB_MAX_BYTES_PER_ROW 655
27
TSDB_MAX_TAGS_LEN 16384
#define TSDB_MAX_BYTES_PER_ROW 655
31
TSDB_MAX_TAGS_LEN 16384
#ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset]
#ts:8\int:4\smallint:2\bigint:8\bool:1\float:4\tinyint:1\nchar:4*()+2[offset]\binary:1*()+2[offset]
tdLog
.
info
(
'test super table max bytes per row 655
27
'
)
tdLog
.
info
(
'test super table max bytes per row 655
31
'
)
sql
=
"create table stable_4(ts timestamp, "
sql
=
"create table stable_4(ts timestamp, "
for
i
in
range
(
500
):
for
i
in
range
(
500
):
sql
+=
"int_%d int, "
%
(
i
+
1
)
sql
+=
"int_%d int, "
%
(
i
+
1
)
...
@@ -597,7 +597,7 @@ class TDTestCase:
...
@@ -597,7 +597,7 @@ class TDTestCase:
sql
+=
"nchar_%d nchar(20), "
%
(
i
+
1
)
sql
+=
"nchar_%d nchar(20), "
%
(
i
+
1
)
for
i
in
range
(
3800
,
4090
):
for
i
in
range
(
3800
,
4090
):
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"col4091 binary(1411
3
))"
sql
+=
"col4091 binary(1411
7
))"
sql
+=
" tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) "
sql
+=
" tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) "
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
'''create table table_40 using stable_4
sql
=
'''create table table_40 using stable_4
...
@@ -614,9 +614,9 @@ class TDTestCase:
...
@@ -614,9 +614,9 @@ class TDTestCase:
sql
=
"select * from stable_4; "
sql
=
"select * from stable_4; "
tdSql
.
query
(
sql
)
tdSql
.
query
(
sql
)
tdSql
.
checkCols
(
4095
)
tdSql
.
checkCols
(
4095
)
sql
=
"alter table stable_4 add column col4091 binary(1411
4
); "
sql
=
"alter table stable_4 add column col4091 binary(1411
8
); "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
sql
=
"alter table stable_4 add column col4091 binary(1411
3
); "
sql
=
"alter table stable_4 add column col4091 binary(1411
7
); "
tdSql
.
execute
(
sql
)
tdSql
.
execute
(
sql
)
sql
=
"select * from stable_4; "
sql
=
"select * from stable_4; "
tdSql
.
query
(
sql
)
tdSql
.
query
(
sql
)
...
@@ -635,7 +635,7 @@ class TDTestCase:
...
@@ -635,7 +635,7 @@ class TDTestCase:
sql
=
"alter table stable_4 add tag loc1 nchar(10); "
sql
=
"alter table stable_4 add tag loc1 nchar(10); "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
tdLog
.
info
(
'test super table max bytes per row 655
27
'
)
tdLog
.
info
(
'test super table max bytes per row 655
31
'
)
sql
=
"create table stable_5(ts timestamp, "
sql
=
"create table stable_5(ts timestamp, "
for
i
in
range
(
500
):
for
i
in
range
(
500
):
sql
+=
"int_%d int, "
%
(
i
+
1
)
sql
+=
"int_%d int, "
%
(
i
+
1
)
...
@@ -655,7 +655,7 @@ class TDTestCase:
...
@@ -655,7 +655,7 @@ class TDTestCase:
sql
+=
"nchar_%d nchar(20), "
%
(
i
+
1
)
sql
+=
"nchar_%d nchar(20), "
%
(
i
+
1
)
for
i
in
range
(
3800
,
4090
):
for
i
in
range
(
3800
,
4090
):
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"binary_%d binary(34), "
%
(
i
+
1
)
sql
+=
"col4091 binary(1411
4
))"
sql
+=
"col4091 binary(1411
8
))"
sql
+=
" tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) "
sql
+=
" tags (loc nchar(10),tag_1 int,tag_2 int,tag_3 int) "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
...
@@ -686,7 +686,7 @@ class TDTestCase:
...
@@ -686,7 +686,7 @@ class TDTestCase:
sql
=
"alter table stable_1 add tag max int; "
sql
=
"alter table stable_1 add tag max int; "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
# TD-5324
# TD-5324
sql
=
"alter table stable_4 modify column col4091 binary(1411
4
); "
sql
=
"alter table stable_4 modify column col4091 binary(1411
8
); "
tdSql
.
error
(
sql
)
tdSql
.
error
(
sql
)
sql
=
"alter table stable_4 modify tag loc nchar(20); "
sql
=
"alter table stable_4 modify tag loc nchar(20); "
tdSql
.
query
(
"select * from table_40"
)
tdSql
.
query
(
"select * from table_40"
)
...
...
tests/pytest/tools/taosdemoAllTest/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
浏览文件 @
2a819ec6
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
"sample_format"
:
"csv"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
6551
4
,
"count"
:
1
}],
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
6551
8
,
"count"
:
1
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
},
},
{
{
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
"sample_format"
:
"csv"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
21831
,
"count"
:
3
},{
"type"
:
"INT"
,
"count"
:
2
},{
"type"
:
"TINYINT"
}],
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
21831
,
"count"
:
3
},{
"type"
:
"INT"
,
"count"
:
3
},{
"type"
:
"TINYINT"
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}]
}]
...
...
tests/pytest/tools/taosdemoAllTest/taosdemoTestInsertShell.py
浏览文件 @
2a819ec6
...
@@ -213,18 +213,29 @@ class TDTestCase:
...
@@ -213,18 +213,29 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
# max valid length - row
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16370\)
\
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
==
0
# taosdemo error
# taosdemo error
# too max length
# # too max length - column
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16379\)
\
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b NCHAR\(16380\)
\
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
# too max length - row
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16371\)
\
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
assert
os
.
system
(
"%s"
%
sql
)
!=
0
# error password
# error password
sql
=
"%s -u root -c %s -h localhost -P 6030 -p123 -d db1 -a 1 -l 10 -b float,int,NCHAR\(40\)
\
sql
=
"%s -u root -c %s -h localhost -P 6030 -p123 -d db1 -a 1 -l 10 -b float,int,NCHAR\(40\)
\
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt"
%
(
binPath
,
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt"
%
(
binPath
,
cfgPath
)
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
assert
os
.
system
(
"%s"
%
sql
)
!=
0
...
...
tests/robust/robust.c
浏览文件 @
2a819ec6
...
@@ -195,7 +195,7 @@ void insertImp(void *param) {
...
@@ -195,7 +195,7 @@ void insertImp(void *param) {
for
(
int
j
=
0
;
j
<
arguments
.
table
;
j
++
)
{
for
(
int
j
=
0
;
j
<
arguments
.
table
;
j
++
)
{
sqlLen
+=
sprintf
(
sql
+
sqlLen
,
" s%d_%d values (%ld, %d, %d, %d)"
,
i
,
j
,
time
,
rand
(),
rand
(),
rand
());
sqlLen
+=
sprintf
(
sql
+
sqlLen
,
" s%d_%d values (%ld, %d, %d, %d)"
,
i
,
j
,
time
,
rand
(),
rand
(),
rand
());
count
++
;
count
++
;
if
(
(
1048576
-
sqlLen
)
<
655
27
||
i
==
(
pThread
->
threadId
*
arguments
.
stable
/
arguments
.
client
-
1
))
{
if
(
(
1048576
-
sqlLen
)
<
655
31
||
i
==
(
pThread
->
threadId
*
arguments
.
stable
/
arguments
.
client
-
1
))
{
result
=
taos_query
(
pThread
->
taos
,
sql
);
result
=
taos_query
(
pThread
->
taos
,
sql
);
printf
(
"Thread %d already insert %d rows
\n
"
,
pThread
->
threadId
,
count
);
printf
(
"Thread %d already insert %d rows
\n
"
,
pThread
->
threadId
,
count
);
if
(
result
==
NULL
||
taos_errno
(
result
)
!=
0
)
{
if
(
result
==
NULL
||
taos_errno
(
result
)
!=
0
)
{
...
...
tests/script/general/compute/cast_query1.sim
浏览文件 @
2a819ec6
...
@@ -13,8 +13,8 @@ sql_error select cast(* as bigint) as a from tb1;
...
@@ -13,8 +13,8 @@ sql_error select cast(* as bigint) as a from tb1;
sql_error select cast(* as bigint) + 1 as a from tb1;
sql_error select cast(* as bigint) + 1 as a from tb1;
sql_error select cast(tb1.* as bigint) + 1 as a from tb1;
sql_error select cast(tb1.* as bigint) + 1 as a from tb1;
sql_error select cast(* as bigint) from tb1;
sql_error select cast(* as bigint) from tb1;
sql_error select cast(c1 as binary(
16384
)) from tb1;
sql_error select cast(c1 as binary(
65518
)) from tb1;
sql_error select cast(c1 as nchar(1638
4
)) from tb1;
sql_error select cast(c1 as nchar(1638
0
)) from tb1;
sql_error select cast(c1 + c2 as bigint) from tb1;
sql_error select cast(c1 + c2 as bigint) from tb1;
sql_error select cast(13 as binary(0)) from tb1;
sql_error select cast(13 as binary(0)) from tb1;
sql_error select cast(12 as binary(-1)) from tb1;
sql_error select cast(12 as binary(-1)) from tb1;
...
...
tests/system-test/5-taos-tools/taosbenchmark/stmt/insertBinaryLenLarge16374AllcolLar49151-error-stmt.json
浏览文件 @
2a819ec6
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
"sample_format"
:
"csv"
,
"sample_format"
:
"csv"
,
"sample_file"
:
"./sample.csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
6551
4
,
"count"
:
1
}],
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
6551
8
,
"count"
:
1
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
},
},
{
{
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
"sample_file"
:
"./sample.csv"
,
"sample_file"
:
"./sample.csv"
,
"tags_file"
:
""
,
"tags_file"
:
""
,
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
21831
,
"count"
:
3
},{
"type"
:
"INT"
,
"count"
:
2
},{
"type"
:
"TINYINT"
}],
"columns"
:
[{
"type"
:
"BINARY"
,
"len"
:
21831
,
"count"
:
3
},{
"type"
:
"INT"
,
"count"
:
2
},{
"type"
:
"TINYINT"
}],
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
2
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
"tags"
:
[{
"type"
:
"TINYINT"
,
"count"
:
3
},
{
"type"
:
"BINARY"
,
"len"
:
16
,
"count"
:
5
}]
}]
}]
}]
}]
}
}
tests/system-test/5-taos-tools/taosbenchmark/taosdemoTestInsertShell.py
浏览文件 @
2a819ec6
...
@@ -24,40 +24,41 @@ class TDTestCase:
...
@@ -24,40 +24,41 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
get
BuildPath
(
self
):
def
get
Path
(
self
,
tool
=
"taosBenchmark"
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
global
cfgPath
global
cfgPath
if
(
"community"
in
selfPath
):
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
cfgPath
=
projPath
+
"/community/sim/dnode1/cfg"
cfgPath
=
projPath
+
"/community/sim/dnode1/cfg"
else
:
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
cfgPath
=
projPath
+
"/sim/dnode1/cfg"
cfgPath
=
projPath
+
"/sim/dnode1/cfg"
paths
=
[]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
"taosd"
in
files
):
if
(
(
tool
)
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
if
(
"packaging"
not
in
rootRealPath
):
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
paths
.
append
(
os
.
path
.
join
(
root
,
tool
))
break
break
return
buildPath
return
paths
[
0
]
# def checkGerData():
# def checkGerData():
def
run
(
self
):
def
run
(
self
):
b
uildPath
=
self
.
getBuildPath
(
)
b
inPath
=
self
.
getPath
(
"taosBenchmark"
)
print
(
"%s"
%
cfgPath
)
print
(
"%s"
%
cfgPath
)
if
(
b
uild
Path
==
""
):
if
(
b
in
Path
==
""
):
tdLog
.
exit
(
"taos
d
not found!"
)
tdLog
.
exit
(
"taos
Benchmark
not found!"
)
else
:
else
:
tdLog
.
info
(
"taosd found in %s"
%
buildPath
)
tdLog
.
info
(
"taosBenchmark found in %s"
%
binPath
)
binPath
=
buildPath
+
"/build/bin/"
tdLog
.
info
(
"create super table"
)
tdLog
.
info
(
"create super table"
)
# create super table
# create super table
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
os
.
system
(
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"describe meters;"
)
tdSql
.
query
(
"describe meters;"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkRows
(
13
)
...
@@ -68,12 +69,13 @@ class TDTestCase:
...
@@ -68,12 +69,13 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdLog
.
info
(
"create general table -N "
)
tdLog
.
info
(
"create general table -N "
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# create general table -N
# create general table -N
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
os
.
system
(
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -N "
%
(
binPath
,
cfgPath
))
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -N "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"describe `test.0`;"
)
tdSql
.
query
(
"describe `test.0`;"
)
tdSql
.
checkRows
(
11
)
tdSql
.
checkRows
(
11
)
...
@@ -85,8 +87,10 @@ class TDTestCase:
...
@@ -85,8 +87,10 @@ class TDTestCase:
tdLog
.
info
(
"use diffrent interface stmt"
)
tdLog
.
info
(
"use diffrent interface stmt"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# use diffrent interface-stmt
# use diffrent interface-stmt
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,BINARY\(4000\) -w 40
\
os
.
system
(
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt "
%
(
binPath
,
cfgPath
))
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,BINARY\(4000\) -w 40
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -98,8 +102,10 @@ class TDTestCase:
...
@@ -98,8 +102,10 @@ class TDTestCase:
tdLog
.
info
(
"use diffrent interface rest"
)
tdLog
.
info
(
"use diffrent interface rest"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# use diffrent interface -rest
# use diffrent interface -rest
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4097
\
os
.
system
(
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I rest "
%
(
binPath
,
cfgPath
))
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4097
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I rest "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -111,8 +117,10 @@ class TDTestCase:
...
@@ -111,8 +117,10 @@ class TDTestCase:
tdLog
.
info
(
"use diffrent interface sml"
)
tdLog
.
info
(
"use diffrent interface sml"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# use diffrent interface-sml
# use diffrent interface-sml
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 1024
\
os
.
system
(
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I sml "
%
(
binPath
,
cfgPath
))
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 1024
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I sml "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -122,9 +130,9 @@ class TDTestCase:
...
@@ -122,9 +130,9 @@ class TDTestCase:
tdLog
.
info
(
"all data type"
)
tdLog
.
info
(
"all data type"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# all data type-taosc
# all data type-taosc
os
.
system
(
"%s
taosBenchmark
-u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
os
.
system
(
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -135,9 +143,9 @@ class TDTestCase:
...
@@ -135,9 +143,9 @@ class TDTestCase:
tdLog
.
info
(
"all data type"
)
tdLog
.
info
(
"all data type"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# all data type-stmt
# all data type-stmt
os
.
system
(
"%s
taosBenchmark
-u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
os
.
system
(
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt "
%
(
binPath
,
cfgPath
))
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -147,9 +155,9 @@ class TDTestCase:
...
@@ -147,9 +155,9 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
# all data type-rest
# all data type-rest
os
.
system
(
"%s
taosBenchmark
-u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
os
.
system
(
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I rest "
%
(
binPath
,
cfgPath
))
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I rest "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -159,7 +167,7 @@ class TDTestCase:
...
@@ -159,7 +167,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
# # all data type-rest
# # all data type-rest
# os.system("%s
taosBenchmark
-u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 \
# os.system("%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 \
# -b INT,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096 \
# -b INT,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096 \
# -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I sml " % (binPath,cfgPath))
# -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I sml " % (binPath,cfgPath))
# tdSql.execute("use db1")
# tdSql.execute("use db1")
...
@@ -172,10 +180,10 @@ class TDTestCase:
...
@@ -172,10 +180,10 @@ class TDTestCase:
tdLog
.
info
(
"all data type and interlace rows"
)
tdLog
.
info
(
"all data type and interlace rows"
)
tdSql
.
execute
(
"drop database db1;"
)
tdSql
.
execute
(
"drop database db1;"
)
# all data type
# all data type
os
.
system
(
"%s
taosBenchmark
-u root -c %s -h localhost -P 6030 -d db3 -a 1 -l 10
\
os
.
system
(
"%s -u root -c %s -h localhost -P 6030 -d db3 -a 1 -l 10
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-b INT,TIMESTAMP,BIGINT,FLOAT,DOUBLE,SMALLINT,TINYINT,BOOL,UINT,UBIGINT,UTINYINT,USMALLINT,BINARY\(15\),NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -B 1000 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -B 1000 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
))
tdSql
.
execute
(
"use db3"
)
tdSql
.
execute
(
"use db3"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -185,14 +193,18 @@ class TDTestCase:
...
@@ -185,14 +193,18 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdLog
.
info
(
"all data type and too much para"
)
tdLog
.
info
(
"all data type and too much para"
)
tdLog
.
info
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
tdLog
.
info
(
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test.taosdemo -u root -c %s -h
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test.taosdemo -u root -c %s -h
\
localhost -P 6030 -d db1 -a 1 -l 100 -b float,int,NCHAR\(15\) -w 4096 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
,
cfgPath
))
localhost -P 6030 -d db1 -a 1 -l 100 -b float,int,NCHAR\(15\) -w 4096 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
,
cfgPath
))
tdSql
.
execute
(
"drop database db3;"
)
tdSql
.
execute
(
"drop database db3;"
)
# repeate parameters
# repeate parameters
os
.
system
(
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
os
.
system
(
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(15\) -w 4096
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test.taosdemo -u root -c %s -h
\
-T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test.taosdemo -u root -c %s -h
\
localhost -P 6030 -d db1 -a 1 -l 100 -b float,int,NCHAR\(15\) -w 4096 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
,
cfgPath
))
localhost -P 6030 -d db1 -a 1 -l 100 -b float,int,NCHAR\(15\) -w 4096 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. "
%
(
binPath
,
cfgPath
,
cfgPath
))
tdSql
.
execute
(
"use db1"
)
tdSql
.
execute
(
"use db1"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
query
(
"select count(*) from meters"
)
tdSql
.
checkData
(
0
,
0
,
1000
)
tdSql
.
checkData
(
0
,
0
,
1000
)
...
@@ -201,23 +213,35 @@ class TDTestCase:
...
@@ -201,23 +213,35 @@ class TDTestCase:
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
query
(
"select count(*) from `test.0`"
)
tdSql
.
checkData
(
0
,
0
,
100
)
tdSql
.
checkData
(
0
,
0
,
100
)
# max valid length - row
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16370\)
\
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
==
0
# taosdemo error
# taosdemo error
# too max length
# # too max length - column
sql
=
"%staosBenchmark -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16379\)
\
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b NCHAR\(16380\)
\
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
assert
os
.
system
(
"%s"
%
sql
)
!=
0
# error password
# too max length - row
sql
=
"%staosBenchmark -u root -c %s -h localhost -P 6030 -p123 -d db1 -a 1 -l 10 -b float,int,NCHAR\(40\)
\
sql
=
"%s -u root -c %s -h localhost -P 6030 -d db1 -a 1 -l 10 -b float,int,NCHAR\(16371\)
\
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt"
%
(
binPath
,
cfgPath
)
-w 40 -T 8 -i 10 -S 1000 -r 48 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I taosc"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
assert
os
.
system
(
"%s"
%
sql
)
!=
0
# error password
sql
=
"%s -u root -c %s -h localhost -P 6030 -p123 -d db1 -a 1 -l 10 -b float,int,NCHAR\(40\)
\
-w 40 -T 8 -i 10 -S 1000 -r 1000000 -t 10 -n 100 -M -x -y -O 10 -R 100 -E -m test. -I stmt"
%
(
binPath
,
cfgPath
)
tdLog
.
info
(
"%s"
%
sql
)
assert
os
.
system
(
"%s"
%
sql
)
!=
0
testcaseFilename
=
os
.
path
.
split
(
__file__
)[
-
1
]
testcaseFilename
=
os
.
path
.
split
(
__file__
)[
-
1
]
os
.
system
(
"rm -rf ./insert_res*.txt*"
)
os
.
system
(
"rm -rf ./insert_res*.txt*"
)
os
.
system
(
"rm -rf tools/taosdemoAllTest/%s.sql"
%
testcaseFilename
)
os
.
system
(
"rm -rf tools/taosdemoAllTest/%s.sql"
%
testcaseFilename
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录