Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
00c97545
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
未验证
提交
00c97545
编写于
11月 24, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18399 from taosdata/test/TD-20592_1
Test/td 20592 1
上级
d31be656
79f85dc1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
160 addition
and
19 deletion
+160
-19
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+5
-0
tests/system-test/2-query/insert_select.py
tests/system-test/2-query/insert_select.py
+108
-0
tests/system-test/2-query/select_index.py
tests/system-test/2-query/select_index.py
+47
-19
未找到文件。
tests/parallel_test/cases.task
浏览文件 @
00c97545
...
...
@@ -1007,6 +1007,11 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/sml.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/interp.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/case_when.py -Q 4
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py
,,y,system-test,./pytest.sh python3 ./test.py -f 2-query/insert_select.py -R
,,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 4
#develop test
,,,develop-test,python3 ./test.py -f 5-taos-tools/taosbenchmark/auto_create_table_json.py
...
...
tests/system-test/2-query/insert_select.py
0 → 100644
浏览文件 @
00c97545
###################################################################
# 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
subprocess
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
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_select"
def
dropandcreateDB_random
(
self
,
database
,
n
):
ts
=
1604298064000
tdSql
.
execute
(
'''drop database if exists %s ;'''
%
database
)
tdSql
.
execute
(
'''create database %s keep 36500 ;'''
%
(
database
))
tdSql
.
execute
(
'''use %s;'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb (ts timestamp , i tinyint );'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb1 (speed timestamp , c1 int , c2 int , c3 int );'''
%
database
)
sql_before
=
"insert into %s.tb1 values"
%
database
sql_value
=
''
for
i
in
range
(
n
):
sql_value
=
sql_value
+
"(%d, %d, %d, %d)"
%
(
ts
+
i
,
i
,
i
,
i
)
sql
=
sql_before
+
sql_value
tdSql
.
execute
(
sql
)
tdSql
.
query
(
"select count(*) from %s.tb1;"
%
database
)
sql_result
=
tdSql
.
getData
(
0
,
0
)
tdLog
.
info
(
"result: %s"
%
(
sql_result
))
tdSql
.
query
(
"reset query cache;"
)
tdSql
.
query
(
"insert into %s.tb1 select * from %s.tb1;"
%
(
database
,
database
))
tdSql
.
query
(
"select count(*) from %s.tb1;"
%
database
)
sql_result
=
tdSql
.
getData
(
0
,
0
)
tdLog
.
info
(
"result: %s"
%
(
sql_result
))
def
users_bug_TD_20592
(
self
,
database
):
tdSql
.
execute
(
'''drop database if exists %s ;'''
%
database
)
tdSql
.
execute
(
'''create database %s keep 36500 ;'''
%
(
database
))
tdSql
.
execute
(
'''use %s;'''
%
database
)
tdSql
.
execute
(
'''create table %s.sav_stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 int);'''
%
database
)
tdSql
.
execute
(
'''create table %s.tb1 using %s.sav_stb tags( 9 , 0);'''
%
(
database
,
database
))
tdSql
.
error
(
'''insert into %s.tb1 (c8, c9) values(now, 1);'''
%
(
database
))
def
run
(
self
):
startTime
=
time
.
time
()
os
.
system
(
"rm -rf %s/%s.sql"
%
(
self
.
testcasePath
,
self
.
testcaseFilename
))
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db
,
random
.
randint
(
10000
,
30000
))
#taos -f sql
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!"
)
self
.
users_bug_TD_20592
(
"%s"
%
self
.
db
)
#taos -f sql
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!"
)
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
())
tests/system-test/2-query/select_index.py
浏览文件 @
00c97545
...
...
@@ -26,7 +26,7 @@ from util.dnodes import *
class
TDTestCase
:
updatecfgDict
=
{
'maxSQLLength'
:
1048576
,
'debugFlag'
:
143
,
"querySmaOptimize"
:
1
}
def
init
(
self
,
conn
,
logSql
):
def
init
(
self
,
conn
,
logSql
,
replicaVar
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
...
...
@@ -109,7 +109,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
1
,
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
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -118,7 +118,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
2147483647
,
max
=
2147483647
,
step
=
1
)
,
%
(
database
,
ts
+
i
*
1000
+
1
,
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
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -128,7 +128,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
2
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -137,7 +137,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 1, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
2
,
fake
.
random_int
(
min
=
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -147,7 +147,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
3
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -157,7 +157,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
+
1
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
4
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -167,7 +167,7 @@ class TDTestCase:
q_binary1 , q_nchar1 , q_binary2 , q_nchar2 , q_binary3 , q_nchar3 , q_binary4 , q_nchar4 , q_binary5 , q_nchar5 , q_binary6 , q_nchar6 , q_binary7 , q_nchar7, q_binary8 , q_nchar8)
\
values(%d, %d, %d, %d, %d, %f, %f, 0, 'binary.%s', 'nchar.%s', %d, 'binary1.%s', 'nchar1.%s', 'binary2.%s', 'nchar2.%s', 'binary3.%s', 'nchar3.%s',
\
'binary4.%s', 'nchar4.%s', 'binary5.%s', 'nchar5.%s', 'binary6.%s', 'nchar6.%s', 'binary7.%s', 'nchar7.%s', 'binary8.%s', 'nchar8.%s') ;'''
%
(
database
,
ts
+
i
*
1000
+
10
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
%
(
database
,
ts
+
i
*
1000
+
5
,
fake
.
random_int
(
min
=-
0
,
max
=
2147483647
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
9223372036854775807
,
step
=
1
),
fake
.
random_int
(
min
=-
0
,
max
=
32767
,
step
=
1
)
,
fake
.
random_int
(
min
=-
0
,
max
=
127
,
step
=
1
)
,
fake
.
pyfloat
()
,
fake
.
pyfloat
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
ts
+
i
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
fake
.
pystr
()
,
...
...
@@ -182,7 +182,7 @@ class TDTestCase:
fake
=
Faker
(
'zh_CN'
)
fake_data
=
fake
.
random_int
(
min
=
1
,
max
=
20
,
step
=
1
)
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
func
)
tdSql
.
execute
(
" create sma index
sma_index_name1 on stable_1 function(%s(%s)) interval(%dm); "
%
(
func
,
column
,
fake_data
))
tdSql
.
execute
(
" create sma index
%s.sma_index_name1 on %s.stable_1 function(%s(%s)) interval(%dm); "
%
(
database
,
database
,
func
,
column
,
fake_data
))
sql
=
" select %s(%s) from %s.stable_1 interval(1m) "
%
(
func
,
column
,
database
)
tdLog
.
info
(
sql
)
tdSql
.
query
(
sql
)
...
...
@@ -205,7 +205,7 @@ class TDTestCase:
tdLog
.
info
(
"
\n
=============drop index ====================
\n
"
)
tdSql
.
execute
(
" drop index
sma_index_name1;"
)
tdSql
.
execute
(
" drop index
%s.sma_index_name1;"
%
database
)
tdSql
.
query
(
sql
)
queryRows
=
len
(
tdSql
.
queryResult
)
...
...
@@ -214,7 +214,30 @@ class TDTestCase:
drop_index_value
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value
,
drop_index_value
)
def
constant_speical_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
sql_no_from
=
" select %s(%s) ; "
%
(
func
,
column
)
tdLog
.
info
(
sql_no_from
)
tdSql
.
query
(
sql_no_from
)
queryRows
=
len
(
tdSql
.
queryResult
)
for
i
in
range
(
queryRows
):
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_before_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
tdLog
.
info
(
"
\n
=============flush database ====================
\n
"
)
tdSql
.
execute
(
" flush database %s;"
%
database
)
tdSql
.
query
(
sql_no_from
)
queryRows
=
len
(
tdSql
.
queryResult
)
for
i
in
range
(
queryRows
):
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
def
constant_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -253,7 +276,7 @@ class TDTestCase:
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
#self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一
def
constant_table_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -292,7 +315,7 @@ class TDTestCase:
print
(
"row=%d, result=%s "
%
(
i
,
tdSql
.
queryResult
[
i
][
0
]))
flush_after_value_no_from
=
tdSql
.
queryResult
[
i
][
0
]
self
.
value_check
(
flush_before_value_no_from
,
flush_after_value_no_from
)
#self.value_check(flush_before_value_no_from,flush_after_value_no_from)#越界后值不唯一
def
constant_str_check
(
self
,
database
,
func
,
column
):
tdLog
.
info
(
"
\n
=============constant(%s)_check ====================
\n
"
%
column
)
...
...
@@ -338,7 +361,7 @@ class TDTestCase:
def
derivative_sql
(
self
,
database
):
fake
=
Faker
(
'zh_CN'
)
fake_data
=
fake
.
random_int
(
min
=
-
9223372036854775807
,
max
=
9223372036854775807
,
step
=
1
)
fake_data
=
fake
.
random_int
(
min
=
1
,
max
=
10000000000000
,
step
=
1
)
tdLog
.
info
(
"
\n
=============derivative sql ====================
\n
"
)
sql
=
" select derivative(%s,%ds,0) from %s.stable_1 "
%
(
'q_smallint'
,
fake_data
,
database
)
self
.
derivative_data_check
(
"%s"
%
self
.
db
,
"%s"
%
sql
)
...
...
@@ -493,11 +516,11 @@ class TDTestCase:
def
value_check
(
self
,
flush_before_value
,
flush_after_value
):
#
if flush_before_value==flush_after_value:
#
tdLog.info(f"checkEqual success, flush_before_value={flush_before_value},flush_after_value={flush_after_value}")
#
else :
#
tdLog.exit(f"checkEqual error, flush_before_value=={flush_before_value},flush_after_value={flush_after_value}")
pass
if
flush_before_value
==
flush_after_value
:
tdLog
.
info
(
f
"checkEqual success, flush_before_value=
{
flush_before_value
}
,flush_after_value=
{
flush_after_value
}
"
)
else
:
tdLog
.
exit
(
f
"checkEqual error, flush_before_value==
{
flush_before_value
}
,flush_after_value=
{
flush_after_value
}
"
)
#
pass
def
run
(
self
):
fake
=
Faker
(
'zh_CN'
)
...
...
@@ -511,6 +534,11 @@ class TDTestCase:
self
.
dropandcreateDB_random
(
"%s"
%
self
.
db
,
1
,
2
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'%d'
%
fake_data
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'%f'
%
fake_float
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'
\'
%s
\'
'
%
fake_str
)
self
.
constant_speical_check
(
"%s"
%
self
.
db
,
''
,
'NULL'
)
#TD-19818
self
.
func_index_check
(
"%s"
%
self
.
db
,
'max'
,
'q_int'
)
self
.
func_index_check
(
"%s"
%
self
.
db
,
'max'
,
'q_bigint'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录