Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
21680456
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
21680456
编写于
7月 28, 2021
作者:
J
jiajingbin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
1bf4e566
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
48 deletion
+33
-48
tests/pytest/insert/schemalessInsert.py
tests/pytest/insert/schemalessInsert.py
+33
-48
未找到文件。
tests/pytest/insert/schemalessInsert.py
浏览文件 @
21680456
...
...
@@ -291,8 +291,7 @@ class TDTestCase:
def
resCmp
(
self
,
input_sql
,
stb_name
,
query_sql
=
"select * from"
,
condition
=
""
,
ts
=
None
,
id
=
True
,
none_check_tag
=
None
):
expect_list
=
self
.
inputHandle
(
input_sql
)
code
=
self
.
_conn
.
insertLines
([
input_sql
])
print
(
"insertLines result {}"
.
format
(
code
))
self
.
_conn
.
insertLines
([
input_sql
])
query_sql
=
f
"
{
query_sql
}
{
stb_name
}
{
condition
}
"
res_row_list
,
res_field_list_without_ts
,
res_type_list
=
self
.
resHandle
(
query_sql
,
True
)
if
ts
==
0
:
...
...
@@ -361,8 +360,7 @@ class TDTestCase:
self
.
cleanStb
()
ts_list
=
[
"1626006833639000000ns"
,
"1626006833639019us"
,
"1626006833640ms"
,
"1626006834s"
,
"1626006822639022"
,
0
]
for
ts
in
ts_list
:
input_sql
,
stb_name
,
tb_name
=
self
.
genFullTypeSql
(
ts
=
ts
)
print
(
input_sql
)
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
ts
=
ts
)
self
.
resCmp
(
input_sql
,
stb_name
,
ts
=
ts
)
def
idSeqCheckCase
(
self
):
...
...
@@ -422,7 +420,6 @@ class TDTestCase:
rstr
=
list
(
"`~!@#$¥%^&*()-+={}|[]、「」【】\:;《》<>?"
)
for
i
in
rstr
:
input_sql
=
self
.
genFullTypeSql
(
tb_name
=
f
"
\"
aaa
{
i
}
bbb
\"
"
)[
0
]
print
(
input_sql
)
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
...
...
@@ -514,12 +511,9 @@ class TDTestCase:
tdSql
.
checkNotEqual
(
code
,
0
)
# f64 # * bug stack smashing detected ***: <unknown> terminated Aborted --- fixed
# for t6 in [f'{-1.79769313486231570814527423731704356798070567525844996598917476803157260780*(10**308)}f64', f'{-1.79769313486231570814527423731704356798070567525844996598917476803157260780*(10**308)}f64']:
for
t6
in
[
f
'
{
-
1.79769
*
(
10
**
308
)
}
f64'
,
f
'
{
-
1.79769
*
(
10
**
308
)
}
f64'
]:
print
(
"f64?"
)
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
t6
=
t6
)
self
.
resCmp
(
input_sql
,
stb_name
)
# TODO to confirm length
# * limit set to 1.797693134862316*(10**308)
for
c6
in
[
f
'
{
-
1.797693134862316
*
(
10
**
308
)
}
f64'
,
f
'
{
-
1.797693134862316
*
(
10
**
308
)
}
f64'
]:
input_sql
=
self
.
genFullTypeSql
(
c6
=
c6
)[
0
]
...
...
@@ -558,7 +552,6 @@ class TDTestCase:
for
c1
in
[
"-128i8"
,
"128i8"
]:
input_sql
=
self
.
genFullTypeSql
(
c1
=
c1
)[
0
]
print
(
input_sql
)
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
# i16
...
...
@@ -662,6 +655,7 @@ class TDTestCase:
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
# TODO nchar binary
# `~!@#$¥%^&*()-+={}|[]、「」【】:;
def
duplicateIdTagColInsertCheckCase
(
self
):
"""
...
...
@@ -723,7 +717,6 @@ class TDTestCase:
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
stb_name
=
stb_name
,
tb_name
=
tb_name
,
t7
=
"
\"
binaryTagValuebinaryTagValue
\"
"
,
t8
=
"L
\"
ncharTagValuencharTagValue
\"
"
,
c7
=
"
\"
binaryTagValuebinaryTagValue
\"
"
,
c8
=
"L
\"
ncharTagValuencharTagValue
\"
"
)
self
.
resCmp
(
input_sql
,
stb_name
,
condition
=
f
'where tbname like "
{
tb_name
}
"'
)
# ! use tb_name
def
tagColAddDupIDCheckCase
(
self
):
"""
check column and tag count add, stb and tb duplicate
...
...
@@ -783,10 +776,9 @@ class TDTestCase:
tdSql
.
checkRows
(
2
)
tdSql
.
checkNotEqual
(
tb_name1
,
tb_name3
)
#
?
tag binary max is 16384, col+ts binary max 49151
#
*
tag binary max is 16384, col+ts binary max 49151
def
tagColBinaryMaxLengthCheckCase
(
self
):
"""
# ? case finish , src bug exist
every binary and nchar must be length+2, so
"""
self
.
cleanStb
()
...
...
@@ -799,21 +791,27 @@ class TDTestCase:
input_sql
=
f
'
{
stb_name
}
,t0=t,t1="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",t2="
{
self
.
getLongName
(
5
,
"letters"
)
}
" c0=f 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkEqual
(
code
,
0
)
tdSql
.
query
(
f
"select * from
{
stb_name
}
"
)
tdSql
.
checkRows
(
2
)
input_sql
=
f
'
{
stb_name
}
,t0=t,t1="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",t2="
{
self
.
getLongName
(
6
,
"letters"
)
}
" c0=f 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
tdSql
.
query
(
f
"select * from
{
stb_name
}
"
)
tdSql
.
checkRows
(
2
)
# # * check col,col+ts max in describe ---> 16143
input_sql
=
f
'
{
stb_name
}
,t0=t c0=f,c1="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c2="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c3="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c4="
{
self
.
getLongName
(
12
,
"letters"
)
}
" 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkEqual
(
code
,
0
)
# input_sql = f'{stb_name},t0=t c0=f,c1="{self.getLongName(16374, "letters")}",c2="{self.getLongName(16374, "letters")}",c3="{self.getLongName(16374, "letters")}",c4="{self.getLongName(13, "letters")}" 1626006833639000000ns'
# print(input_sql)
# code = self._conn.insertLines([input_sql])
# print(code)
# tdSql.checkNotEqual(code, 0)
tdSql
.
query
(
f
"select * from
{
stb_name
}
"
)
tdSql
.
checkRows
(
3
)
input_sql
=
f
'
{
stb_name
}
,t0=t c0=f,c1="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c2="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c3="
{
self
.
getLongName
(
16374
,
"letters"
)
}
",c4="
{
self
.
getLongName
(
13
,
"letters"
)
}
" 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
tdSql
.
query
(
f
"select * from
{
stb_name
}
"
)
tdSql
.
checkRows
(
3
)
#
? tag nchar max is 1638
4, col+ts nchar max 49151
#
* tag nchar max is 16374/
4, col+ts nchar max 49151
def
tagColNcharMaxLengthCheckCase
(
self
):
"""
# ? case finish , src bug exist
...
...
@@ -828,12 +826,15 @@ class TDTestCase:
input_sql
=
f
'
{
stb_name
}
,t0=t,t1=L"
{
self
.
getLongName
(
4093
,
"letters"
)
}
",t2=L"
{
self
.
getLongName
(
1
,
"letters"
)
}
" c0=f 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkEqual
(
code
,
0
)
tdSql
.
query
(
f
"select * from
{
stb_name
}
"
)
tdSql
.
checkRows
(
2
)
input_sql
=
f
'
{
stb_name
}
,t0=t,t1=L"
{
self
.
getLongName
(
4093
,
"letters"
)
}
",t2=L"
{
self
.
getLongName
(
2
,
"letters"
)
}
" c0=f 1626006833639000000ns'
code
=
self
.
_conn
.
insertLines
([
input_sql
])
tdSql
.
checkNotEqual
(
code
,
0
)
# ! leave a bug DB error: Invalid value in client
# tdSql.checkNotEqual(code, 0)
# tdSql.query(f"select * from {stb_name}")
# tdSql.checkRows(2)
# ! rollback bug
# TODO because it is no rollback now, so stb has been broken, create a new!
# stb_name = self.getLongName(7, "letters")
# tb_name = f'{stb_name}_1'
# input_sql = f'{stb_name},id="{tb_name}",t0=t c0=f 1626006833639000000ns'
...
...
@@ -1058,7 +1059,6 @@ class TDTestCase:
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
tb_name
=
tb_name
)
self
.
resCmp
(
input_sql
,
stb_name
)
s_stb_s_tb_d_ts_list
=
self
.
genSqlList
(
stb_name
=
stb_name
,
tb_name
=
tb_name
)[
7
]
print
(
s_stb_s_tb_d_ts_list
)
self
.
multiThreadRun
(
self
.
genMultiThreadSeq
(
s_stb_s_tb_d_ts_list
))
tdSql
.
query
(
f
"show tables;"
)
tdSql
.
checkRows
(
1
)
...
...
@@ -1074,7 +1074,6 @@ class TDTestCase:
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
tb_name
=
tb_name
)
self
.
resCmp
(
input_sql
,
stb_name
)
s_stb_s_tb_d_ts_a_col_m_tag_list
=
self
.
genSqlList
(
stb_name
=
stb_name
,
tb_name
=
tb_name
)[
8
]
print
(
s_stb_s_tb_d_ts_a_col_m_tag_list
)
self
.
multiThreadRun
(
self
.
genMultiThreadSeq
(
s_stb_s_tb_d_ts_a_col_m_tag_list
))
tdSql
.
query
(
f
"show tables;"
)
tdSql
.
checkRows
(
1
)
...
...
@@ -1094,7 +1093,6 @@ class TDTestCase:
input_sql
,
stb_name
=
self
.
genFullTypeSql
(
tb_name
=
tb_name
)
self
.
resCmp
(
input_sql
,
stb_name
)
s_stb_s_tb_d_ts_a_tag_m_col_list
=
self
.
genSqlList
(
stb_name
=
stb_name
,
tb_name
=
tb_name
)[
9
]
print
(
s_stb_s_tb_d_ts_a_tag_m_col_list
)
self
.
multiThreadRun
(
self
.
genMultiThreadSeq
(
s_stb_s_tb_d_ts_a_tag_m_col_list
))
tdSql
.
query
(
f
"show tables;"
)
tdSql
.
checkRows
(
1
)
...
...
@@ -1130,7 +1128,6 @@ class TDTestCase:
input_sql
,
stb_name
=
self
.
genFullTypeSql
()
self
.
resCmp
(
input_sql
,
stb_name
)
s_stb_d_tb_d_ts_a_col_m_tag_list
=
self
.
genSqlList
(
stb_name
=
stb_name
)[
11
]
print
(
s_stb_d_tb_d_ts_a_col_m_tag_list
)
self
.
multiThreadRun
(
self
.
genMultiThreadSeq
(
s_stb_d_tb_d_ts_a_col_m_tag_list
))
tdSql
.
query
(
f
"show tables;"
)
tdSql
.
checkRows
(
6
)
...
...
@@ -1161,51 +1158,38 @@ class TDTestCase:
self
.
nowTsCheckCase
()
self
.
dateFormatTsCheckCase
()
self
.
illegalTsCheckCase
()
# ! confirm double
self
.
tagValueLengthCheckCase
()
# ! bug
self
.
colValueLengthCheckCase
()
self
.
tagColIllegalValueCheckCase
()
# ! 重复ID未合并
self
.
duplicateIdTagColInsertCheckCase
()
self
.
noIdStbExistCheckCase
()
self
.
duplicateInsertExistCheckCase
()
self
.
tagColBinaryNcharLengthCheckCase
()
# ! 结果未校验
self
.
tagColAddDupIDCheckCase
()
self
.
tagColAddCheckCase
()
self
.
tagMd5Check
()
# ! rollback bug
self
.
tagColBinaryMaxLengthCheckCase
()
self
.
tagColNcharMaxLengthCheckCase
()
self
.
batchInsertCheckCase
()
self
.
multiInsertCheckCase
(
5000
)
# ! bug
self
.
multiInsertCheckCase
(
10000
)
self
.
batchErrorInsertCheckCase
()
# MultiThreads
self
.
stbInsertMultiThreadCheckCase
()
self
.
sStbStbDdataInsertMultiThreadCheckCase
()
self
.
sStbStbDdataAtcInsertMultiThreadCheckCase
()
self
.
sStbStbDdataMtcInsertMultiThreadCheckCase
()
self
.
sStbDtbDdataInsertMultiThreadCheckCase
()
# ! concurrency conflict
#
#
! concurrency conflict
# self.sStbDtbDdataAcMtInsertMultiThreadCheckCase()
# self.sStbDtbDdataAtMcInsertMultiThreadCheckCase()
# ! concurrency conflict
self
.
sStbStbDdataDtsInsertMultiThreadCheckCase
()
self
.
sStbStbDdataDtsAcMtInsertMultiThreadCheckCase
()
self
.
sStbStbDdataDtsAtMcInsertMultiThreadCheckCase
()
# # ! concurrency conflict
# self.sStbStbDdataDtsAcMtInsertMultiThreadCheckCase()
# self.sStbStbDdataDtsAtMcInsertMultiThreadCheckCase()
self
.
sStbDtbDdataDtsInsertMultiThreadCheckCase
()
# ! concurrency conflict
...
...
@@ -1216,8 +1200,9 @@ class TDTestCase:
def
run
(
self
):
print
(
"running {}"
.
format
(
__file__
))
self
.
createDb
()
# self.runAll()
self
.
sStbDtbDdataDtsAcMtInsertMultiThreadCheckCase
()
self
.
runAll
()
# ! bug leave
# self.tagColNcharMaxLengthCheckCase()
# self.test()
def
stop
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录