Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yiicenne
TDengine
提交
ac5789d9
TDengine
项目概览
yiicenne
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ac5789d9
编写于
6月 01, 2021
作者:
H
haojun Liao
提交者:
GitHub
6月 01, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6320 from taosdata/feature/query
Feature/query
上级
07c48dad
37c1e139
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
109 addition
and
66 deletion
+109
-66
src/client/src/tscPrepare.c
src/client/src/tscPrepare.c
+5
-11
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+19
-4
src/client/src/tscServer.c
src/client/src/tscServer.c
+0
-1
src/client/src/tscSql.c
src/client/src/tscSql.c
+1
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+51
-17
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
...dbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
+8
-17
src/query/src/qAggMain.c
src/query/src/qAggMain.c
+7
-8
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+13
-5
tests/script/general/parser/function.sim
tests/script/general/parser/function.sim
+3
-0
tests/script/general/parser/nestquery.sim
tests/script/general/parser/nestquery.sim
+1
-2
tests/script/general/parser/testSuite.sim
tests/script/general/parser/testSuite.sim
+1
-0
未找到文件。
src/client/src/tscPrepare.c
浏览文件 @
ac5789d9
...
...
@@ -1204,7 +1204,6 @@ static int insertBatchStmtExecute(STscStmt* pStmt) {
return
pStmt
->
pSql
->
res
.
code
;
}
int
stmtParseInsertTbTags
(
SSqlObj
*
pSql
,
STscStmt
*
pStmt
)
{
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
int32_t
ret
=
TSDB_CODE_SUCCESS
;
...
...
@@ -1234,28 +1233,28 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
pStmt
->
mtb
.
tagSet
=
true
;
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
>
0
&&
sToken
.
type
==
TK_VALUES
)
{
if
(
sToken
.
n
>
0
&&
(
sToken
.
type
==
TK_VALUES
||
sToken
.
type
==
TK_LP
)
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
sToken
.
n
<=
0
||
sToken
.
type
!=
TK_USING
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"keywords USING is expected"
,
sToken
.
z
)
;
}
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
((
sToken
.
type
!=
TK_ID
)
&&
(
sToken
.
type
!=
TK_STRING
)))
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"invalid token"
,
sToken
.
z
)
;
}
pStmt
->
mtb
.
stbname
=
sToken
;
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
sToken
.
type
!=
TK_TAGS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
"keyword TAGS expected"
,
sToken
.
z
)
;
}
sToken
=
tStrGetToken
(
pCmd
->
insertParam
.
sql
,
&
index
,
false
);
if
(
sToken
.
n
<=
0
||
sToken
.
type
!=
TK_LP
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
return
tscSQLSyntaxErrMsg
(
pCmd
->
payload
,
") expected"
,
sToken
.
z
)
;
}
pStmt
->
mtb
.
tags
=
taosArrayInit
(
4
,
sizeof
(
SStrToken
));
...
...
@@ -1298,9 +1297,6 @@ int stmtParseInsertTbTags(SSqlObj* pSql, STscStmt* pStmt) {
return
TSDB_CODE_SUCCESS
;
}
int
stmtGenInsertStatement
(
SSqlObj
*
pSql
,
STscStmt
*
pStmt
,
const
char
*
name
,
TAOS_BIND
*
tags
)
{
size_t
tagNum
=
taosArrayGetSize
(
pStmt
->
mtb
.
tags
);
size_t
size
=
1048576
;
...
...
@@ -1386,8 +1382,6 @@ int stmtGenInsertStatement(SSqlObj* pSql, STscStmt* pStmt, const char* name, TAO
return
TSDB_CODE_SUCCESS
;
}
////////////////////////////////////////////////////////////////////////////////
// interface functions
...
...
src/client/src/tscSQLParser.c
浏览文件 @
ac5789d9
...
...
@@ -7482,6 +7482,7 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
const
char
*
msg1
=
"point interpolation query needs timestamp"
;
const
char
*
msg2
=
"too many tables in from clause"
;
const
char
*
msg3
=
"start(end) time of query range required or time range too large"
;
const
char
*
msg4
=
"interval query not supported, since the result of sub query not include valid timestamp column"
;
const
char
*
msg9
=
"only tag query not compatible with normal column filter"
;
int32_t
code
=
TSDB_CODE_SUCCESS
;
...
...
@@ -7540,11 +7541,25 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
if
(
validateIntervalNode
(
pSql
,
pQueryInfo
,
pSqlNode
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
else
{
if
(
isTimeWindowQuery
(
pQueryInfo
)
&&
(
validateFunctionsInIntervalOrGroupbyQuery
(
pCmd
,
pQueryInfo
)
!=
TSDB_CODE_SUCCESS
))
{
if
(
isTimeWindowQuery
(
pQueryInfo
))
{
// check if the first column of the nest query result is timestamp column
SColumn
*
pCol
=
taosArrayGetP
(
pQueryInfo
->
colList
,
0
);
if
(
pCol
->
info
.
type
!=
TSDB_DATA_TYPE_TIMESTAMP
)
{
return
invalidOperationMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg4
);
}
if
(
validateFunctionsInIntervalOrGroupbyQuery
(
pCmd
,
pQueryInfo
)
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
}
// set order by info
STableMeta
*
pTableMeta
=
tscGetMetaInfo
(
pQueryInfo
,
0
)
->
pTableMeta
;
if
(
validateOrderbyNode
(
pCmd
,
pQueryInfo
,
pSqlNode
,
tscGetTableSchema
(
pTableMeta
))
!=
TSDB_CODE_SUCCESS
)
{
return
TSDB_CODE_TSC_INVALID_OPERATION
;
}
}
else
{
pQueryInfo
->
command
=
TSDB_SQL_SELECT
;
...
...
@@ -7697,8 +7712,8 @@ int32_t validateSqlNode(SSqlObj* pSql, SSqlNode* pSqlNode, SQueryInfo* pQueryInf
SExprInfo
**
p
=
NULL
;
int32_t
numOfExpr
=
0
;
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
code
=
createProjectionExpr
(
pQueryInfo
,
pTableMetaInfo
,
&
p
,
&
numOfExpr
);
if
(
pQueryInfo
->
exprList1
==
NULL
)
{
pQueryInfo
->
exprList1
=
taosArrayInit
(
4
,
POINTER_BYTES
);
}
...
...
src/client/src/tscServer.c
浏览文件 @
ac5789d9
...
...
@@ -477,7 +477,6 @@ int doBuildAndSendMsg(SSqlObj *pSql) {
pCmd
->
command
==
TSDB_SQL_INSERT
||
pCmd
->
command
==
TSDB_SQL_CONNECT
||
pCmd
->
command
==
TSDB_SQL_HB
||
// pCmd->command == TSDB_SQL_META ||
pCmd
->
command
==
TSDB_SQL_STABLEVGROUP
)
{
pRes
->
code
=
tscBuildMsg
[
pCmd
->
command
](
pSql
,
NULL
);
}
...
...
src/client/src/tscSql.c
浏览文件 @
ac5789d9
...
...
@@ -627,7 +627,7 @@ static bool hasAdditionalErrorInfo(int32_t code, SSqlCmd *pCmd) {
char
*
z
=
NULL
;
if
(
len
>
0
)
{
z
=
strstr
(
pCmd
->
payload
,
"invalid
SQL
"
);
z
=
strstr
(
pCmd
->
payload
,
"invalid
operation
"
);
if
(
z
==
NULL
)
{
z
=
strstr
(
pCmd
->
payload
,
"syntax error"
);
}
...
...
src/client/src/tscUtil.c
浏览文件 @
ac5789d9
...
...
@@ -780,7 +780,9 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
SSqlRes
*
pRes
=
&
pSql
->
res
;
SSDataBlock
*
pBlock
=
pInput
->
block
;
if
(
pOperator
->
pRuntimeEnv
!=
NULL
)
{
pOperator
->
pRuntimeEnv
->
current
=
pInput
->
pTableQueryInfo
;
}
pBlock
->
info
.
rows
=
pRes
->
numOfRows
;
if
(
pRes
->
numOfRows
!=
0
)
{
...
...
@@ -804,18 +806,9 @@ SSDataBlock* doGetDataBlock(void* param, bool* newgroup) {
return
pBlock
;
}
SSDataBlock
*
doDataBlockJoin
(
void
*
param
,
bool
*
newgroup
)
{
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
}
assert
(
pOperator
->
numOfUpstream
>
1
);
static
void
fetchNextBlockIfCompleted
(
SOperatorInfo
*
pOperator
,
bool
*
newgroup
)
{
SJoinOperatorInfo
*
pJoinInfo
=
pOperator
->
info
;
pJoinInfo
->
pRes
->
info
.
rows
=
0
;
while
(
1
)
{
for
(
int32_t
i
=
0
;
i
<
pOperator
->
numOfUpstream
;
++
i
)
{
SJoinStatus
*
pStatus
=
&
pJoinInfo
->
status
[
i
];
if
(
pStatus
->
pBlock
==
NULL
||
pStatus
->
index
>=
pStatus
->
pBlock
->
info
.
rows
)
{
...
...
@@ -824,12 +817,29 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
if
(
pStatus
->
pBlock
==
NULL
)
{
pOperator
->
status
=
OP_EXEC_DONE
;
pJoinInfo
->
resultInfo
.
total
+=
pJoinInfo
->
pRes
->
info
.
rows
;
return
pJoinInfo
->
pRes
;
break
;
}
}
}
}
SSDataBlock
*
doDataBlockJoin
(
void
*
param
,
bool
*
newgroup
)
{
SOperatorInfo
*
pOperator
=
(
SOperatorInfo
*
)
param
;
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
NULL
;
}
assert
(
pOperator
->
numOfUpstream
>
1
);
SJoinOperatorInfo
*
pJoinInfo
=
pOperator
->
info
;
pJoinInfo
->
pRes
->
info
.
rows
=
0
;
while
(
1
)
{
fetchNextBlockIfCompleted
(
pOperator
,
newgroup
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
pJoinInfo
->
pRes
;
}
SJoinStatus
*
st0
=
&
pJoinInfo
->
status
[
0
];
SColumnInfoData
*
p0
=
taosArrayGet
(
st0
->
pBlock
->
pDataBlock
,
0
);
...
...
@@ -847,8 +857,12 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
if
(
ts
[
st
->
index
]
<
ts0
[
st0
->
index
])
{
// less than the first
prefixEqual
=
false
;
if
((
++
(
st
->
index
))
>=
st
->
pBlock
->
info
.
rows
)
{
break
;
fetchNextBlockIfCompleted
(
pOperator
,
newgroup
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
pJoinInfo
->
pRes
;
}
}
}
else
if
(
ts
[
st
->
index
]
>
ts0
[
st0
->
index
])
{
// greater than the first;
if
(
prefixEqual
==
true
)
{
...
...
@@ -856,12 +870,19 @@ SSDataBlock* doDataBlockJoin(void* param, bool* newgroup) {
for
(
int32_t
j
=
0
;
j
<
i
;
++
j
)
{
SJoinStatus
*
stx
=
&
pJoinInfo
->
status
[
j
];
if
((
++
(
stx
->
index
))
>=
stx
->
pBlock
->
info
.
rows
)
{
break
;
fetchNextBlockIfCompleted
(
pOperator
,
newgroup
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
pJoinInfo
->
pRes
;
}
}
}
}
else
{
if
((
++
(
st0
->
index
))
>=
st0
->
pBlock
->
info
.
rows
)
{
break
;
fetchNextBlockIfCompleted
(
pOperator
,
newgroup
);
if
(
pOperator
->
status
==
OP_EXEC_DONE
)
{
return
pJoinInfo
->
pRes
;
}
}
}
}
...
...
@@ -1132,6 +1153,19 @@ void handleDownstreamOperator(SSqlObj** pSqlObjList, int32_t numOfUpstream, SQue
memcpy
(
schema
,
pSchema
,
numOfCol1
*
sizeof
(
SSchema
));
}
// update the exprinfo
int32_t
numOfOutput
=
(
int32_t
)
tscNumOfExprs
(
px
);
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
SExprInfo
*
pex
=
taosArrayGetP
(
px
->
exprList
,
i
);
int32_t
colId
=
pex
->
base
.
colInfo
.
colId
;
for
(
int32_t
j
=
0
;
j
<
pSourceOperator
->
numOfOutput
;
++
j
)
{
if
(
colId
==
schema
[
j
].
colId
)
{
pex
->
base
.
colInfo
.
colIndex
=
j
;
break
;
}
}
}
px
->
pQInfo
=
createQInfoFromQueryNode
(
px
,
&
tableGroupInfo
,
pSourceOperator
,
NULL
,
NULL
,
MASTER_SCAN
);
tfree
(
pColumnInfo
);
tfree
(
schema
);
...
...
src/connector/jdbc/src/main/java/com/taosdata/jdbc/TSDBJNIConnector.java
浏览文件 @
ac5789d9
...
...
@@ -16,13 +16,13 @@
*/
package
com.taosdata.jdbc
;
import
com.taosdata.jdbc.utils.TaosInfo
;
import
java.nio.ByteBuffer
;
import
java.sql.SQLException
;
import
java.sql.SQLWarning
;
import
java.util.List
;
import
com.taosdata.jdbc.utils.TaosInfo
;
/**
* JNI connector
*/
...
...
@@ -276,23 +276,14 @@ public class TSDBJNIConnector {
private
native
int
validateCreateTableSqlImp
(
long
connection
,
byte
[]
sqlBytes
);
public
long
prepareStmt
(
String
sql
)
throws
SQLException
{
Long
stmt
=
0L
;
try
{
stmt
=
prepareStmtImp
(
sql
.
getBytes
(),
this
.
taos
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_UNSUPPORTED_ENCODING
);
}
if
(
stmt
==
TSDBConstants
.
JNI_CONNECTION_NULL
)
{
Long
stmt
=
prepareStmtImp
(
sql
.
getBytes
(),
this
.
taos
);
if
(
stmt
==
TSDBConstants
.
JNI_TDENGINE_ERROR
)
{
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_INVALID_SQL
);
}
else
if
(
stmt
==
TSDBConstants
.
JNI_CONNECTION_NULL
)
{
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_JNI_CONNECTION_NULL
);
}
if
(
stmt
==
TSDBConstants
.
JNI_SQL_NULL
)
{
}
else
if
(
stmt
==
TSDBConstants
.
JNI_SQL_NULL
)
{
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_JNI_SQL_NULL
);
}
if
(
stmt
==
TSDBConstants
.
JNI_OUT_OF_MEMORY
)
{
}
else
if
(
stmt
==
TSDBConstants
.
JNI_OUT_OF_MEMORY
)
{
throw
TSDBError
.
createSQLException
(
TSDBErrorNumbers
.
ERROR_JNI_OUT_OF_MEMORY
);
}
...
...
src/query/src/qAggMain.c
浏览文件 @
ac5789d9
...
...
@@ -2490,7 +2490,6 @@ static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
tmp
+=
POINTER_BYTES
*
pCtx
->
param
[
0
].
i64
;
size_t
size
=
sizeof
(
tValuePair
)
+
pCtx
->
tagInfo
.
tagsLen
;
// assert(pCtx->param[0].i64 > 0);
for
(
int32_t
i
=
0
;
i
<
pCtx
->
param
[
0
].
i64
;
++
i
)
{
pTopBotInfo
->
res
[
i
]
=
(
tValuePair
*
)
tmp
;
...
...
@@ -2499,7 +2498,6 @@ static void buildTopBotStruct(STopBotInfo *pTopBotInfo, SQLFunctionCtx *pCtx) {
}
}
bool
topbot_datablock_filter
(
SQLFunctionCtx
*
pCtx
,
const
char
*
minval
,
const
char
*
maxval
)
{
SResultRowCellInfo
*
pResInfo
=
GET_RES_INFO
(
pCtx
);
if
(
pResInfo
==
NULL
)
{
...
...
@@ -2579,13 +2577,14 @@ static void top_function(SQLFunctionCtx *pCtx) {
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
char
*
data
=
GET_INPUT_DATA
(
pCtx
,
i
);
TSKEY
ts
=
GET_TS_DATA
(
pCtx
,
i
);
if
(
pCtx
->
hasNull
&&
isNull
(
data
,
pCtx
->
inputType
))
{
continue
;
}
notNullElems
++
;
// NOTE: Set the default timestamp if it is missing [todo refactor]
TSKEY
ts
=
(
pCtx
->
ptsList
!=
NULL
)
?
GET_TS_DATA
(
pCtx
,
i
)
:
0
;
do_top_function_add
(
pRes
,
(
int32_t
)
pCtx
->
param
[
0
].
i64
,
data
,
ts
,
pCtx
->
inputType
,
&
pCtx
->
tagInfo
,
NULL
,
0
);
}
...
...
@@ -2658,13 +2657,13 @@ static void bottom_function(SQLFunctionCtx *pCtx) {
for
(
int32_t
i
=
0
;
i
<
pCtx
->
size
;
++
i
)
{
char
*
data
=
GET_INPUT_DATA
(
pCtx
,
i
);
TSKEY
ts
=
GET_TS_DATA
(
pCtx
,
i
);
if
(
pCtx
->
hasNull
&&
isNull
(
data
,
pCtx
->
inputType
))
{
continue
;
}
notNullElems
++
;
// NOTE: Set the default timestamp if it is missing [todo refactor]
TSKEY
ts
=
(
pCtx
->
ptsList
!=
NULL
)
?
GET_TS_DATA
(
pCtx
,
i
)
:
0
;
do_bottom_function_add
(
pRes
,
(
int32_t
)
pCtx
->
param
[
0
].
i64
,
data
,
ts
,
pCtx
->
inputType
,
&
pCtx
->
tagInfo
,
NULL
,
0
);
}
...
...
@@ -2742,7 +2741,7 @@ static void top_bottom_func_finalizer(SQLFunctionCtx *pCtx) {
if
(
pCtx
->
param
[
1
].
i64
==
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
__compar_fn_t
comparator
=
(
pCtx
->
param
[
2
].
i64
==
TSDB_ORDER_ASC
)
?
resAscComparFn
:
resDescComparFn
;
qsort
(
tvp
,
(
size_t
)
pResInfo
->
numOfRes
,
POINTER_BYTES
,
comparator
);
}
else
if
(
pCtx
->
param
[
1
].
i64
>
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
}
else
/*if (pCtx->param[1].i64 > PRIMARYKEY_TIMESTAMP_COL_INDEX)*/
{
__compar_fn_t
comparator
=
(
pCtx
->
param
[
2
].
i64
==
TSDB_ORDER_ASC
)
?
resDataAscComparFn
:
resDataDescComparFn
;
qsort
(
tvp
,
(
size_t
)
pResInfo
->
numOfRes
,
POINTER_BYTES
,
comparator
);
}
...
...
src/query/src/qExecutor.c
浏览文件 @
ac5789d9
...
...
@@ -950,7 +950,13 @@ static void doSetInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx,
uint32_t
status
=
aAggs
[
pCtx
[
i
].
functionId
].
status
;
if
((
status
&
(
TSDB_FUNCSTATE_SELECTIVITY
|
TSDB_FUNCSTATE_NEED_TS
))
!=
0
)
{
SColumnInfoData
*
tsInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
0
);
// In case of the top/bottom query again the nest query result, which has no timestamp column
// don't set the ptsList attribute.
if
(
tsInfo
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
)
{
pCtx
[
i
].
ptsList
=
(
int64_t
*
)
tsInfo
->
pData
;
}
else
{
pCtx
[
i
].
ptsList
=
NULL
;
}
}
}
else
if
(
TSDB_COL_IS_UD_COL
(
pCol
->
flag
)
&&
(
pOperator
->
pRuntimeEnv
->
scanFlag
==
MERGE_STAGE
))
{
SColIndex
*
pColIndex
=
&
pOperator
->
pExpr
[
i
].
base
.
colInfo
;
...
...
@@ -4228,6 +4234,10 @@ static void updateTableIdInfo(STableQueryInfo* pTableQueryInfo, SSDataBlock* pBl
int32_t
step
=
GET_FORWARD_DIRECTION_FACTOR
(
order
);
pTableQueryInfo
->
lastKey
=
((
order
==
TSDB_ORDER_ASC
)
?
pBlock
->
info
.
window
.
ekey
:
pBlock
->
info
.
window
.
skey
)
+
step
;
if
(
pTableQueryInfo
->
pTable
==
NULL
)
{
return
;
}
STableIdInfo
tidInfo
=
createTableIdInfo
(
pTableQueryInfo
);
STableIdInfo
*
idinfo
=
taosHashGet
(
pTableIdInfo
,
&
tidInfo
.
tid
,
sizeof
(
tidInfo
.
tid
));
if
(
idinfo
!=
NULL
)
{
...
...
@@ -4905,8 +4915,7 @@ static SSDataBlock* doArithmeticOperation(void* param, bool* newgroup) {
updateOutputBuf
(
&
pArithInfo
->
binfo
,
&
pArithInfo
->
bufCapacity
,
pBlock
->
info
.
rows
);
arithmeticApplyFunctions
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
if
(
pTableQueryInfo
!=
NULL
)
{
// TODO refactor
if
(
pTableQueryInfo
!=
NULL
)
{
updateTableIdInfo
(
pTableQueryInfo
,
pBlock
,
pRuntimeEnv
->
pTableRetrieveTsMap
,
order
);
}
...
...
@@ -4949,8 +4958,7 @@ static SSDataBlock* doArithmeticOperation(void* param, bool* newgroup) {
updateOutputBuf
(
&
pArithInfo
->
binfo
,
&
pArithInfo
->
bufCapacity
,
pBlock
->
info
.
rows
);
arithmeticApplyFunctions
(
pRuntimeEnv
,
pInfo
->
pCtx
,
pOperator
->
numOfOutput
);
if
(
pTableQueryInfo
!=
NULL
)
{
// TODO refactor
if
(
pTableQueryInfo
!=
NULL
)
{
updateTableIdInfo
(
pTableQueryInfo
,
pBlock
,
pRuntimeEnv
->
pTableRetrieveTsMap
,
order
);
}
...
...
tests/script/general/parser/function.sim
浏览文件 @
ac5789d9
...
...
@@ -24,6 +24,9 @@ sql drop database if exists $db
sql create database $db keep 36500
sql use $db
print =====================================> td-4481
sql create database $db
print =====================================> test case for twa in single block
sql create table t1 (ts timestamp, k float);
...
...
tests/script/general/parser/nestquery.sim
浏览文件 @
ac5789d9
...
...
@@ -9,7 +9,7 @@ sql connect
print ======================== dnode1 start
$dbPrefix = nest_
query
$dbPrefix = nest_
db
$tbPrefix = nest_tb
$mtPrefix = nest_mt
$tbNum = 10
...
...
@@ -17,7 +17,6 @@ $rowNum = 10000
$totalNum = $tbNum * $rowNum
print =============== nestquery.sim
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
...
...
tests/script/general/parser/testSuite.sim
浏览文件 @
ac5789d9
...
...
@@ -60,4 +60,5 @@ run general/parser/slimit_alter_tags.sim
run general/parser/binary_escapeCharacter.sim
run general/parser/between_and.sim
run general/parser/last_cache.sim
run general/parser/nestquery.sim
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录