Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
ca2c7b0d
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ca2c7b0d
编写于
2月 20, 2021
作者:
L
liuyq-617
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-2742]add test case for unsigned
上级
206163d5
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
2652 addition
and
2 deletion
+2652
-2
tests/pytest/alter/alter_stable.py
tests/pytest/alter/alter_stable.py
+4
-0
tests/pytest/alter/alter_table.py
tests/pytest/alter/alter_table.py
+4
-0
tests/pytest/alter/alter_table_crash.py
tests/pytest/alter/alter_table_crash.py
+8
-0
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+4
-0
tests/pytest/insert/unsigenedBigint.py
tests/pytest/insert/unsigenedBigint.py
+108
-0
tests/pytest/insert/unsigenedTinyint.py
tests/pytest/insert/unsigenedTinyint.py
+1
-1
tests/pytest/insert/unsignedSmallint.py
tests/pytest/insert/unsignedSmallint.py
+108
-0
tests/pytest/pytest_4.sh
tests/pytest/pytest_4.sh
+6
-1
tests/pytest/tag_lite/unsignedBigint.py
tests/pytest/tag_lite/unsignedBigint.py
+602
-0
tests/pytest/tag_lite/unsignedInt.py
tests/pytest/tag_lite/unsignedInt.py
+602
-0
tests/pytest/tag_lite/unsignedSmallint.py
tests/pytest/tag_lite/unsignedSmallint.py
+603
-0
tests/pytest/tag_lite/unsignedTinyint.py
tests/pytest/tag_lite/unsignedTinyint.py
+602
-0
未找到文件。
tests/pytest/alter/alter_stable.py
浏览文件 @
ca2c7b0d
...
@@ -19,6 +19,10 @@ class TDTestCase:
...
@@ -19,6 +19,10 @@ class TDTestCase:
"double"
,
"double"
,
"smallint"
,
"smallint"
,
"tinyint"
,
"tinyint"
,
"int unsigned"
,
"bigint unsigned"
,
"smallint unsigned"
,
"tinyint unsigned"
,
"binary(10)"
,
"binary(10)"
,
"nchar(10)"
,
"nchar(10)"
,
"timestamp"
]
"timestamp"
]
...
...
tests/pytest/alter/alter_table.py
浏览文件 @
ca2c7b0d
...
@@ -19,6 +19,10 @@ class TDTestCase:
...
@@ -19,6 +19,10 @@ class TDTestCase:
"double"
,
"double"
,
"smallint"
,
"smallint"
,
"tinyint"
,
"tinyint"
,
"int unsigned"
,
"bigint unsigned"
,
"smallint unsigned"
,
"tinyint unsigned"
,
"binary(10)"
,
"binary(10)"
,
"nchar(10)"
,
"nchar(10)"
,
"timestamp"
]
"timestamp"
]
...
...
tests/pytest/alter/alter_table_crash.py
浏览文件 @
ca2c7b0d
...
@@ -66,6 +66,14 @@ class TDTestCase:
...
@@ -66,6 +66,14 @@ class TDTestCase:
"alter table dt add column tbcol8 nchar(20)"
)
"alter table dt add column tbcol8 nchar(20)"
)
tdSql
.
execute
(
tdSql
.
execute
(
"alter table dt add column tbcol9 binary(20)"
)
"alter table dt add column tbcol9 binary(20)"
)
tdSql
.
execute
(
"alter table dt add column tbcol10 tinyint unsigned"
)
tdSql
.
execute
(
"alter table dt add column tbcol11 int unsigned"
)
tdSql
.
execute
(
"alter table dt add column tbcol12 smallint unsigned"
)
tdSql
.
execute
(
"alter table dt add column tbcol13 bigint unsigned"
)
# restart taosd
# restart taosd
tdDnodes
.
forcestop
(
1
)
tdDnodes
.
forcestop
(
1
)
...
...
tests/pytest/fulltest.sh
浏览文件 @
ca2c7b0d
...
@@ -3,12 +3,16 @@ ulimit -c unlimited
...
@@ -3,12 +3,16 @@ ulimit -c unlimited
python3 ./test.py
-f
insert/basic.py
python3 ./test.py
-f
insert/basic.py
python3 ./test.py
-f
insert/int.py
python3 ./test.py
-f
insert/int.py
python3 ./test.py
-f
insert/unsignedInt.py
python3 ./test.py
-f
insert/float.py
python3 ./test.py
-f
insert/float.py
python3 ./test.py
-f
insert/bigint.py
python3 ./test.py
-f
insert/bigint.py
python3 ./test.py
-f
insert/unsignedBigint.py
python3 ./test.py
-f
insert/bool.py
python3 ./test.py
-f
insert/bool.py
python3 ./test.py
-f
insert/double.py
python3 ./test.py
-f
insert/double.py
python3 ./test.py
-f
insert/smallint.py
python3 ./test.py
-f
insert/smallint.py
python3 ./test.py
-f
insert/unsignedSmallint.py
python3 ./test.py
-f
insert/tinyint.py
python3 ./test.py
-f
insert/tinyint.py
python3 ./test.py
-f
insert/unsignedTinyint.py
python3 ./test.py
-f
insert/date.py
python3 ./test.py
-f
insert/date.py
python3 ./test.py
-f
insert/binary.py
python3 ./test.py
-f
insert/binary.py
python3 ./test.py
-f
insert/nchar.py
python3 ./test.py
-f
insert/nchar.py
...
...
tests/pytest/insert/unsigenedBigint.py
0 → 100644
浏览文件 @
ca2c7b0d
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
info
(
'=============== step1'
)
tdLog
.
info
(
'create table tb (ts timestamp, speed bigint unsigned)'
)
tdSql
.
execute
(
'create table tb (ts timestamp, speed bigint unsigned)'
)
tdLog
.
info
(
"insert into tb values (now, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now, NULL)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(1)'
)
tdSql
.
checkRows
(
1
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step2'
)
tdLog
.
info
(
"insert into tb values (now+1m, -1) -x step2"
)
tdSql
.
error
(
"insert into tb values (now+1m, -1) "
)
tdLog
.
info
(
"insert into tb values (now+1m, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now+1m, NULL)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(2)'
)
tdSql
.
checkRows
(
2
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step3'
)
tdLog
.
info
(
"insert into tb values (now+2m, 18446744073709551614)"
)
tdSql
.
execute
(
"insert into tb values (now+2m, 18446744073709551614)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(3)'
)
tdSql
.
checkRows
(
3
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 18446744073709551614)'
)
tdSql
.
checkData
(
0
,
1
,
18446744073709551614
)
tdLog
.
info
(
'=============== step4'
)
tdLog
.
info
(
"insert into tb values (now+3m, 18446744073709551615) -x step4"
)
tdSql
.
error
(
"insert into tb values (now+3m, 18446744073709551615)"
)
tdLog
.
info
(
"insert into tb values (now+3m, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now+3m, NULL)"
)
tdLog
.
info
(
'select * from tb'
)
tdSql
.
query
(
'select * from tb'
)
tdLog
.
info
(
'tdSql.checkRow(4)'
)
tdSql
.
checkRows
(
4
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step5'
)
tdLog
.
info
(
"insert into tb values (now+4m, a2)"
)
tdSql
.
error
(
"insert into tb values (now+4m, a2)"
)
tdLog
.
info
(
"insert into tb values (now-4m, -1)"
)
tdSql
.
error
(
"insert into tb values (now-4m, -1)"
)
tdLog
.
info
(
"insert into tb values (now+4m, 0)"
)
tdSql
.
execute
(
"insert into tb values (now+4m, 0)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(5)'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 0)'
)
tdSql
.
checkData
(
0
,
1
,
0
)
tdLog
.
info
(
'=============== step6'
)
tdLog
.
info
(
"insert into tb values (now+5m, 2a)"
)
tdSql
.
error
(
"insert into tb values (now+5m, 2a)"
)
tdLog
.
info
(
"insert into tb values (now+5m, 2)"
)
tdSql
.
execute
(
"insert into tb values (now+5m, 2)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(6)'
)
tdSql
.
checkRows
(
6
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 2)'
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdLog
.
info
(
'=============== step7'
)
tdLog
.
info
(
"insert into tb values (now+6m, 2a'1)"
)
tdSql
.
error
(
"insert into tb values (now+6m, 2a'1)"
)
tdLog
.
info
(
"insert into tb values (now+6m, 2)"
)
tdSql
.
execute
(
"insert into tb values (now+6m, 2)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(7)'
)
tdSql
.
checkRows
(
7
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 2)'
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdLog
.
info
(
'drop database db'
)
tdSql
.
execute
(
'drop database db'
)
tdLog
.
info
(
'show databases'
)
tdSql
.
query
(
'show databases'
)
tdLog
.
info
(
'tdSql.checkRow(0)'
)
tdSql
.
checkRows
(
0
)
# convert end
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/insert/unsigenedTinyint.py
浏览文件 @
ca2c7b0d
...
@@ -95,7 +95,7 @@ class TDTestCase:
...
@@ -95,7 +95,7 @@ class TDTestCase:
tdSql
.
query
(
'show databases'
)
tdSql
.
query
(
'show databases'
)
tdLog
.
info
(
'tdSql.checkRow(0)'
)
tdLog
.
info
(
'tdSql.checkRow(0)'
)
tdSql
.
checkRows
(
0
)
tdSql
.
checkRows
(
0
)
# convert end
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
tests/pytest/insert/unsignedSmallint.py
0 → 100644
浏览文件 @
ca2c7b0d
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
info
(
'=============== step1'
)
tdLog
.
info
(
'create table tb (ts timestamp, speed smallint unsigned)'
)
tdSql
.
execute
(
'create table tb (ts timestamp, speed smallint unsigned)'
)
tdLog
.
info
(
"insert into tb values (now, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now, NULL)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(1)'
)
tdSql
.
checkRows
(
1
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step2'
)
tdLog
.
info
(
"insert into tb values (now+1m, -1) -x step2"
)
tdSql
.
error
(
"insert into tb values (now+1m, -1) "
)
tdLog
.
info
(
"insert into tb values (now+1m, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now+1m, NULL)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(2)'
)
tdSql
.
checkRows
(
2
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step3'
)
tdLog
.
info
(
"insert into tb values (now+2m, 65534)"
)
tdSql
.
execute
(
"insert into tb values (now+2m, 65534)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(3)'
)
tdSql
.
checkRows
(
3
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 65534)'
)
tdSql
.
checkData
(
0
,
1
,
65534
)
tdLog
.
info
(
'=============== step4'
)
tdLog
.
info
(
"insert into tb values (now+3m, 65535) -x step4"
)
tdSql
.
error
(
"insert into tb values (now+3m, 65535)"
)
tdLog
.
info
(
"insert into tb values (now+3m, NULL)"
)
tdSql
.
execute
(
"insert into tb values (now+3m, NULL)"
)
tdLog
.
info
(
'select * from tb'
)
tdSql
.
query
(
'select * from tb'
)
tdLog
.
info
(
'tdSql.checkRow(4)'
)
tdSql
.
checkRows
(
4
)
tdLog
.
info
(
'tdSql.checkData(0, 1, null)'
)
tdSql
.
checkData
(
0
,
1
,
None
)
tdLog
.
info
(
'=============== step5'
)
tdLog
.
info
(
"insert into tb values (now+4m, a2)"
)
tdSql
.
error
(
"insert into tb values (now+4m, a2)"
)
tdLog
.
info
(
"insert into tb values (now-4m, -1)"
)
tdSql
.
error
(
"insert into tb values (now-4m, -1)"
)
tdLog
.
info
(
"insert into tb values (now+4m, 0)"
)
tdSql
.
execute
(
"insert into tb values (now+4m, 0)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(5)'
)
tdSql
.
checkRows
(
5
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 0)'
)
tdSql
.
checkData
(
0
,
1
,
0
)
tdLog
.
info
(
'=============== step6'
)
tdLog
.
info
(
"insert into tb values (now+5m, 2a)"
)
tdSql
.
error
(
"insert into tb values (now+5m, 2a)"
)
tdLog
.
info
(
"insert into tb values (now+5m, 2)"
)
tdSql
.
execute
(
"insert into tb values (now+5m, 2)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(6)'
)
tdSql
.
checkRows
(
6
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 2)'
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdLog
.
info
(
'=============== step7'
)
tdLog
.
info
(
"insert into tb values (now+6m, 2a'1)"
)
tdSql
.
error
(
"insert into tb values (now+6m, 2a'1)"
)
tdLog
.
info
(
"insert into tb values (now+6m, 2)"
)
tdSql
.
execute
(
"insert into tb values (now+6m, 2)"
)
tdLog
.
info
(
'select * from tb order by ts desc'
)
tdSql
.
query
(
'select * from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(7)'
)
tdSql
.
checkRows
(
7
)
tdLog
.
info
(
'tdSql.checkData(0, 1, 2)'
)
tdSql
.
checkData
(
0
,
1
,
2
)
tdLog
.
info
(
'drop database db'
)
tdSql
.
execute
(
'drop database db'
)
tdLog
.
info
(
'show databases'
)
tdSql
.
query
(
'show databases'
)
tdLog
.
info
(
'tdSql.checkRow(0)'
)
tdSql
.
checkRows
(
0
)
# convert end
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/pytest_4.sh
浏览文件 @
ca2c7b0d
...
@@ -30,4 +30,9 @@ python3 ./test.py -f query/last_cache.py
...
@@ -30,4 +30,9 @@ python3 ./test.py -f query/last_cache.py
python3 ./test.py
-f
query/last_row_cache.py
python3 ./test.py
-f
query/last_row_cache.py
python3 ./test.py
-f
account/account_create.py
python3 ./test.py
-f
account/account_create.py
python3 ./test.py
-f
alter/alter_table.py
python3 ./test.py
-f
alter/alter_table.py
python3 ./test.py
-f
query/queryGroupbySort.py
python3 ./test.py
-f
query/queryGroupbySort.py
\ No newline at end of file
python3 ./test.py
-f
insert/unsignedInt.py
python3 ./test.py
-f
insert/unsignedBigint.py
python3 ./test.py
-f
insert/unsignedSmallint.py
python3 ./test.py
-f
insert/unsignedTinyint.py
\ No newline at end of file
tests/pytest/tag_lite/unsignedBigint.py
0 → 100644
浏览文件 @
ca2c7b0d
此差异已折叠。
点击以展开。
tests/pytest/tag_lite/unsignedInt.py
0 → 100644
浏览文件 @
ca2c7b0d
此差异已折叠。
点击以展开。
tests/pytest/tag_lite/unsignedSmallint.py
0 → 100644
浏览文件 @
ca2c7b0d
此差异已折叠。
点击以展开。
tests/pytest/tag_lite/unsignedTinyint.py
0 → 100644
浏览文件 @
ca2c7b0d
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录