Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2db9149a
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
2db9149a
编写于
9月 01, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
9月 01, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16553 from taosdata/fix/TD-16780
fix(query): support timestamp type in max/min function
上级
5d02a243
4f772ee7
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
169 addition
and
95 deletion
+169
-95
include/common/ttypes.h
include/common/ttypes.h
+5
-3
source/libs/function/src/builtins.c
source/libs/function/src/builtins.c
+26
-10
source/libs/function/src/builtinsimpl.c
source/libs/function/src/builtinsimpl.c
+4
-4
tests/script/tsim/stable/alter_comment.sim
tests/script/tsim/stable/alter_comment.sim
+1
-1
tests/script/tsim/stable/alter_count.sim
tests/script/tsim/stable/alter_count.sim
+4
-4
tests/script/tsim/stable/alter_import.sim
tests/script/tsim/stable/alter_import.sim
+2
-2
tests/script/tsim/stable/alter_insert1.sim
tests/script/tsim/stable/alter_insert1.sim
+2
-2
tests/script/tsim/stable/alter_insert2.sim
tests/script/tsim/stable/alter_insert2.sim
+2
-2
tests/script/tsim/stable/alter_metrics.sim
tests/script/tsim/stable/alter_metrics.sim
+3
-3
tests/script/tsim/stable/column_add.sim
tests/script/tsim/stable/column_add.sim
+3
-3
tests/script/tsim/stable/column_modify.sim
tests/script/tsim/stable/column_modify.sim
+3
-3
tests/script/tsim/stable/disk.sim
tests/script/tsim/stable/disk.sim
+1
-1
tests/script/tsim/stable/refcount.sim
tests/script/tsim/stable/refcount.sim
+1
-1
tests/script/tsim/stable/tag_add.sim
tests/script/tsim/stable/tag_add.sim
+3
-3
tests/script/tsim/stable/tag_drop.sim
tests/script/tsim/stable/tag_drop.sim
+6
-6
tests/script/tsim/stable/tag_filter.sim
tests/script/tsim/stable/tag_filter.sim
+33
-33
tests/script/tsim/stable/tag_modify.sim
tests/script/tsim/stable/tag_modify.sim
+3
-3
tests/script/tsim/stable/tag_rename.sim
tests/script/tsim/stable/tag_rename.sim
+3
-3
tests/system-test/2-query/max.py
tests/system-test/2-query/max.py
+25
-2
tests/system-test/2-query/min.py
tests/system-test/2-query/min.py
+39
-6
未找到文件。
include/common/ttypes.h
浏览文件 @
2db9149a
...
...
@@ -49,9 +49,6 @@ typedef struct {
#define varDataCopy(dst, v) memcpy((dst), (void *)(v), varDataTLen(v))
#define varDataLenByData(v) (*(VarDataLenT *)(((char *)(v)) - VARSTR_HEADER_SIZE))
#define varDataSetLen(v, _len) (((VarDataLenT *)(v))[0] = (VarDataLenT)(_len))
#define IS_VAR_DATA_TYPE(t) \
(((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON))
#define IS_STR_DATA_TYPE(t) (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR))
#define varDataNetLen(v) (htons(((VarDataLenT *)(v))[0]))
#define varDataNetTLen(v) (sizeof(VarDataLenT) + varDataNetLen(v))
...
...
@@ -268,11 +265,16 @@ typedef struct {
#define IS_UNSIGNED_NUMERIC_TYPE(_t) ((_t) >= TSDB_DATA_TYPE_UTINYINT && (_t) <= TSDB_DATA_TYPE_UBIGINT)
#define IS_FLOAT_TYPE(_t) ((_t) == TSDB_DATA_TYPE_FLOAT || (_t) == TSDB_DATA_TYPE_DOUBLE)
#define IS_INTEGER_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)))
#define IS_TIMESTAMP_TYPE(_t) ((_t) == TSDB_DATA_TYPE_TIMESTAMP)
#define IS_NUMERIC_TYPE(_t) ((IS_SIGNED_NUMERIC_TYPE(_t)) || (IS_UNSIGNED_NUMERIC_TYPE(_t)) || (IS_FLOAT_TYPE(_t)))
#define IS_MATHABLE_TYPE(_t) \
(IS_NUMERIC_TYPE(_t) || (_t) == (TSDB_DATA_TYPE_BOOL) || (_t) == (TSDB_DATA_TYPE_TIMESTAMP))
#define IS_VAR_DATA_TYPE(t) \
(((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR) || ((t) == TSDB_DATA_TYPE_JSON))
#define IS_STR_DATA_TYPE(t) (((t) == TSDB_DATA_TYPE_VARCHAR) || ((t) == TSDB_DATA_TYPE_NCHAR))
#define IS_VALID_TINYINT(_t) ((_t) >= INT8_MIN && (_t) <= INT8_MAX)
#define IS_VALID_SMALLINT(_t) ((_t) >= INT16_MIN && (_t) <= INT16_MAX)
#define IS_VALID_INT(_t) ((_t) >= INT32_MIN && (_t) <= INT32_MAX)
...
...
source/libs/function/src/builtins.c
浏览文件 @
2db9149a
...
...
@@ -311,6 +311,22 @@ static int32_t translateInOutStr(SFunctionNode* pFunc, char* pErrBuf, int32_t le
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateMinMax
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
)
{
if
(
1
!=
LIST_LENGTH
(
pFunc
->
pParameterList
))
{
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_TIMESTAMP_TYPE
(
paraType
)
&&
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_NULL_TYPE
(
paraType
))
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
else
if
(
IS_NULL_TYPE
(
paraType
))
{
paraType
=
TSDB_DATA_TYPE_BIGINT
;
}
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
tDataTypes
[
paraType
].
bytes
,
.
type
=
paraType
};
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
translateTrimStr
(
SFunctionNode
*
pFunc
,
char
*
pErrBuf
,
int32_t
len
,
bool
isLtrim
)
{
if
(
1
!=
LIST_LENGTH
(
pFunc
->
pParameterList
))
{
return
invaildFuncParaNumErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
...
...
@@ -698,7 +714,7 @@ static int32_t translateSpread(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
paraType
)
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_TIMESTAMP_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -713,7 +729,7 @@ static int32_t translateSpreadImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
isPartial
)
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
paraType
)
{
if
(
!
IS_NUMERIC_TYPE
(
paraType
)
&&
!
IS_TIMESTAMP_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
pFunc
->
node
.
resType
=
(
SDataType
){.
bytes
=
getSpreadInfoSize
()
+
VARSTR_HEADER_SIZE
,
.
type
=
TSDB_DATA_TYPE_BINARY
};
...
...
@@ -788,7 +804,7 @@ static int32_t translateElapsedImpl(SFunctionNode* pFunc, char* pErrBuf, int32_t
}
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
TSDB_DATA_TYPE_TIMESTAMP
!=
paraType
)
{
if
(
!
IS_TIMESTAMP_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -1634,7 +1650,7 @@ static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
uint8_t
colType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_SIGNED_NUMERIC_TYPE
(
colType
)
&&
!
IS_FLOAT_TYPE
(
colType
)
&&
TSDB_DATA_TYPE_BOOL
!=
colType
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
colType
)
{
!
IS_TIMESTAMP_TYPE
(
colType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -1660,7 +1676,7 @@ static int32_t translateDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t len) {
}
uint8_t
resType
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
colType
)
||
TSDB_DATA_TYPE_BOOL
==
colType
||
TSDB_DATA_TYPE_TIMESTAMP
==
colType
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
colType
)
||
IS_TIMESTAMP_TYPE
(
colType
)
||
TSDB_DATA_TYPE_BOOL
==
colType
)
{
resType
=
TSDB_DATA_TYPE_BIGINT
;
}
else
{
resType
=
TSDB_DATA_TYPE_DOUBLE
;
...
...
@@ -1825,7 +1841,7 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l
// param0
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
if
(
!
IS_INTEGER_TYPE
(
paraType
)
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
paraType
)
{
if
(
!
IS_INTEGER_TYPE
(
paraType
)
&&
!
IS_TIMESTAMP_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -1878,7 +1894,7 @@ static int32_t translateTimeTruncate(SFunctionNode* pFunc, char* pErrBuf, int32_
uint8_t
para1Type
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
0
))
->
resType
.
type
;
uint8_t
para2Type
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
1
))
->
resType
.
type
;
if
((
!
IS_STR_DATA_TYPE
(
para1Type
)
&&
!
IS_INTEGER_TYPE
(
para1Type
)
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
para1Type
)
||
if
((
!
IS_STR_DATA_TYPE
(
para1Type
)
&&
!
IS_INTEGER_TYPE
(
para1Type
)
&&
!
IS_TIMESTAMP_TYPE
(
para1Type
)
)
||
!
IS_INTEGER_TYPE
(
para2Type
))
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
...
...
@@ -1911,7 +1927,7 @@ static int32_t translateTimeDiff(SFunctionNode* pFunc, char* pErrBuf, int32_t le
for
(
int32_t
i
=
0
;
i
<
2
;
++
i
)
{
uint8_t
paraType
=
((
SExprNode
*
)
nodesListGetNode
(
pFunc
->
pParameterList
,
i
))
->
resType
.
type
;
if
(
!
IS_STR_DATA_TYPE
(
paraType
)
&&
!
IS_INTEGER_TYPE
(
paraType
)
&&
TSDB_DATA_TYPE_TIMESTAMP
!=
paraType
)
{
if
(
!
IS_STR_DATA_TYPE
(
paraType
)
&&
!
IS_INTEGER_TYPE
(
paraType
)
&&
!
IS_TIMESTAMP_TYPE
(
paraType
)
)
{
return
invaildFuncParaTypeErrMsg
(
pErrBuf
,
len
,
pFunc
->
functionName
);
}
}
...
...
@@ -2060,7 +2076,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
name
=
"min"
,
.
type
=
FUNCTION_TYPE_MIN
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SPECIAL_DATA_REQUIRED
|
FUNC_MGT_SELECT_FUNC
,
.
translateFunc
=
translate
InOutNum
,
.
translateFunc
=
translate
MinMax
,
.
dataRequiredFunc
=
statisDataRequired
,
.
getEnvFunc
=
getMinmaxFuncEnv
,
.
initFunc
=
minmaxFunctionSetup
,
...
...
@@ -2075,7 +2091,7 @@ const SBuiltinFuncDefinition funcMgtBuiltins[] = {
.
name
=
"max"
,
.
type
=
FUNCTION_TYPE_MAX
,
.
classification
=
FUNC_MGT_AGG_FUNC
|
FUNC_MGT_SPECIAL_DATA_REQUIRED
|
FUNC_MGT_SELECT_FUNC
,
.
translateFunc
=
translate
InOutNum
,
.
translateFunc
=
translate
MinMax
,
.
dataRequiredFunc
=
statisDataRequired
,
.
getEnvFunc
=
getMinmaxFuncEnv
,
.
initFunc
=
minmaxFunctionSetup
,
...
...
source/libs/function/src/builtinsimpl.c
浏览文件 @
2db9149a
...
...
@@ -1204,7 +1204,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
pBuf
->
tuplePos
=
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
);
}
}
else
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
))
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
IS_TIMESTAMP_TYPE
(
type
)
)
{
int64_t
prev
=
0
;
GET_TYPED_DATA
(
prev
,
int64_t
,
type
,
&
pBuf
->
v
);
...
...
@@ -1216,7 +1216,6 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
pBuf
->
tuplePos
=
saveTupleData
(
pCtx
,
index
,
pCtx
->
pSrcBlock
);
}
}
}
else
if
(
IS_UNSIGNED_NUMERIC_TYPE
(
type
))
{
uint64_t
prev
=
0
;
GET_TYPED_DATA
(
prev
,
uint64_t
,
type
,
&
pBuf
->
v
);
...
...
@@ -1264,7 +1263,7 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
int32_t
start
=
pInput
->
startRowIndex
;
int32_t
numOfRows
=
pInput
->
numOfRows
;
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
IS_SIGNED_NUMERIC_TYPE
(
type
)
||
IS_TIMESTAMP_TYPE
(
type
)
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
if
(
type
==
TSDB_DATA_TYPE_TINYINT
||
type
==
TSDB_DATA_TYPE_BOOL
)
{
int8_t
*
pData
=
(
int8_t
*
)
pCol
->
pData
;
int8_t
*
val
=
(
int8_t
*
)
&
pBuf
->
v
;
...
...
@@ -1358,7 +1357,8 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) {
numOfElems
+=
1
;
}
}
else
if
(
type
==
TSDB_DATA_TYPE_BIGINT
)
{
}
else
if
(
type
==
TSDB_DATA_TYPE_BIGINT
||
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
int64_t
*
pData
=
(
int64_t
*
)
pCol
->
pData
;
int64_t
*
val
=
(
int64_t
*
)
&
pBuf
->
v
;
...
...
tests/script/tsim/stable/alter_comment.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/alter_count.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/alter_import.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/alter_insert1.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/alter_insert2.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/alter_metrics.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/column_add.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/column_modify.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/disk.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/refcount.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/tag_add.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/tag_drop.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/tag_filter.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/tag_modify.sim
浏览文件 @
2db9149a
tests/script/tsim/stable/tag_rename.sim
浏览文件 @
2db9149a
tests/system-test/2-query/max.py
浏览文件 @
2db9149a
...
...
@@ -26,7 +26,7 @@ class TDTestCase:
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
for
i
in
[
'
ts'
,
'
col11'
,
'col12'
,
'col13'
]:
for
i
in
[
'col11'
,
'col12'
,
'col13'
]:
for
j
in
[
'stb'
,
'stb_1'
]:
tdSql
.
error
(
f
'select max(
{
i
}
from
{
dbname
}
.
{
j
}
)'
)
...
...
@@ -37,6 +37,20 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
intData
))
elif
i
>=
9
:
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
floatData
))
tdSql
.
query
(
f
"select max(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
f
"select last(ts) from
{
dbname
}
.stb_1"
)
lastTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select max(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
lastTs
)
tdSql
.
query
(
f
"select last(ts) from
{
dbname
}
.stb"
)
lastTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select max(ts) from
{
dbname
}
.stb"
)
tdSql
.
checkData
(
0
,
0
,
lastTs
)
tdSql
.
query
(
f
"select max(col1) from
{
dbname
}
.stb_1 where col2<=5"
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
query
(
f
"select max(col1) from
{
dbname
}
.stb where col2<=5"
)
...
...
@@ -53,7 +67,7 @@ class TDTestCase:
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
for
i
in
[
'
ts'
,
'
col11'
,
'col12'
,
'col13'
]:
for
i
in
[
'col11'
,
'col12'
,
'col13'
]:
for
j
in
[
'ntb'
]:
tdSql
.
error
(
f
'select max(
{
i
}
from
{
dbname
}
.
{
j
}
)'
)
for
i
in
range
(
1
,
11
):
...
...
@@ -63,6 +77,15 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
intData
))
elif
i
>=
9
:
tdSql
.
checkData
(
0
,
0
,
np
.
max
(
floatData
))
tdSql
.
query
(
f
"select max(now()) from
{
dbname
}
.ntb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
f
"select last(ts) from
{
dbname
}
.ntb"
)
lastTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select max(ts) from
{
dbname
}
.ntb"
)
tdSql
.
checkData
(
0
,
0
,
lastTs
)
tdSql
.
query
(
f
"select max(col1) from
{
dbname
}
.ntb where col2<=5"
)
tdSql
.
checkData
(
0
,
0
,
5
)
...
...
tests/system-test/2-query/min.py
浏览文件 @
2db9149a
...
...
@@ -37,13 +37,11 @@ class TDTestCase:
floatData
.
append
(
i
+
0.1
)
# max verifacation
tdSql
.
error
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col7) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col8) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col9) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(a) from
{
dbname
}
.stb_1"
)
tdSql
.
query
(
f
"select min(1) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(count(c1),count(c2)) from
{
dbname
}
.stb_1"
)
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.stb_1"
)
...
...
@@ -69,14 +67,25 @@ class TDTestCase:
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.stb_1 where col2>=5"
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
query
(
f
"select min(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
tdSql
.
error
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col7) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col8) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(col9) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(a) from
{
dbname
}
.stb_1"
)
tdSql
.
query
(
f
"select min(1) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
error
(
f
"select min(count(c1),count(c2)) from
{
dbname
}
.stb_1"
)
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.stb"
)
...
...
@@ -102,13 +111,24 @@ class TDTestCase:
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.stb where col2>=5"
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
error
(
f
"select min(ts) from
{
dbname
}
.ntb"
)
tdSql
.
query
(
f
"select min(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
tdSql
.
error
(
f
"select min(col7) from
{
dbname
}
.ntb"
)
tdSql
.
error
(
f
"select min(col8) from
{
dbname
}
.ntb"
)
tdSql
.
error
(
f
"select min(col9) from
{
dbname
}
.ntb"
)
tdSql
.
error
(
f
"select min(a) from
{
dbname
}
.ntb"
)
tdSql
.
query
(
f
"select min(1) from
{
dbname
}
.ntb"
)
tdSql
.
error
(
f
"select min(now()) from
{
dbname
}
.ntb"
)
tdSql
.
error
(
f
"select min(count(c1),count(c2)) from
{
dbname
}
.ntb"
)
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.ntb"
)
...
...
@@ -134,6 +154,19 @@ class TDTestCase:
tdSql
.
query
(
f
"select min(col1) from
{
dbname
}
.ntb where col2>=5"
)
tdSql
.
checkData
(
0
,
0
,
5
)
tdSql
.
query
(
f
"select min(now()) from
{
dbname
}
.stb_1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
tdSql
.
query
(
f
"select first(ts) from
{
dbname
}
.stb_1"
)
firstTs
=
tdSql
.
getData
(
0
,
0
)
tdSql
.
query
(
f
"select min(ts) from
{
dbname
}
.stb_1"
)
tdSql
.
checkData
(
0
,
0
,
firstTs
)
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录