Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
40b87a2d
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1191
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看板
未验证
提交
40b87a2d
编写于
8月 04, 2023
作者:
W
wade zhang
提交者:
GitHub
8月 04, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #22320 from taosdata/fix/TS-3311
fix: fix _wstart,_wennd not matching with interval for ns/us databases
上级
ebc3b1ba
666a9a17
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
126 addition
and
2 deletion
+126
-2
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+4
-2
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-0
tests/system-test/99-TDcase/TS-3311.py
tests/system-test/99-TDcase/TS-3311.py
+121
-0
未找到文件。
source/libs/function/src/builtins.c
浏览文件 @
40b87a2d
...
@@ -468,7 +468,8 @@ static int32_t translateStddevMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t
...
@@ -468,7 +468,8 @@ static int32_t translateStddevMerge(SFunctionNode* pFunc, char* pErrBuf, int32_t
static
int32_t
translateWduration
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
static
int32_t
translateWduration
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
// pseudo column do not need to check parameters
// pseudo column do not need to check parameters
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
TSDB_DATA_TYPE_BIGINT
].
bytes
,
.
type
=
TSDB_DATA_TYPE_BIGINT
};
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
TSDB_DATA_TYPE_BIGINT
].
bytes
,
.
type
=
TSDB_DATA_TYPE_BIGINT
,
.
precision
=
pFunc
->
node
.
resType
.
precision
};
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -491,7 +492,8 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in
...
@@ -491,7 +492,8 @@ static int32_t translateTimePseudoColumn(SFunctionNode* pFunc, char* pErrBuf, in
// pseudo column do not need to check parameters
// pseudo column do not need to check parameters
pFunc
->
node
.
resType
=
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
TSDB_DATA_TYPE_TIMESTAMP
].
bytes
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
};
(
SDataType
){.
bytes
=
tDataTypes
[
TSDB_DATA_TYPE_TIMESTAMP
].
bytes
,
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
,
.
precision
=
pFunc
->
node
.
resType
.
precision
};
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
...
tests/parallel_test/cases.task
浏览文件 @
40b87a2d
...
@@ -135,6 +135,7 @@
...
@@ -135,6 +135,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TD-21561.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3404.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3404.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3581.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3581.py
,,y,system-test,./pytest.sh python3 ./test.py -f 99-TDcase/TS-3311.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/balance_vgroups_r1.py -N 6
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/balance_vgroups_r1.py -N 6
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosShell.py
,,y,system-test,./pytest.sh python3 ./test.py -f 0-others/taosShell.py
...
...
tests/system-test/99-TDcase/TS-3311.py
0 → 100644
浏览文件 @
40b87a2d
import
taos
import
sys
import
time
import
socket
import
os
import
threading
from
util.log
import
*
from
util.sql
import
*
from
util.cases
import
*
from
util.dnodes
import
*
class
TDTestCase
:
hostname
=
socket
.
gethostname
()
def
init
(
self
,
conn
,
logSql
,
replicaVar
=
1
):
self
.
replicaVar
=
int
(
replicaVar
)
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
#tdSql.init(conn.cursor())
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
# output sql.txt file
def
getBuildPath
(
self
):
selfPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
if
(
"community"
in
selfPath
):
projPath
=
selfPath
[:
selfPath
.
find
(
"community"
)]
else
:
projPath
=
selfPath
[:
selfPath
.
find
(
"tests"
)]
for
root
,
dirs
,
files
in
os
.
walk
(
projPath
):
if
(
"taosd"
in
files
or
"taosd.exe"
in
files
):
rootRealPath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
root
))
if
(
"packaging"
not
in
rootRealPath
):
buildPath
=
root
[:
len
(
root
)
-
len
(
"/build/bin"
)]
break
return
buildPath
def
create_tables
(
self
):
tdSql
.
execute
(
"create database if not exists dbus precision 'us'"
)
tdSql
.
execute
(
"create database if not exists dbns precision 'ns'"
)
tdSql
.
execute
(
"use dbus"
)
tdSql
.
execute
(
f
"CREATE STABLE `stb_us` (`ts` TIMESTAMP, `ip_value` FLOAT, `ip_quality` INT) TAGS (`t1` INT)"
)
tdSql
.
execute
(
f
"CREATE TABLE `ctb1_us` USING `stb_us` (`t1`) TAGS (1)"
)
tdSql
.
execute
(
f
"CREATE TABLE `ctb2_us` USING `stb_us` (`t1`) TAGS (2)"
)
tdSql
.
execute
(
"use dbns"
)
tdSql
.
execute
(
f
"CREATE STABLE `stb_ns` (`ts` TIMESTAMP, `ip_value` FLOAT, `ip_quality` INT) TAGS (`t1` INT)"
)
tdSql
.
execute
(
f
"CREATE TABLE `ctb1_ns` USING `stb_ns` (`t1`) TAGS (1)"
)
tdSql
.
execute
(
f
"CREATE TABLE `ctb2_ns` USING `stb_ns` (`t1`) TAGS (2)"
)
def
insert_data
(
self
):
tdLog
.
debug
(
"start to insert data ............"
)
tdSql
.
execute
(
f
"INSERT INTO `dbus`.`ctb1_us` VALUES ('2023-07-01 00:00:00.000', 10.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `dbus`.`ctb2_us` VALUES ('2023-08-01 00:00:00.000', 20.30000, 200)"
)
tdSql
.
execute
(
f
"INSERT INTO `dbns`.`ctb1_ns` VALUES ('2023-07-01 00:00:00.000', 10.30000, 100)"
)
tdSql
.
execute
(
f
"INSERT INTO `dbns`.`ctb2_ns` VALUES ('2023-08-01 00:00:00.000', 20.30000, 200)"
)
tdLog
.
debug
(
"insert data ............ [OK]"
)
def
run
(
self
):
tdSql
.
prepare
()
self
.
create_tables
()
self
.
insert_data
()
tdLog
.
printNoPrefix
(
"======== test TS-3311"
)
# test ns
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbns`.`stb_ns` interval(1n)"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
'2023-07-01 00:00:00.000000000'
)
tdSql
.
checkData
(
1
,
0
,
'2023-08-01 00:00:00.000000000'
)
tdSql
.
checkData
(
0
,
1
,
'2023-08-01 00:00:00.000000000'
)
tdSql
.
checkData
(
1
,
1
,
'2023-09-01 00:00:00.000000000'
)
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbns`.`stb_ns` interval(12n)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
'2023-01-01 00:00:00.000000000'
)
tdSql
.
checkData
(
0
,
1
,
'2024-01-01 00:00:00.000000000'
)
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbns`.`stb_ns` interval(1y)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
'2023-01-01 00:00:00.000000000'
)
tdSql
.
checkData
(
0
,
1
,
'2024-01-01 00:00:00.000000000'
)
## test us
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbus`.`stb_us` interval(1n)"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
'2023-07-01 00:00:00.000000'
)
tdSql
.
checkData
(
1
,
0
,
'2023-08-01 00:00:00.000000'
)
tdSql
.
checkData
(
0
,
1
,
'2023-08-01 00:00:00.000000'
)
tdSql
.
checkData
(
1
,
1
,
'2023-09-01 00:00:00.000000'
)
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbus`.`stb_us` interval(12n)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
'2023-01-01 00:00:00.000000'
)
tdSql
.
checkData
(
0
,
1
,
'2024-01-01 00:00:00.000000'
)
tdSql
.
query
(
f
"select _wstart, _wend, count(*) from `dbus`.`stb_us` interval(1y)"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
'2023-01-01 00:00:00.000000'
)
tdSql
.
checkData
(
0
,
1
,
'2024-01-01 00:00:00.000000'
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录