Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1627a536
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看板
提交
1627a536
编写于
6月 27, 2022
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case
上级
900bb68c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
77 addition
and
17 deletion
+77
-17
tests/pytest/util/constant.py
tests/pytest/util/constant.py
+44
-3
tests/system-test/1-insert/time_range_wise.py
tests/system-test/1-insert/time_range_wise.py
+33
-14
未找到文件。
tests/pytest/util/constant.py
浏览文件 @
1627a536
...
...
@@ -30,6 +30,47 @@ TAOS_PRECISION = ["ms", "us", "ns"]
PRECISION_DEFAULT
=
"ms"
PRECISION
=
PRECISION_DEFAULT
TAOS_KEYWORDS
=
[
"ABORT"
,
"CREATE"
,
"IGNORE"
,
"NULL"
,
"STAR"
,
"ACCOUNT"
,
"CTIME"
,
"IMMEDIATE"
,
"OF"
,
"STATE"
,
"ACCOUNTS"
,
"DATABASE"
,
"IMPORT"
,
"OFFSET"
,
"STATEMENT"
,
"ADD"
,
"DATABASES"
,
"IN"
,
"OR"
,
"STATE_WINDOW"
,
"AFTER"
,
"DAYS"
,
"INITIALLY"
,
"ORDER"
,
"STORAGE"
,
"ALL"
,
"DBS"
,
"INSERT"
,
"PARTITIONS"
,
"STREAM"
,
"ALTER"
,
"DEFERRED"
,
"INSTEAD"
,
"PASS"
,
"STREAMS"
,
"AND"
,
"DELIMITERS"
,
"INT"
,
"PLUS"
,
"STRING"
,
"AS"
,
"DESC"
,
"INTEGER"
,
"PPS"
,
"SYNCDB"
,
"ASC"
,
"DESCRIBE"
,
"INTERVAL"
,
"PRECISION"
,
"TABLE"
,
"ATTACH"
,
"DETACH"
,
"INTO"
,
"PREV"
,
"TABLES"
,
"BEFORE"
,
"DISTINCT"
,
"IS"
,
"PRIVILEGE"
,
"TAG"
,
"BEGIN"
,
"DIVIDE"
,
"ISNULL"
,
"QTIME"
,
"TAGS"
,
"BETWEEN"
,
"DNODE"
,
"JOIN"
,
"QUERIES"
,
"TBNAME"
,
"BIGINT"
,
"DNODES"
,
"KEEP"
,
"QUERY"
,
"TIMES"
,
"BINARY"
,
"DOT"
,
"KEY"
,
"QUORUM"
,
"TIMESTAMP"
,
"BITAND"
,
"DOUBLE"
,
"KILL"
,
"RAISE"
,
"TINYINT"
,
"BITNOT"
,
"DROP"
,
"LE"
,
"REM"
,
"TOPIC"
,
"BITOR"
,
"EACH"
,
"LIKE"
,
"REPLACE"
,
"TOPICS"
,
"BLOCKS"
,
"END"
,
"LIMIT"
,
"REPLICA"
,
"TRIGGER"
,
"BOOL"
,
"EQ"
,
"LINEAR"
,
"RESET"
,
"TSERIES"
,
"BY"
,
"EXISTS"
,
"LOCAL"
,
"RESTRICT"
,
"UMINUS"
,
"CACHE"
,
"EXPLAIN"
,
"LP"
,
"ROW"
,
"UNION"
,
"CACHELAST"
,
"FAIL"
,
"LSHIFT"
,
"RP"
,
"UNSIGNED"
,
"CASCADE"
,
"FILE"
,
"LT"
,
"RSHIFT"
,
"UPDATE"
,
"CHANGE"
,
"FILL"
,
"MATCH"
,
"SCORES"
,
"UPLUS"
,
"CLUSTER"
,
"FLOAT"
,
"MAXROWS"
,
"SELECT"
,
"USE"
,
"COLON"
,
"FOR"
,
"MINROWS"
,
"SEMI"
,
"USER"
,
"COLUMN"
,
"FROM"
,
"MINUS"
,
"SESSION"
,
"USERS"
,
"COMMA"
,
"FSYNC"
,
"MNODES"
,
"SET"
,
"USING"
,
"COMP"
,
"GE"
,
"MODIFY"
,
"SHOW"
,
"VALUES"
,
"COMPACT"
,
"GLOB"
,
"MODULES"
,
"SLASH"
,
"VARIABLE"
,
"CONCAT"
,
"GRANTS"
,
"NCHAR"
,
"SLIDING"
,
"VARIABLES"
,
"CONFLICT"
,
"GROUP"
,
"NE"
,
"SLIMIT"
,
"VGROUPS"
,
"CONNECTION"
,
"GT"
,
"NONE"
,
"SMALLINT"
,
"VIEW"
,
"CONNECTIONS"
,
"HAVING"
,
"NOT"
,
"SOFFSET"
,
"VNODES"
,
"CONNS"
,
"ID"
,
"NOTNULL"
,
"STABLE"
,
"WAL"
,
"COPY"
,
"IF"
,
"NOW"
,
"STABLES"
,
"WHERE"
,
]
# basic data type boundary
TINYINT_MAX
=
127
TINYINT_MIN
=
-
128
...
...
@@ -41,7 +82,7 @@ SMALLINT_MAX = 32767
SMALLINT_MIN
=
-
32768
SMALLINT_UN_MAX
=
65535
MALLINT_UN_MIN
=
0
SMALLINT_UN_MIN
=
0
INT_MAX
=
2147483647
INT_MIN
=
-
2147483648
...
...
@@ -63,8 +104,8 @@ DOUBLE_MIN = -1.7E+308
# schema boundary
BINARY_LENGTH_MAX
=
16374
NCAHR_LENGTH_MAX
_
=
4093
DBNAME_LENGTH_MAX
_
=
64
NCAHR_LENGTH_MAX
=
4093
DBNAME_LENGTH_MAX
=
64
STBNAME_LENGTH_MAX
=
192
STBNAME_LENGTH_MIN
=
1
...
...
tests/system-test/1-insert/time_range_wise.py
浏览文件 @
1627a536
...
...
@@ -17,10 +17,10 @@ TINT_COL = "c_tint"
FLOAT_COL
=
"c_float"
DOUBLE_COL
=
"c_double"
BOOL_COL
=
"c_bool"
TINT_UN_COL
=
"c_
tint_un
"
SINT_UN_COL
=
"c_
sint_un
"
BINT_UN_COL
=
"c_
bint_un
"
INT_UN_COL
=
"c_
int_un
"
TINT_UN_COL
=
"c_
utint
"
SINT_UN_COL
=
"c_
usint
"
BINT_UN_COL
=
"c_
ubint
"
INT_UN_COL
=
"c_
uint
"
BINARY_COL
=
"c_binary"
NCHAR_COL
=
"c_nchar"
TS_COL
=
"c_ts"
...
...
@@ -100,6 +100,7 @@ class SMAschema:
show_msg
:
str
=
"INDEXES"
show_oper
:
str
=
"FROM"
dbname
:
str
=
None
rollup_db
:
bool
=
False
def
__post_init__
(
self
):
if
isinstance
(
self
.
other
,
dict
):
...
...
@@ -157,6 +158,11 @@ class SMAschema:
self
.
show_oper
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"rollup_db"
and
isinstance
(
v
,
bool
)
and
not
self
.
rollup_db
:
self
.
rollup_db
=
v
del
self
.
other
[
k
]
# from ...pytest.util.sql import *
# from ...pytest.util.constant import *
...
...
@@ -166,7 +172,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
Fals
e
)
tdSql
.
init
(
conn
.
cursor
(),
Tru
e
)
self
.
precision
=
"ms"
self
.
sma_count
=
0
self
.
sma_created_index
=
[]
...
...
@@ -319,6 +325,10 @@ class TDTestCase:
def
__sma_create_check
(
self
,
sma
:
SMAschema
):
if
self
.
updatecfgDict
[
"querySmaOptimize"
]
==
0
:
return
False
# # TODO: if database is a rollup-db, can not create sma index
# tdSql.query("select database()")
# if sma.rollup_db :
# return False
tdSql
.
query
(
"show stables"
)
if
not
sma
.
tbname
:
return
False
...
...
@@ -332,7 +342,7 @@ class TDTestCase:
return
False
if
not
sma
.
index_flag
or
not
isinstance
(
sma
.
index_flag
,
str
)
or
sma
.
index_flag
.
upper
()
!=
"SMA INDEX"
:
return
False
if
not
sma
.
index_name
or
not
isinstance
(
sma
.
index_name
,
str
):
if
not
sma
.
index_name
or
not
isinstance
(
sma
.
index_name
,
str
)
or
sma
.
index_name
.
upper
()
in
TAOS_KEYWORDS
:
return
False
if
not
sma
.
operator
or
not
isinstance
(
sma
.
operator
,
str
)
or
sma
.
operator
.
upper
()
!=
"ON"
:
return
False
...
...
@@ -430,7 +440,6 @@ class TDTestCase:
cur_sqls
=
[]
# err_set
# # case 1: required fields check
### 1.1 create
err_sqls
.
append
(
SMAschema
(
creation
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_name
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_flag
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
...
...
@@ -439,6 +448,16 @@ class TDTestCase:
err_sqls
.
append
(
SMAschema
(
func
=
(
""
,),
tbname
=
STBNAME
)
)
err_sqls
.
append
(
SMAschema
(
interval
=
(
""
),
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
# # case 2: err fields
err_sqls
.
append
(
SMAschema
(
creation
=
"show"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
creation
=
"alter"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
creation
=
"select"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_flag
=
"SMA INDEXES"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_flag
=
"SMA INDEX ,"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_name
=
"tbname"
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
# current_set
cur_sqls
.
append
(
SMAschema
(
max_delay
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
...
...
@@ -474,8 +493,8 @@ class TDTestCase:
err_sqls
,
cur_sqls
=
self
.
__drop_sma_sql
for
err_sql
in
err_sqls
:
self
.
sma_drop_check
(
err_sql
)
for
cur_sql
in
cur_sqls
:
self
.
sma_drop_check
(
cur_sql
)
#
for cur_sql in cur_sqls:
#
self.sma_drop_check(cur_sql)
def
all_test
(
self
):
self
.
test_create_sma
()
...
...
@@ -586,14 +605,14 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step1:create table in normal database"
)
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
#
self.__insert_data()
self
.
all_test
()
# drop databases, create same name db、stb and sma index
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
#
tdSql.prepare()
#
self.__create_tb()
#
self.__insert_data()
#
self.all_test()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录