Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f46f941c
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看板
提交
f46f941c
编写于
11月 21, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '3.0' of
https://github.com/taosdata/TDengine
into enh/row_optimize
上级
31f667f8
7f199091
变更
39
展开全部
显示空白变更内容
内联
并排
Showing
39 changed file
with
2065 addition
and
468 deletion
+2065
-468
cmake/taosws_CMakeLists.txt.in
cmake/taosws_CMakeLists.txt.in
+1
-1
docs/zh/05-get-started/index.md
docs/zh/05-get-started/index.md
+1
-1
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+0
-1
source/libs/executor/inc/tfill.h
source/libs/executor/inc/tfill.h
+2
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+122
-206
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+2
-2
tests/pytest/crash_gen.sh
tests/pytest/crash_gen.sh
+1
-1
tests/pytest/crash_gen/crash_gen_main.py
tests/pytest/crash_gen/crash_gen_main.py
+700
-21
tests/pytest/crash_gen/shared/db.py
tests/pytest/crash_gen/shared/db.py
+72
-7
tests/pytest/util/dnodes.py
tests/pytest/util/dnodes.py
+12
-3
tests/pytest/util/log.py
tests/pytest/util/log.py
+1
-1
tests/script/sh/checkAsan.sh
tests/script/sh/checkAsan.sh
+7
-1
tests/script/sh/exec.sh
tests/script/sh/exec.sh
+1
-0
tests/script/sh/sigint_stop_dnodes.sh
tests/script/sh/sigint_stop_dnodes.sh
+1
-1
tests/script/sh/stop_dnodes.sh
tests/script/sh/stop_dnodes.sh
+1
-1
tests/system-test/2-query/abs.py
tests/system-test/2-query/abs.py
+8
-14
tests/system-test/2-query/and_or_for_byte.py
tests/system-test/2-query/and_or_for_byte.py
+4
-4
tests/system-test/2-query/arccos.py
tests/system-test/2-query/arccos.py
+8
-17
tests/system-test/2-query/arcsin.py
tests/system-test/2-query/arcsin.py
+9
-17
tests/system-test/2-query/arctan.py
tests/system-test/2-query/arctan.py
+7
-17
tests/system-test/2-query/avg.py
tests/system-test/2-query/avg.py
+9
-15
tests/system-test/2-query/ceil.py
tests/system-test/2-query/ceil.py
+8
-13
tests/system-test/2-query/cos.py
tests/system-test/2-query/cos.py
+5
-21
tests/system-test/2-query/floor.py
tests/system-test/2-query/floor.py
+8
-13
tests/system-test/2-query/function_stateduration.py
tests/system-test/2-query/function_stateduration.py
+5
-5
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+950
-14
tests/system-test/2-query/last_row.py
tests/system-test/2-query/last_row.py
+4
-4
tests/system-test/2-query/log.py
tests/system-test/2-query/log.py
+4
-5
tests/system-test/2-query/pow.py
tests/system-test/2-query/pow.py
+4
-4
tests/system-test/2-query/round.py
tests/system-test/2-query/round.py
+9
-13
tests/system-test/2-query/sin.py
tests/system-test/2-query/sin.py
+4
-4
tests/system-test/2-query/sqrt.py
tests/system-test/2-query/sqrt.py
+4
-4
tests/system-test/2-query/statecount.py
tests/system-test/2-query/statecount.py
+5
-5
tests/system-test/2-query/tail.py
tests/system-test/2-query/tail.py
+8
-8
tests/system-test/2-query/tan.py
tests/system-test/2-query/tan.py
+4
-4
tests/system-test/2-query/txt.txt
tests/system-test/2-query/txt.txt
+40
-0
tests/system-test/2-query/unique.py
tests/system-test/2-query/unique.py
+6
-6
tests/system-test/pytest.sh
tests/system-test/pytest.sh
+27
-12
tests/system-test/test.py
tests/system-test/test.py
+1
-1
未找到文件。
cmake/taosws_CMakeLists.txt.in
浏览文件 @
f46f941c
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# taosws-rs
# taosws-rs
ExternalProject_Add(taosws-rs
ExternalProject_Add(taosws-rs
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git
GIT_TAG
9843872
GIT_TAG
f406d51
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs"
BINARY_DIR ""
BINARY_DIR ""
#BUILD_IN_SOURCE TRUE
#BUILD_IN_SOURCE TRUE
...
...
docs/zh/05-get-started/index.md
浏览文件 @
f46f941c
...
@@ -24,7 +24,7 @@ TDengine 知识地图中涵盖了 TDengine 的各种知识点,揭示了各概
...
@@ -24,7 +24,7 @@ TDengine 知识地图中涵盖了 TDengine 的各种知识点,揭示了各概
<figure>
<figure>
<center>
<center>
<a
href=
"/img/tdengine-map.svg"
target=
"_blank"
><img
src=
"/img/tdengine-map.svg"
width=
"80%"
/></a>
<a
href=
"
pathname://
/img/tdengine-map.svg"
target=
"_blank"
><img
src=
"/img/tdengine-map.svg"
width=
"80%"
/></a>
<figcaption>
图 1. TDengine 知识地图
</figcaption>
<figcaption>
图 1. TDengine 知识地图
</figcaption>
</center>
</center>
</figure>
</figure>
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
f46f941c
...
@@ -776,7 +776,6 @@ typedef struct STimeSliceOperatorInfo {
...
@@ -776,7 +776,6 @@ typedef struct STimeSliceOperatorInfo {
SArray
*
pPrevRow
;
// SArray<SGroupValue>
SArray
*
pPrevRow
;
// SArray<SGroupValue>
SArray
*
pNextRow
;
// SArray<SGroupValue>
SArray
*
pNextRow
;
// SArray<SGroupValue>
SArray
*
pLinearInfo
;
// SArray<SFillLinearInfo>
SArray
*
pLinearInfo
;
// SArray<SFillLinearInfo>
bool
fillLastPoint
;
bool
isPrevRowSet
;
bool
isPrevRowSet
;
bool
isNextRowSet
;
bool
isNextRowSet
;
int32_t
fillType
;
// fill type
int32_t
fillType
;
// fill type
...
...
source/libs/executor/inc/tfill.h
浏览文件 @
f46f941c
...
@@ -36,7 +36,8 @@ typedef struct SFillColInfo {
...
@@ -36,7 +36,8 @@ typedef struct SFillColInfo {
typedef
struct
SFillLinearInfo
{
typedef
struct
SFillLinearInfo
{
SPoint
start
;
SPoint
start
;
SPoint
end
;
SPoint
end
;
bool
hasNull
;
bool
isStartSet
;
bool
isEndSet
;
int16_t
type
;
int16_t
type
;
int32_t
bytes
;
int32_t
bytes
;
}
SFillLinearInfo
;
}
SFillLinearInfo
;
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
f46f941c
此差异已折叠。
点击以展开。
tests/parallel_test/cases.task
浏览文件 @
f46f941c
...
@@ -438,11 +438,11 @@
...
@@ -438,11 +438,11 @@
,,,system-test,python3 ./test.py -f 1-insert/database_pre_suf.py
,,,system-test,python3 ./test.py -f 1-insert/database_pre_suf.py
,,,system-test,python3 ./test.py -f 1-insert/InsertFuturets.py
,,,system-test,python3 ./test.py -f 1-insert/InsertFuturets.py
,,,system-test,python3 ./test.py -f 0-others/show.py
,,,system-test,python3 ./test.py -f 0-others/show.py
,,,system-test,python3 ./test.py -f 2-query/abs.py
,,,system-test,
./pytest.sh
python3 ./test.py -f 2-query/abs.py
,,,system-test,python3 ./test.py -f 2-query/abs.py -R
,,,system-test,python3 ./test.py -f 2-query/abs.py -R
,,,system-test,python3 ./test.py -f 2-query/and_or_for_byte.py
,,,system-test,python3 ./test.py -f 2-query/and_or_for_byte.py
,,,system-test,python3 ./test.py -f 2-query/and_or_for_byte.py -R
,,,system-test,python3 ./test.py -f 2-query/and_or_for_byte.py -R
,,,system-test,python3 ./test.py -f 2-query/apercentile.py
,,,system-test,
./pytest.sh
python3 ./test.py -f 2-query/apercentile.py
,,,system-test,python3 ./test.py -f 2-query/apercentile.py -R
,,,system-test,python3 ./test.py -f 2-query/apercentile.py -R
,,,system-test,python3 ./test.py -f 2-query/arccos.py
,,,system-test,python3 ./test.py -f 2-query/arccos.py
,,,system-test,python3 ./test.py -f 2-query/arccos.py -R
,,,system-test,python3 ./test.py -f 2-query/arccos.py -R
...
...
tests/pytest/crash_gen.sh
浏览文件 @
f46f941c
...
@@ -45,7 +45,7 @@ fi
...
@@ -45,7 +45,7 @@ fi
# Now getting ready to execute Python
# Now getting ready to execute Python
# The following is the default of our standard dev env (Ubuntu 20.04), modify/adjust at your own risk
# The following is the default of our standard dev env (Ubuntu 20.04), modify/adjust at your own risk
PYTHON_EXEC
=
python3
.8
PYTHON_EXEC
=
python3
# First we need to set up a path for Python to find our own TAOS modules, so that "import" can work.
# First we need to set up a path for Python to find our own TAOS modules, so that "import" can work.
# export PYTHONPATH=$(pwd)/../../src/connector/python:$(pwd)
# export PYTHONPATH=$(pwd)/../../src/connector/python:$(pwd)
...
...
tests/pytest/crash_gen/crash_gen_main.py
浏览文件 @
f46f941c
此差异已折叠。
点击以展开。
tests/pytest/crash_gen/shared/db.py
浏览文件 @
f46f941c
...
@@ -27,9 +27,12 @@ class DbConn:
...
@@ -27,9 +27,12 @@ class DbConn:
TYPE_REST
=
"rest-api"
TYPE_REST
=
"rest-api"
TYPE_INVALID
=
"invalid"
TYPE_INVALID
=
"invalid"
# class variables
# class variables
lastSqlFromThreads
:
dict
[
int
,
str
]
=
{}
# stored by thread id, obtained from threading.current_thread().ident%10000
lastSqlFromThreads
:
dict
[
int
,
str
]
=
{}
# stored by thread id, obtained from threading.current_thread().ident%10000
spendThreads
:
dict
[
int
,
float
]
=
{}
# stored by thread id, obtained from threading.current_thread().ident%10000
current_time
:
dict
[
int
,
float
]
=
{}
# save current time
@
classmethod
@
classmethod
def
saveSqlForCurrentThread
(
cls
,
sql
:
str
):
def
saveSqlForCurrentThread
(
cls
,
sql
:
str
):
'''
'''
...
@@ -37,16 +40,57 @@ class DbConn:
...
@@ -37,16 +40,57 @@ class DbConn:
run into a dead-lock situation, we can pick out the deadlocked thread, and use
run into a dead-lock situation, we can pick out the deadlocked thread, and use
that information to find what what SQL statement is stuck.
that information to find what what SQL statement is stuck.
'''
'''
th
=
threading
.
current_thread
()
th
=
threading
.
current_thread
()
shortTid
=
th
.
native_id
%
10000
#type: ignore
shortTid
=
th
.
native_id
%
10000
#type: ignore
cls
.
lastSqlFromThreads
[
shortTid
]
=
sql
# Save this for later
cls
.
lastSqlFromThreads
[
shortTid
]
=
sql
# Save this for later
cls
.
record_save_sql_time
()
@
classmethod
@
classmethod
def
fetchSqlForThread
(
cls
,
shortTid
:
int
)
->
str
:
def
fetchSqlForThread
(
cls
,
shortTid
:
int
)
->
str
:
print
(
"======================="
)
if
shortTid
not
in
cls
.
lastSqlFromThreads
:
if
shortTid
not
in
cls
.
lastSqlFromThreads
:
raise
CrashGenError
(
"No last-attempted-SQL found for thread id: {}"
.
format
(
shortTid
))
raise
CrashGenError
(
"No last-attempted-SQL found for thread id: {}"
.
format
(
shortTid
))
return
cls
.
lastSqlFromThreads
[
shortTid
]
return
cls
.
lastSqlFromThreads
[
shortTid
]
@
classmethod
def
get_save_sql_time
(
cls
,
shortTid
:
int
):
'''
Let us save the last SQL statement on a per-thread basis, so that when later we
run into a dead-lock situation, we can pick out the deadlocked thread, and use
that information to find what what SQL statement is stuck.
'''
return
cls
.
current_time
[
shortTid
]
@
classmethod
def
record_save_sql_time
(
cls
):
'''
Let us save the last SQL statement on a per-thread basis, so that when later we
run into a dead-lock situation, we can pick out the deadlocked thread, and use
that information to find what what SQL statement is stuck.
'''
th
=
threading
.
current_thread
()
shortTid
=
th
.
native_id
%
10000
#type: ignore
cls
.
current_time
[
shortTid
]
=
float
(
time
.
time
())
# Save this for later
@
classmethod
def
sql_exec_spend
(
cls
,
cost
:
float
):
'''
Let us save the last SQL statement on a per-thread basis, so that when later we
run into a dead-lock situation, we can pick out the deadlocked thread, and use
that information to find what what SQL statement is stuck.
'''
th
=
threading
.
current_thread
()
shortTid
=
th
.
native_id
%
10000
#type: ignore
cls
.
spendThreads
[
shortTid
]
=
cost
# Save this for later
@
classmethod
def
get_time_cost
(
cls
)
->
float
:
th
=
threading
.
current_thread
()
shortTid
=
th
.
native_id
%
10000
#type: ignore
return
cls
.
spendThreads
.
get
(
shortTid
)
@
classmethod
@
classmethod
def
create
(
cls
,
connType
,
dbTarget
):
def
create
(
cls
,
connType
,
dbTarget
):
if
connType
==
cls
.
TYPE_NATIVE
:
if
connType
==
cls
.
TYPE_NATIVE
:
...
@@ -61,6 +105,7 @@ class DbConn:
...
@@ -61,6 +105,7 @@ class DbConn:
def
createNative
(
cls
,
dbTarget
)
->
DbConn
:
def
createNative
(
cls
,
dbTarget
)
->
DbConn
:
return
cls
.
create
(
cls
.
TYPE_NATIVE
,
dbTarget
)
return
cls
.
create
(
cls
.
TYPE_NATIVE
,
dbTarget
)
@
classmethod
@
classmethod
def
createRest
(
cls
,
dbTarget
)
->
DbConn
:
def
createRest
(
cls
,
dbTarget
)
->
DbConn
:
return
cls
.
create
(
cls
.
TYPE_REST
,
dbTarget
)
return
cls
.
create
(
cls
.
TYPE_REST
,
dbTarget
)
...
@@ -75,6 +120,7 @@ class DbConn:
...
@@ -75,6 +120,7 @@ class DbConn:
return
"[DbConn: type={}, target={}]"
.
format
(
self
.
_type
,
self
.
_dbTarget
)
return
"[DbConn: type={}, target={}]"
.
format
(
self
.
_type
,
self
.
_dbTarget
)
def
getLastSql
(
self
):
def
getLastSql
(
self
):
return
self
.
_lastSql
return
self
.
_lastSql
def
open
(
self
):
def
open
(
self
):
...
@@ -184,13 +230,19 @@ class DbConnRest(DbConn):
...
@@ -184,13 +230,19 @@ class DbConnRest(DbConn):
def
_doSql
(
self
,
sql
):
def
_doSql
(
self
,
sql
):
self
.
_lastSql
=
sql
# remember this, last SQL attempted
self
.
_lastSql
=
sql
# remember this, last SQL attempted
self
.
saveSqlForCurrentThread
(
sql
)
# Save in global structure too. #TODO: combine with above
self
.
saveSqlForCurrentThread
(
sql
)
# Save in global structure too. #TODO: combine with above
time_cost
=
-
1
time_start
=
time
.
time
()
try
:
try
:
r
=
requests
.
post
(
self
.
_url
,
r
=
requests
.
post
(
self
.
_url
,
data
=
sql
,
data
=
sql
,
auth
=
HTTPBasicAuth
(
'root'
,
'taosdata'
))
auth
=
HTTPBasicAuth
(
'root'
,
'taosdata'
))
except
:
except
:
print
(
"REST API Failure (TODO: more info here)"
)
print
(
"REST API Failure (TODO: more info here)"
)
self
.
sql_exec_spend
(
-
2
)
raise
raise
finally
:
time_cost
=
time
.
time
()
-
time_start
self
.
sql_exec_spend
(
time_cost
)
rj
=
r
.
json
()
rj
=
r
.
json
()
# Sanity check for the "Json Result"
# Sanity check for the "Json Result"
if
(
'status'
not
in
rj
):
if
(
'status'
not
in
rj
):
...
@@ -223,6 +275,8 @@ class DbConnRest(DbConn):
...
@@ -223,6 +275,8 @@ class DbConnRest(DbConn):
"[SQL-REST] Execution Result, nRows = {}, SQL = {}"
.
format
(
nRows
,
sql
))
"[SQL-REST] Execution Result, nRows = {}, SQL = {}"
.
format
(
nRows
,
sql
))
return
nRows
return
nRows
def
query
(
self
,
sql
):
# return rows affected
def
query
(
self
,
sql
):
# return rows affected
return
self
.
execute
(
sql
)
return
self
.
execute
(
sql
)
...
@@ -336,6 +390,7 @@ class MyTDSql:
...
@@ -336,6 +390,7 @@ class MyTDSql:
raise
raise
return
self
.
affectedRows
return
self
.
affectedRows
class
DbTarget
:
class
DbTarget
:
def
__init__
(
self
,
cfgPath
,
hostAddr
,
port
):
def
__init__
(
self
,
cfgPath
,
hostAddr
,
port
):
self
.
cfgPath
=
cfgPath
self
.
cfgPath
=
cfgPath
...
@@ -355,6 +410,7 @@ class DbConnNative(DbConn):
...
@@ -355,6 +410,7 @@ class DbConnNative(DbConn):
# _connInfoDisplayed = False # TODO: find another way to display this
# _connInfoDisplayed = False # TODO: find another way to display this
totalConnections
=
0
# Not private
totalConnections
=
0
# Not private
totalRequests
=
0
totalRequests
=
0
time_cost
=
-
1
def
__init__
(
self
,
dbTarget
):
def
__init__
(
self
,
dbTarget
):
super
().
__init__
(
dbTarget
)
super
().
__init__
(
dbTarget
)
...
@@ -413,8 +469,18 @@ class DbConnNative(DbConn):
...
@@ -413,8 +469,18 @@ class DbConnNative(DbConn):
"Cannot exec SQL unless db connection is open"
,
CrashGenError
.
DB_CONNECTION_NOT_OPEN
)
"Cannot exec SQL unless db connection is open"
,
CrashGenError
.
DB_CONNECTION_NOT_OPEN
)
Logging
.
debug
(
"[SQL] Executing SQL: {}"
.
format
(
sql
))
Logging
.
debug
(
"[SQL] Executing SQL: {}"
.
format
(
sql
))
self
.
_lastSql
=
sql
self
.
_lastSql
=
sql
time_cost
=
-
1
nRows
=
0
time_start
=
time
.
time
()
self
.
saveSqlForCurrentThread
(
sql
)
# Save in global structure too. #TODO: combine with above
self
.
saveSqlForCurrentThread
(
sql
)
# Save in global structure too. #TODO: combine with above
nRows
=
self
.
_tdSql
.
execute
(
sql
)
try
:
nRows
=
self
.
_tdSql
.
execute
(
sql
)
except
Exception
as
e
:
self
.
sql_exec_spend
(
-
2
)
finally
:
time_cost
=
time
.
time
()
-
time_start
self
.
sql_exec_spend
(
time_cost
)
cls
=
self
.
__class__
cls
=
self
.
__class__
cls
.
totalRequests
+=
1
cls
.
totalRequests
+=
1
Logging
.
debug
(
Logging
.
debug
(
...
@@ -494,4 +560,3 @@ class DbManager():
...
@@ -494,4 +560,3 @@ class DbManager():
self
.
_dbConn
.
close
()
self
.
_dbConn
.
close
()
self
.
_dbConn
=
None
self
.
_dbConn
=
None
Logging
.
debug
(
"DbManager closed DB connection..."
)
Logging
.
debug
(
"DbManager closed DB connection..."
)
tests/pytest/util/dnodes.py
浏览文件 @
f46f941c
...
@@ -162,6 +162,10 @@ class TDDnode:
...
@@ -162,6 +162,10 @@ class TDDnode:
def
setAsan
(
self
,
value
):
def
setAsan
(
self
,
value
):
self
.
asan
=
value
self
.
asan
=
value
if
value
:
if
value
:
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
self
.
execPath
=
os
.
path
.
abspath
(
self
.
path
+
"/community/tests/script/sh/exec.sh"
)
else
:
self
.
execPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/exec.sh"
)
self
.
execPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/exec.sh"
)
def
getDataSize
(
self
):
def
getDataSize
(
self
):
...
@@ -670,6 +674,11 @@ class TDDnodes:
...
@@ -670,6 +674,11 @@ class TDDnodes:
def
setAsan
(
self
,
value
):
def
setAsan
(
self
,
value
):
self
.
asan
=
value
self
.
asan
=
value
if
value
:
if
value
:
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
self
.
stopDnodesPath
=
os
.
path
.
abspath
(
self
.
path
+
"/community/tests/script/sh/stop_dnodes.sh"
)
self
.
stopDnodesSigintPath
=
os
.
path
.
abspath
(
self
.
path
+
"/community/tests/script/sh/sigint_stop_dnodes.sh"
)
else
:
self
.
stopDnodesPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/stop_dnodes.sh"
)
self
.
stopDnodesPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/stop_dnodes.sh"
)
self
.
stopDnodesSigintPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/sigint_stop_dnodes.sh"
)
self
.
stopDnodesSigintPath
=
os
.
path
.
abspath
(
self
.
path
+
"/tests/script/sh/sigint_stop_dnodes.sh"
)
tdLog
.
info
(
"run in address sanitizer mode"
)
tdLog
.
info
(
"run in address sanitizer mode"
)
...
...
tests/pytest/util/log.py
浏览文件 @
f46f941c
...
@@ -33,7 +33,7 @@ class TDLog:
...
@@ -33,7 +33,7 @@ class TDLog:
print
(
"
\033
[1;36m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
err
))
print
(
"
\033
[1;36m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
err
))
def
success
(
self
,
info
):
def
success
(
self
,
info
):
print
(
"
\033
[1;32m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
info
))
print
f
(
"
\033
[1;32m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
info
))
def
notice
(
self
,
err
):
def
notice
(
self
,
err
):
print
(
"
\033
[1;33m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
err
))
print
(
"
\033
[1;33m%s %s
\033
[0m"
%
(
datetime
.
datetime
.
now
(),
err
))
...
...
tests/script/sh/checkAsan.sh
浏览文件 @
f46f941c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
set
+e
set
+e
#set -x
#set -x
unset
LD_PRELOAD
SCRIPT_DIR
=
`
dirname
$0
`
SCRIPT_DIR
=
`
dirname
$0
`
cd
$SCRIPT_DIR
/../
cd
$SCRIPT_DIR
/../
SCRIPT_DIR
=
`
pwd
`
SCRIPT_DIR
=
`
pwd
`
...
@@ -21,19 +22,24 @@ error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l`
...
@@ -21,19 +22,24 @@ error_num=`cat ${LOG_DIR}/*.asan | grep "ERROR" | wc -l`
memory_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Direct leak"
|
wc
-l
`
memory_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Direct leak"
|
wc
-l
`
indirect_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Indirect leak"
|
wc
-l
`
indirect_leak
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"Indirect leak"
|
wc
-l
`
runtime_error
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"runtime error"
|
grep
-v
"trees.c:873"
|
wc
-l
`
runtime_error
=
`
cat
${
LOG_DIR
}
/
*
.asan |
grep
"runtime error"
|
grep
-v
"trees.c:873"
|
wc
-l
`
python_error
=
`
cat
${
LOG_DIR
}
/
*
.info |
grep
-w
"stack"
|
wc
-l
`
echo
-e
"
\0
33[44;32;1m"
asan error_num:
$error_num
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan error_num:
$error_num
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan memory_leak:
$memory_leak
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan memory_leak:
$memory_leak
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan indirect_leak:
$indirect_leak
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan indirect_leak:
$indirect_leak
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan runtime error:
$runtime_error
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan runtime error:
$runtime_error
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
asan python error:
$python_error
"
\0
33[0m"
let
"errors=
$error_num
+
$memory_leak
+
$indirect_leak
+
$runtime_error
"
let
"errors=
$error_num
+
$memory_leak
+
$indirect_leak
+
$runtime_error
+
$python_error
"
if
[
$errors
-eq
0
]
;
then
if
[
$errors
-eq
0
]
;
then
echo
-e
"
\0
33[44;32;1m"
no asan errors
"
\0
33[0m"
echo
-e
"
\0
33[44;32;1m"
no asan errors
"
\0
33[0m"
exit
0
exit
0
else
else
echo
-e
"
\0
33[44;31;1m"
asan total errors:
$errors
"
\0
33[0m"
echo
-e
"
\0
33[44;31;1m"
asan total errors:
$errors
"
\0
33[0m"
if
[
$python_error
-ne
0
]
;
then
cat
${
LOG_DIR
}
/
*
.info
fi
cat
${
LOG_DIR
}
/
*
.asan
cat
${
LOG_DIR
}
/
*
.asan
exit
1
exit
1
fi
fi
\ No newline at end of file
tests/script/sh/exec.sh
浏览文件 @
f46f941c
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
set
+e
set
+e
#set -x
#set -x
unset
LD_PRELOAD
UNAME_BIN
=
`
which
uname
`
UNAME_BIN
=
`
which
uname
`
OS_TYPE
=
`
$UNAME_BIN
`
OS_TYPE
=
`
$UNAME_BIN
`
...
...
tests/script/sh/sigint_stop_dnodes.sh
浏览文件 @
f46f941c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
set
+e
set
+e
#set -x
#set -x
export
LD_PRELOAD
=
unset
LD_PRELOAD
UNAME_BIN
=
`
which
uname
`
UNAME_BIN
=
`
which
uname
`
OS_TYPE
=
`
$UNAME_BIN
`
OS_TYPE
=
`
$UNAME_BIN
`
...
...
tests/script/sh/stop_dnodes.sh
浏览文件 @
f46f941c
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
set
+e
set
+e
#set -x
#set -x
unset
LD_PRELOAD
UNAME_BIN
=
`
which
uname
`
UNAME_BIN
=
`
which
uname
`
OS_TYPE
=
`
$UNAME_BIN
`
OS_TYPE
=
`
$UNAME_BIN
`
export
LD_PRELOAD
=
PID
=
`
ps
-ef
|grep /usr/bin/taosd |
grep
-v
grep
|
awk
'{print $2}'
`
PID
=
`
ps
-ef
|grep /usr/bin/taosd |
grep
-v
grep
|
awk
'{print $2}'
`
if
[
-n
"
$PID
"
]
;
then
if
[
-n
"
$PID
"
]
;
then
echo
systemctl stop taosd
echo
systemctl stop taosd
...
...
tests/system-test/2-query/abs.py
浏览文件 @
f46f941c
...
@@ -204,18 +204,12 @@ class TDTestCase:
...
@@ -204,18 +204,12 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
abs_query
)
for
row_index
,
row
in
enumerate
(
abs_result
):
for
row_index
,
row
in
enumerate
(
abs_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
!=
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
if
not
check_status
:
tdLog
.
notice
(
"abs function value has not as expected , sql is
\"
%s
\"
"
%
abs_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"abs value check pass , it work as expected ,sql is
\"
%s
\"
"
%
abs_query
)
def
test_errors
(
self
):
def
test_errors
(
self
):
dbname
=
"testdb"
dbname
=
"testdb"
...
@@ -466,19 +460,19 @@ class TDTestCase:
...
@@ -466,19 +460,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select abs(c1), abs(c2) ,abs(c3), abs(c4), abs(c5) ,abs(c6) from
{
dbname
}
.sub1_bound"
)
f
"select abs(c1), abs(c2) ,abs(c3), abs(c4), abs(c5) ,abs(c6) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/and_or_for_byte.py
浏览文件 @
f46f941c
...
@@ -426,19 +426,19 @@ class TDTestCase:
...
@@ -426,19 +426,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_function
(
"&"
,
False
,
f
"
{
dbname
}
.sub1_bound"
,
"c1"
,
"c2"
,
"c3"
,
"c4"
,
"c5"
,
"c6"
)
self
.
check_function
(
"&"
,
False
,
f
"
{
dbname
}
.sub1_bound"
,
"c1"
,
"c2"
,
"c3"
,
"c4"
,
"c5"
,
"c6"
)
self
.
check_function
(
"&"
,
False
,
f
"
{
dbname
}
.sub1_bound"
,
"abs(c1)"
,
"abs(c2)"
,
"abs(c3)"
,
"abs(c4)"
,
"abs(c5)"
,
"abs(c6)"
)
self
.
check_function
(
"&"
,
False
,
f
"
{
dbname
}
.sub1_bound"
,
"abs(c1)"
,
"abs(c2)"
,
"abs(c3)"
,
"abs(c4)"
,
"abs(c5)"
,
"abs(c6)"
)
...
...
tests/system-test/2-query/arccos.py
浏览文件 @
f46f941c
...
@@ -86,21 +86,12 @@ class TDTestCase:
...
@@ -86,21 +86,12 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
pow_query
)
for
row_index
,
row
in
enumerate
(
pow_result
):
for
row_index
,
row
in
enumerate
(
pow_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
==
None
and
not
(
auto_result
[
row_index
][
col_index
]
==
None
and
elem
==
None
):
check_status
=
False
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
elif
auto_result
[
row_index
][
col_index
]
!=
None
and
(
auto_result
[
row_index
][
col_index
]
-
elem
>
0.00000001
):
check_status
=
False
else
:
pass
if
not
check_status
:
tdLog
.
notice
(
"acos function value has not as expected , sql is
\"
%s
\"
"
%
pow_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"acos value check pass , it work as expected ,sql is
\"
%s
\"
"
%
pow_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -414,19 +405,19 @@ class TDTestCase:
...
@@ -414,19 +405,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_acos
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select acos(abs(c1)), acos(abs(c2)) ,acos(abs(c3)), acos(abs(c4)), acos(abs(c5)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_acos
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select acos(abs(c1)), acos(abs(c2)) ,acos(abs(c3)), acos(abs(c4)), acos(abs(c5)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/arcsin.py
浏览文件 @
f46f941c
...
@@ -86,21 +86,13 @@ class TDTestCase:
...
@@ -86,21 +86,13 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
pow_query
)
for
row_index
,
row
in
enumerate
(
pow_result
):
for
row_index
,
row
in
enumerate
(
pow_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
==
None
and
not
(
auto_result
[
row_index
][
col_index
]
==
None
and
elem
==
None
):
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
elif
auto_result
[
row_index
][
col_index
]
!=
None
and
(
auto_result
[
row_index
][
col_index
]
-
elem
>
0.00000001
):
check_status
=
False
else
:
pass
if
not
check_status
:
tdLog
.
notice
(
"asin function value has not as expected , sql is
\"
%s
\"
"
%
pow_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"asin value check pass , it work as expected ,sql is
\"
%s
\"
"
%
pow_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -414,19 +406,19 @@ class TDTestCase:
...
@@ -414,19 +406,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_asin
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_asin
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/arctan.py
浏览文件 @
f46f941c
...
@@ -84,21 +84,11 @@ class TDTestCase:
...
@@ -84,21 +84,11 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
pow_query
)
for
row_index
,
row
in
enumerate
(
pow_result
):
for
row_index
,
row
in
enumerate
(
pow_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
==
None
and
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
elif
auto_result
[
row_index
][
col_index
]
!=
None
and
(
auto_result
[
row_index
][
col_index
]
-
elem
>
0.00000001
):
check_status
=
False
else
:
pass
if
not
check_status
:
tdLog
.
notice
(
"atan function value has not as expected , sql is
\"
%s
\"
"
%
pow_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"atan value check pass , it work as expected ,sql is
\"
%s
\"
"
%
pow_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -412,19 +402,19 @@ class TDTestCase:
...
@@ -412,19 +402,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_atan
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_atan
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/avg.py
浏览文件 @
f46f941c
...
@@ -114,16 +114,10 @@ class TDTestCase:
...
@@ -114,16 +114,10 @@ class TDTestCase:
avg_result
=
tdSql
.
getResult
(
origin_query
)
avg_result
=
tdSql
.
getResult
(
origin_query
)
origin_result
=
tdSql
.
getResult
(
check_query
)
origin_result
=
tdSql
.
getResult
(
check_query
)
check_status
=
True
tdSql
.
query
(
origin_query
)
for
row_index
,
row
in
enumerate
(
avg_result
):
for
row_index
,
row
in
enumerate
(
avg_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
avg_result
[
row_index
][
col_index
]
!=
origin_result
[
row_index
][
col_index
]:
tdSql
.
checkData
(
row_index
,
col_index
,
origin_result
[
row_index
][
col_index
])
check_status
=
False
if
not
check_status
:
tdLog
.
notice
(
"avg function value has not as expected , sql is
\"
%s
\"
"
%
origin_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"avg value check pass , it work as expected ,sql is
\"
%s
\"
"
%
check_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -378,33 +372,33 @@ class TDTestCase:
...
@@ -378,33 +372,33 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483645, 9223372036854775805, 32765, 125, 3.40E+37, 1.7e+307, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483645, 9223372036854775805, 32765, 125, 3.40E+37, 1.7e+307, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483644, 9223372036854775804, 32764, 124, 3.40E+37, 1.7e+307, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, 2147483644, 9223372036854775804, 32764, 124, 3.40E+37, 1.7e+307, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+15s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+20s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
1
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
#self.check_avg(f"select avg(c1), avg(c2), avg(c3) , avg(c4), avg(c5) ,avg(c6) from {dbname}.sub1_bound " , f" select sum(c1)/count(c1), sum(c2)/count(c2) ,sum(c3)/count(c3), sum(c4)/count(c4), sum(c5)/count(c5) ,sum(c6)/count(c6) from {dbname}.sub1_bound ")
#self.check_avg(f"select avg(c1), avg(c2), avg(c3) , avg(c4), avg(c5) ,avg(c6) from {dbname}.sub1_bound " , f" select sum(c1)/count(c1), sum(c2)/count(c2) ,sum(c3)/count(c3), sum(c4)/count(c4), sum(c5)/count(c5) ,sum(c6)/count(c6) from {dbname}.sub1_bound ")
...
...
tests/system-test/2-query/ceil.py
浏览文件 @
f46f941c
...
@@ -85,16 +85,11 @@ class TDTestCase:
...
@@ -85,16 +85,11 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
ceil_query
)
for
row_index
,
row
in
enumerate
(
ceil_result
):
for
row_index
,
row
in
enumerate
(
ceil_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
!=
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
if
not
check_status
:
tdLog
.
notice
(
"ceil function value has not as expected , sql is
\"
%s
\"
"
%
ceil_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"ceil value check pass , it work as expected ,sql is
\"
%s
\"
"
%
ceil_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -377,10 +372,10 @@ class TDTestCase:
...
@@ -377,10 +372,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -388,15 +383,15 @@ class TDTestCase:
...
@@ -388,15 +383,15 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select ceil(c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) ,ceil(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select ceil(c1), ceil(c2) ,ceil(c3), ceil(c4), ceil(c5) ,ceil(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select ceil(c1), ceil(c2) ,ceil(c3), ceil(c3), ceil(c2) ,ceil(c1) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select ceil(c1), ceil(c2) ,ceil(c3), ceil(c3), ceil(c2) ,ceil(c1) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/cos.py
浏览文件 @
f46f941c
...
@@ -84,26 +84,10 @@ class TDTestCase:
...
@@ -84,26 +84,10 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
pow_query
)
print
(
"========"
,
pow_query
,
origin_query
)
for
row_index
,
row
in
enumerate
(
pow_result
):
for
row_index
,
row
in
enumerate
(
pow_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
==
None
and
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
elif
auto_result
[
row_index
][
col_index
]
!=
None
and
((
auto_result
[
row_index
][
col_index
]
!=
elem
)
and
(
str
(
auto_result
[
row_index
][
col_index
])[:
6
]
!=
str
(
elem
)[:
6
]
)):
# elif auto_result[row_index][col_index] != None and (abs(auto_result[row_index][col_index] - elem) > 0.000001):
print
(
"====="
)
print
(
row_index
,
col_index
)
print
(
auto_result
[
row_index
][
col_index
],
elem
,
origin_result
[
row_index
][
col_index
])
check_status
=
False
else
:
pass
if
not
check_status
:
tdLog
.
notice
(
"cos function value has not as expected , sql is
\"
%s
\"
"
%
pow_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"cos value check pass , it work as expected ,sql is
\"
%s
\"
"
%
pow_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -413,16 +397,16 @@ class TDTestCase:
...
@@ -413,16 +397,16 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
# self.check_result_auto_cos( f"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from {dbname}.sub1_bound ", f"select cos(abs(c1)), cos(abs(c2)) ,cos(abs(c3)), cos(abs(c4)), cos(abs(c5)) from {dbname}.sub1_bound")
# self.check_result_auto_cos( f"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from {dbname}.sub1_bound ", f"select cos(abs(c1)), cos(abs(c2)) ,cos(abs(c3)), cos(abs(c4)), cos(abs(c5)) from {dbname}.sub1_bound")
...
...
tests/system-test/2-query/floor.py
浏览文件 @
f46f941c
...
@@ -85,16 +85,11 @@ class TDTestCase:
...
@@ -85,16 +85,11 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
floor_query
)
for
row_index
,
row
in
enumerate
(
floor_result
):
for
row_index
,
row
in
enumerate
(
floor_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
!=
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
if
not
check_status
:
tdLog
.
notice
(
"floor function value has not as expected , sql is
\"
%s
\"
"
%
floor_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"floor value check pass , it work as expected ,sql is
\"
%s
\"
"
%
floor_query
)
def
test_errors
(
self
,
dbname
=
DBNAME
):
def
test_errors
(
self
,
dbname
=
DBNAME
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -388,10 +383,10 @@ class TDTestCase:
...
@@ -388,10 +383,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -399,15 +394,15 @@ class TDTestCase:
...
@@ -399,15 +394,15 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select floor(c1), floor(c2) ,floor(c3), floor(c4), floor(c5) ,floor(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select floor(c1), floor(c2) ,floor(c3), floor(c4), floor(c5) ,floor(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select floor(c1), floor(c2) ,floor(c3), floor(c3), floor(c2) ,floor(c1) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select floor(c1), floor(c2) ,floor(c3), floor(c3), floor(c2) ,floor(c1) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/function_stateduration.py
浏览文件 @
f46f941c
...
@@ -364,10 +364,10 @@ class TDTestCase:
...
@@ -364,10 +364,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -375,15 +375,15 @@ class TDTestCase:
...
@@ -375,15 +375,15 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
query
(
f
"select stateduration(c1,'GT',1,1s) from
{
dbname
}
.sub1_bound"
)
tdSql
.
query
(
f
"select stateduration(c1,'GT',1,1s) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/interp.py
浏览文件 @
f46f941c
此差异已折叠。
点击以展开。
tests/system-test/2-query/last_row.py
浏览文件 @
f46f941c
...
@@ -572,19 +572,19 @@ class TDTestCase:
...
@@ -572,19 +572,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
# check basic elem for table per row
# check basic elem for table per row
...
...
tests/system-test/2-query/log.py
浏览文件 @
f46f941c
...
@@ -91,7 +91,6 @@ class TDTestCase:
...
@@ -91,7 +91,6 @@ class TDTestCase:
elem
=
math
.
log
(
elem
,
base
)
elem
=
math
.
log
(
elem
,
base
)
elif
elem
<=
0
:
elif
elem
<=
0
:
elem
=
None
elem
=
None
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
...
@@ -519,19 +518,19 @@ class TDTestCase:
...
@@ -519,19 +518,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_log
(
None
,
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select log(c1), log(c2) ,log(c3), log(c4), log(c5) ,log(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_log
(
None
,
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select log(c1), log(c2) ,log(c3), log(c4), log(c5) ,log(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_log
(
2
,
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select log(c1,2), log(c2,2) ,log(c3,2), log(c4,2), log(c5,2) ,log(c6,2) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_log
(
2
,
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select log(c1,2), log(c2,2) ,log(c3,2), log(c4,2), log(c5,2) ,log(c6,2) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/pow.py
浏览文件 @
f46f941c
...
@@ -507,19 +507,19 @@ class TDTestCase:
...
@@ -507,19 +507,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_pow
(
2
,
f
"select c1, c3 , c4, c5 from
{
dbname
}
.sub1_bound "
,
f
"select pow(c1,2), pow(c3,2), pow(c4,2), pow(c5,2) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_pow
(
2
,
f
"select c1, c3 , c4, c5 from
{
dbname
}
.sub1_bound "
,
f
"select pow(c1,2), pow(c3,2), pow(c4,2), pow(c5,2) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_pow
(
3
,
f
"select c1, c3 , c4, c5 from
{
dbname
}
.sub1_bound "
,
f
"select pow(c1,3), pow(c3,3), pow(c4,3), pow(c5,3) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_pow
(
3
,
f
"select c1, c3 , c4, c5 from
{
dbname
}
.sub1_bound "
,
f
"select pow(c1,3), pow(c3,3), pow(c4,3), pow(c5,3) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/round.py
浏览文件 @
f46f941c
...
@@ -81,16 +81,12 @@ class TDTestCase:
...
@@ -81,16 +81,12 @@ class TDTestCase:
row_check
.
append
(
elem
)
row_check
.
append
(
elem
)
auto_result
.
append
(
row_check
)
auto_result
.
append
(
row_check
)
check_status
=
True
tdSql
.
query
(
round_query
)
for
row_index
,
row
in
enumerate
(
round_result
):
for
row_index
,
row
in
enumerate
(
round_result
):
for
col_index
,
elem
in
enumerate
(
row
):
for
col_index
,
elem
in
enumerate
(
row
):
if
auto_result
[
row_index
][
col_index
]
!=
elem
:
tdSql
.
checkData
(
row_index
,
col_index
,
auto_result
[
row_index
][
col_index
])
check_status
=
False
if
not
check_status
:
tdLog
.
notice
(
"round function value has not as expected , sql is
\"
%s
\"
"
%
round_query
)
sys
.
exit
(
1
)
else
:
tdLog
.
info
(
"round value check pass , it work as expected ,sql is
\"
%s
\"
"
%
round_query
)
def
test_errors
(
self
,
dbname
=
"db"
):
def
test_errors
(
self
,
dbname
=
"db"
):
error_sql_lists
=
[
error_sql_lists
=
[
...
@@ -388,10 +384,10 @@ class TDTestCase:
...
@@ -388,10 +384,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -399,15 +395,15 @@ class TDTestCase:
...
@@ -399,15 +395,15 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select round(c1), round(c2) ,round(c3), round(c4), round(c5) ,round(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c4, c5 ,c6 from
{
dbname
}
.sub1_bound "
,
f
"select round(c1), round(c2) ,round(c3), round(c4), round(c5) ,round(c6) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select round(c1), round(c2) ,round(c3), round(c3), round(c2) ,round(c1) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto
(
f
"select c1, c2, c3 , c3, c2 ,c1 from
{
dbname
}
.sub1_bound "
,
f
"select round(c1), round(c2) ,round(c3), round(c3), round(c2) ,round(c1) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/sin.py
浏览文件 @
f46f941c
...
@@ -394,19 +394,19 @@ class TDTestCase:
...
@@ -394,19 +394,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_sin
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4) from
{
dbname
}
.sub1_bound "
,
f
"select sin(abs(c1)), sin(abs(c2)) ,sin(abs(c3)), sin(abs(c4)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_sin
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4) from
{
dbname
}
.sub1_bound "
,
f
"select sin(abs(c1)), sin(abs(c2)) ,sin(abs(c3)), sin(abs(c4)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/sqrt.py
浏览文件 @
f46f941c
...
@@ -443,19 +443,19 @@ class TDTestCase:
...
@@ -443,19 +443,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_sqrt
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select sqrt(abs(c1)), sqrt(abs(c2)) ,sqrt(abs(c3)), sqrt(abs(c4)), sqrt(abs(c5)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_sqrt
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from
{
dbname
}
.sub1_bound "
,
f
"select sqrt(abs(c1)), sqrt(abs(c2)) ,sqrt(abs(c3)), sqrt(abs(c4)), sqrt(abs(c5)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/statecount.py
浏览文件 @
f46f941c
...
@@ -451,10 +451,10 @@ class TDTestCase:
...
@@ -451,10 +451,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -462,15 +462,15 @@ class TDTestCase:
...
@@ -462,15 +462,15 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
query
(
f
"select statecount(c1,'GT',1) from
{
dbname
}
.sub1_bound"
)
tdSql
.
query
(
f
"select statecount(c1,'GT',1) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/tail.py
浏览文件 @
f46f941c
...
@@ -421,10 +421,10 @@ class TDTestCase:
...
@@ -421,10 +421,10 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
...
@@ -432,20 +432,20 @@ class TDTestCase:
...
@@ -432,20 +432,20 @@ class TDTestCase:
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+10s
, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
5
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
query
(
f
"select tail(c2,
2
) from
{
dbname
}
.sub1_bound order by 1 desc"
)
tdSql
.
query
(
f
"select tail(c2,
1
) from
{
dbname
}
.sub1_bound order by 1 desc"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
9223372036854775803
)
tdSql
.
checkData
(
0
,
0
,
-
9223372036854775803
)
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
def
run
(
self
):
# sourcery skip: extract-duplicate-method, remove-redundant-fstring
tdSql
.
prepare
()
tdSql
.
prepare
()
...
...
tests/system-test/2-query/tan.py
浏览文件 @
f46f941c
...
@@ -391,19 +391,19 @@ class TDTestCase:
...
@@ -391,19 +391,19 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
1
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-
5
s, -2147483647, -9223372036854775807, -32767, -127, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
+5s
, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+1
0
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
self
.
check_result_auto_tan
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4) from
{
dbname
}
.sub1_bound "
,
f
"select tan(abs(c1)), tan(abs(c2)) ,tan(abs(c3)), tan(abs(c4)) from
{
dbname
}
.sub1_bound"
)
self
.
check_result_auto_tan
(
f
"select abs(c1), abs(c2), abs(c3) , abs(c4) from
{
dbname
}
.sub1_bound "
,
f
"select tan(abs(c1)), tan(abs(c2)) ,tan(abs(c3)), tan(abs(c4)) from
{
dbname
}
.sub1_bound"
)
...
...
tests/system-test/2-query/txt.txt
0 → 100644
浏览文件 @
f46f941c
abs.py: def check_boundary_values(self):
abs.py: self.check_boundary_values()
and_or_for_byte.py: def check_boundary_values(self, dbname="bound_test"):
and_or_for_byte.py: self.check_boundary_values()
arccos.py: def check_boundary_values(self, dbname="bound_test"):
arccos.py: self.check_boundary_values()
arcsin.py: def check_boundary_values(self, dbname="bound_test"):
arcsin.py: self.check_boundary_values()
arctan.py: def check_boundary_values(self, dbname="bound_test"):
arctan.py: self.check_boundary_values()
avg.py: def check_boundary_values(self, dbname="bound_test"):
avg.py: self.check_boundary_values()
ceil.py: def check_boundary_values(self, dbname="bound_test"):
ceil.py: self.check_boundary_values()
cos.py: def check_boundary_values(self, dbname="bound_test"):
cos.py: self.check_boundary_values()
floor.py: def check_boundary_values(self, dbname="bound_test"):
floor.py: self.check_boundary_values()
function_stateduration.py: def check_boundary_values(self, dbname="bound_test"):
function_stateduration.py: self.check_boundary_values()
last_row.py: def check_boundary_values(self, dbname="bound_test"):
last_row.py: self.check_boundary_values()
log.py: def check_boundary_values(self, dbname="bound_test"):
log.py: self.check_boundary_values()
pow.py: def check_boundary_values(self, dbname="bound_test"):
pow.py: self.check_boundary_values()
round.py: def check_boundary_values(self, dbname="bound_test"):
round.py: self.check_boundary_values()
sin.py: def check_boundary_values(self, dbname="testdb"):
sin.py: self.check_boundary_values()
sqrt.py: def check_boundary_values(self, dbname="bound_test"):
sqrt.py: self.check_boundary_values()
statecount.py: def check_boundary_values(self, dbname="bound_test"):
statecount.py: self.check_boundary_values()
tail.py: def check_boundary_values(self, dbname="bound_test"):
tail.py: self.check_boundary_values()
tan.py: def check_boundary_values(self, dbname="bound_test"):
tan.py: self.check_boundary_values()
unique.py: def check_boundary_values(self, dbname="bound_test"):
unique.py: self.check_boundary_values()
tests/system-test/2-query/unique.py
浏览文件 @
f46f941c
...
@@ -451,26 +451,26 @@ class TDTestCase:
...
@@ -451,26 +451,26 @@ class TDTestCase:
)
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
f
'create table
{
dbname
}
.sub1_bound using
{
dbname
}
.stb_bound tags ( 1 )'
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()-1
0
s, 2147483647, 9223372036854775807, 32767, 127, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now(), 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()
-5s
, 2147483646, 9223372036854775806, 32766, 126, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
1
s, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
5
s, -2147483646, -9223372036854775806, -32766, -126, -3.40E+38, -1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
2
s, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
10
s, 2147483643, 9223372036854775803, 32763, 123, 3.39E+38, 1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
execute
(
tdSql
.
execute
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
3
s, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
20
s, -2147483643, -9223372036854775803, -32763, -123, -3.39E+38, -1.69e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
error
(
tdSql
.
error
(
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
1
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
f
"insert into
{
dbname
}
.sub1_bound values ( now()+
30
s, 2147483648, 9223372036854775808, 32768, 128, 3.40E+38, 1.7e+308, True, 'binary_tb1', 'nchar_tb1', now() )"
)
)
tdSql
.
query
(
f
"select unique(c2) from
{
dbname
}
.sub1_bound order by 1 desc"
)
tdSql
.
query
(
f
"select unique(c2) from
{
dbname
}
.sub1_bound order by 1 desc"
)
...
...
tests/system-test/test.sh
→
tests/system-test/
py
test.sh
浏览文件 @
f46f941c
...
@@ -45,13 +45,11 @@ declare -x SIM_DIR=$TOP_DIR/sim
...
@@ -45,13 +45,11 @@ declare -x SIM_DIR=$TOP_DIR/sim
PROGRAM
=
$BUILD_DIR
/build/bin/tsim
PROGRAM
=
$BUILD_DIR
/build/bin/tsim
PRG_DIR
=
$SIM_DIR
/tsim
PRG_DIR
=
$SIM_DIR
/tsim
ASAN_DIR
=
$SIM_DIR
/asan
ASAN_DIR
=
$SIM_DIR
/asan
SYSTEM_TEST_DIR
=
$TOP_DIR
/tests/system-test
chmod
-R
777
$PRG_DIR
chmod
-R
777
$PRG_DIR
echo
"------------------------------------------------------------------------"
echo
"------------------------------------------------------------------------"
echo
"Start TDengine Testing Case ..."
echo
"Start TDengine Testing Case ..."
echo
"BUILD_DIR:
$BUILD_DIR
"
echo
"BUILD_DIR:
$BUILD_DIR
"
echo
"SYSTEM_TEST_DIR :
$SYSTEM_TEST_DIR
"
echo
"SIM_DIR :
$SIM_DIR
"
echo
"SIM_DIR :
$SIM_DIR
"
echo
"CODE_DIR :
$CODE_DIR
"
echo
"CODE_DIR :
$CODE_DIR
"
echo
"ASAN_DIR :
$ASAN_DIR
"
echo
"ASAN_DIR :
$ASAN_DIR
"
...
@@ -61,23 +59,40 @@ rm -rf $SIM_DIR/*
...
@@ -61,23 +59,40 @@ rm -rf $SIM_DIR/*
mkdir
-p
$PRG_DIR
mkdir
-p
$PRG_DIR
mkdir
-p
$ASAN_DIR
mkdir
-p
$ASAN_DIR
cd
$
SYSTEM_TEST
_DIR
cd
$
CODE
_DIR
ulimit
-n
600000
ulimit
-n
600000
ulimit
-c
unlimited
ulimit
-c
unlimited
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
#sudo sysctl -w kernel.core_pattern=$TOP_DIR/core.%p.%e
echo
"ExcuteCmd:"
$*
echo
"ExcuteCmd:"
$*
echo
"AsanDir:"
$ASAN_DIR
/psim.asan
AsanFile
=
$ASAN_DIR
/psim.info
echo
"AsanFile:"
$AsanFile
export
LD_PRELOAD
=
libasan.so.5
$*
-a
2>
$ASAN_DIR
/psim.asan
unset
LD_PRELOAD
result
=
$?
#export LD_PRELOAD=libasan.so.5
echo
"Execute result:"
$result
export
LD_PRELOAD
=
`
gcc
-print-file-name
=
libasan.so
`
echo
"Preload AsanSo:"
$?
if
[
$result
-eq
0
]
;
then
$CODE_DIR
/sh/checkAsan.sh
$*
-a
2>
$AsanFile
unset
LD_PRELOAD
AsanFileLen
=
`
cat
$AsanFile
|
wc
-l
`
while
[
$AsanFileLen
-lt
10
]
do
sleep
1
`
cat
$AsanFile
|
wc
-l
`
done
echo
"AsanFileLen:"
$AsanFileLen
AsanFileSuccessLen
=
`
grep
-w
successfully
$AsanFile
|
wc
-l
`
echo
"AsanFileSuccessLen:"
$AsanFileSuccessLen
if
[
$AsanFileSuccessLen
-gt
0
]
;
then
echo
"Execute script successfully and check asan"
$CODE_DIR
/../script/sh/checkAsan.sh
else
else
echo
"Execute script failure"
exit
1
exit
1
fi
fi
tests/system-test/test.py
浏览文件 @
f46f941c
...
@@ -555,5 +555,5 @@ if __name__ == "__main__":
...
@@ -555,5 +555,5 @@ if __name__ == "__main__":
conn
.
close
()
conn
.
close
()
if
asan
:
if
asan
:
tdDnodes
.
StopAllSigint
()
tdDnodes
.
StopAllSigint
()
tdLog
.
info
(
"
a
ddress sanitizer mode finished"
)
tdLog
.
info
(
"
A
ddress sanitizer mode finished"
)
sys
.
exit
(
0
)
sys
.
exit
(
0
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录