Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小楼昨夜-听风雨
TDengine
提交
c3773983
T
TDengine
项目概览
小楼昨夜-听风雨
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c3773983
编写于
11月 06, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 06, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4133 from taosdata/feature/query
Feature/query
上级
f7c2d8e4
1fed1db1
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
23 addition
and
9 deletion
+23
-9
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+15
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+2
-2
src/query/inc/tsqlfunction.h
src/query/inc/tsqlfunction.h
+1
-1
src/query/src/qAst.c
src/query/src/qAst.c
+0
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-1
src/query/src/qFill.c
src/query/src/qFill.c
+1
-1
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+1
-1
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
c3773983
...
@@ -428,6 +428,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -428,6 +428,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
}
else
{
}
else
{
assert
(
code
==
TSDB_CODE_SUCCESS
);
assert
(
code
==
TSDB_CODE_SUCCESS
);
}
}
// param already freed by other routine and pSql in tscCache when ctrl + c
// param already freed by other routine and pSql in tscCache when ctrl + c
if
(
atomic_load_ptr
(
&
pSql
->
param
)
==
NULL
)
{
if
(
atomic_load_ptr
(
&
pSql
->
param
)
==
NULL
)
{
return
;
return
;
...
@@ -441,6 +442,20 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -441,6 +442,20 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
assert
(
pParObj
->
signature
==
pParObj
&&
trs
->
subqueryIndex
==
pTableMetaInfo
->
vgroupIndex
&&
assert
(
pParObj
->
signature
==
pParObj
&&
trs
->
subqueryIndex
==
pTableMetaInfo
->
vgroupIndex
&&
pTableMetaInfo
->
vgroupIndex
>=
0
&&
pTableMetaInfo
->
vgroupList
!=
NULL
);
pTableMetaInfo
->
vgroupIndex
>=
0
&&
pTableMetaInfo
->
vgroupList
!=
NULL
);
// tscProcessSql can add error into async res
tscProcessSql
(
pSql
);
return
;
}
else
if
(
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_TAG_FILTER_QUERY
))
{
tscDebug
(
"%p update table meta in local cache, continue to process sql and send corresponding tid_tag query"
,
pSql
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
code
=
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
;
}
else
{
assert
(
code
==
TSDB_CODE_SUCCESS
);
}
assert
((
tscGetNumOfTags
(
pTableMetaInfo
->
pTableMeta
)
!=
0
));
// tscProcessSql can add error into async res
// tscProcessSql can add error into async res
tscProcessSql
(
pSql
);
tscProcessSql
(
pSql
);
return
;
return
;
...
@@ -465,7 +480,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -465,7 +480,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
tscResetSqlCmdObj
(
pCmd
,
false
);
tscResetSqlCmdObj
(
pCmd
,
false
);
code
=
tsParseSql
(
pSql
,
true
);
code
=
tsParseSql
(
pSql
,
true
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
return
;
return
;
}
else
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
}
else
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
src/client/src/tscParseInsert.c
浏览文件 @
c3773983
...
@@ -1309,7 +1309,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
...
@@ -1309,7 +1309,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
if
((
!
pCmd
->
parseFinished
)
&&
(
!
initial
))
{
if
((
!
pCmd
->
parseFinished
)
&&
(
!
initial
))
{
tscDebug
(
"%p resume to parse sql: %s"
,
pSql
,
pCmd
->
curSql
);
tscDebug
(
"%p resume to parse sql: %s"
,
pSql
,
pCmd
->
curSql
);
}
}
ret
=
tscAllocPayload
(
&
pSql
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
ret
=
tscAllocPayload
(
&
pSql
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
if
(
TSDB_CODE_SUCCESS
!=
ret
)
{
if
(
TSDB_CODE_SUCCESS
!=
ret
)
{
return
ret
;
return
ret
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
c3773983
...
@@ -523,7 +523,7 @@ static void quitAllSubquery(SSqlObj* pSqlObj, SJoinSupporter* pSupporter) {
...
@@ -523,7 +523,7 @@ static void quitAllSubquery(SSqlObj* pSqlObj, SJoinSupporter* pSupporter) {
assert
(
pSqlObj
->
subState
.
numOfRemain
>
0
);
assert
(
pSqlObj
->
subState
.
numOfRemain
>
0
);
if
(
atomic_sub_fetch_32
(
&
pSqlObj
->
subState
.
numOfRemain
,
1
)
<=
0
)
{
if
(
atomic_sub_fetch_32
(
&
pSqlObj
->
subState
.
numOfRemain
,
1
)
<=
0
)
{
tscError
(
"%p all subquery return and query failed, global code:%
d"
,
pSqlObj
,
pSqlObj
->
res
.
code
);
tscError
(
"%p all subquery return and query failed, global code:%
s"
,
pSqlObj
,
tstrerror
(
pSqlObj
->
res
.
code
)
);
freeJoinSubqueryObj
(
pSqlObj
);
freeJoinSubqueryObj
(
pSqlObj
);
}
}
}
}
...
@@ -565,7 +565,7 @@ int32_t tagValCompar(const void* p1, const void* p2) {
...
@@ -565,7 +565,7 @@ int32_t tagValCompar(const void* p1, const void* p2) {
return
(
tag1
->
len
>
tag2
->
len
)
?
1
:
-
1
;
return
(
tag1
->
len
>
tag2
->
len
)
?
1
:
-
1
;
}
}
return
strn
cmp
(
tag1
->
data
,
tag2
->
data
,
tag1
->
len
);
return
mem
cmp
(
tag1
->
data
,
tag2
->
data
,
tag1
->
len
);
}
}
void
tscBuildVgroupTableInfo
(
SSqlObj
*
pSql
,
STableMetaInfo
*
pTableMetaInfo
,
SArray
*
tables
)
{
void
tscBuildVgroupTableInfo
(
SSqlObj
*
pSql
,
STableMetaInfo
*
pTableMetaInfo
,
SArray
*
tables
)
{
...
...
src/query/inc/tsqlfunction.h
浏览文件 @
c3773983
...
@@ -149,7 +149,7 @@ typedef struct SResultRowCellInfo {
...
@@ -149,7 +149,7 @@ typedef struct SResultRowCellInfo {
int8_t
hasResult
;
// result generated, not NULL value
int8_t
hasResult
;
// result generated, not NULL value
bool
initialized
;
// output buffer has been initialized
bool
initialized
;
// output buffer has been initialized
bool
complete
;
// query has completed
bool
complete
;
// query has completed
uint
16
_t
numOfRes
;
// num of output result in current buffer
uint
32
_t
numOfRes
;
// num of output result in current buffer
}
SResultRowCellInfo
;
}
SResultRowCellInfo
;
#define GET_ROWCELL_INTERBUF(_c) ((void*) ((char*)(_c) + sizeof(SResultRowCellInfo)))
#define GET_ROWCELL_INTERBUF(_c) ((void*) ((char*)(_c) + sizeof(SResultRowCellInfo)))
...
...
src/query/src/qAst.c
浏览文件 @
c3773983
...
@@ -32,7 +32,6 @@
...
@@ -32,7 +32,6 @@
#include "tstoken.h"
#include "tstoken.h"
#include "ttokendef.h"
#include "ttokendef.h"
#include "tulog.h"
#include "tulog.h"
#include "tutil.h"
/*
/*
*
*
...
...
src/query/src/qExecutor.c
浏览文件 @
c3773983
...
@@ -1609,7 +1609,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int16_t order
...
@@ -1609,7 +1609,7 @@ static int32_t setupQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv, int16_t order
pRuntimeEnv
->
pCtx
=
(
SQLFunctionCtx
*
)
calloc
(
pQuery
->
numOfOutput
,
sizeof
(
SQLFunctionCtx
));
pRuntimeEnv
->
pCtx
=
(
SQLFunctionCtx
*
)
calloc
(
pQuery
->
numOfOutput
,
sizeof
(
SQLFunctionCtx
));
pRuntimeEnv
->
rowCellInfoOffset
=
calloc
(
pQuery
->
numOfOutput
,
sizeof
(
int32_t
));
pRuntimeEnv
->
rowCellInfoOffset
=
calloc
(
pQuery
->
numOfOutput
,
sizeof
(
int32_t
));
pRuntimeEnv
->
pResultRow
=
getNewResultRow
(
pRuntimeEnv
->
pool
);
//calloc(1, sizeof(SResultRow));
pRuntimeEnv
->
pResultRow
=
getNewResultRow
(
pRuntimeEnv
->
pool
);
if
(
pRuntimeEnv
->
pResultRow
==
NULL
||
pRuntimeEnv
->
pCtx
==
NULL
||
pRuntimeEnv
->
rowCellInfoOffset
==
NULL
)
{
if
(
pRuntimeEnv
->
pResultRow
==
NULL
||
pRuntimeEnv
->
pCtx
==
NULL
||
pRuntimeEnv
->
rowCellInfoOffset
==
NULL
)
{
goto
_clean
;
goto
_clean
;
...
@@ -1745,6 +1745,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
...
@@ -1745,6 +1745,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
pRuntimeEnv
->
pTSBuf
=
tsBufDestroy
(
pRuntimeEnv
->
pTSBuf
);
pRuntimeEnv
->
pTSBuf
=
tsBufDestroy
(
pRuntimeEnv
->
pTSBuf
);
taosTFree
(
pRuntimeEnv
->
keyBuf
);
taosTFree
(
pRuntimeEnv
->
keyBuf
);
taosTFree
(
pRuntimeEnv
->
rowCellInfoOffset
);
taosHashCleanup
(
pRuntimeEnv
->
pResultRowHashTable
);
taosHashCleanup
(
pRuntimeEnv
->
pResultRowHashTable
);
pRuntimeEnv
->
pResultRowHashTable
=
NULL
;
pRuntimeEnv
->
pResultRowHashTable
=
NULL
;
...
...
src/query/src/qFill.c
浏览文件 @
c3773983
...
@@ -170,7 +170,7 @@ int64_t getFilledNumOfRes(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows
...
@@ -170,7 +170,7 @@ int64_t getFilledNumOfRes(SFillInfo* pFillInfo, TSKEY ekey, int32_t maxNumOfRows
int32_t
numOfRows
=
taosNumOfRemainRows
(
pFillInfo
);
int32_t
numOfRows
=
taosNumOfRemainRows
(
pFillInfo
);
TSKEY
ekey1
=
ekey
;
TSKEY
ekey1
=
ekey
;
if
(
pFillInfo
->
order
!=
TSDB_ORDER_ASC
)
{
if
(
!
FILL_IS_ASC_FILL
(
pFillInfo
)
)
{
pFillInfo
->
endKey
=
taosTimeTruncate
(
ekey
,
&
pFillInfo
->
interval
,
pFillInfo
->
precision
);
pFillInfo
->
endKey
=
taosTimeTruncate
(
ekey
,
&
pFillInfo
->
interval
,
pFillInfo
->
precision
);
}
}
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
c3773983
...
@@ -332,7 +332,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
...
@@ -332,7 +332,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
}
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
v
Debug
(
"vgId:%d, invalid handle in retrieving result, code:0x%08x, QInfo:%p"
,
pVnode
->
vgId
,
code
,
(
void
*
)
pRetrieve
->
qhandle
);
v
Error
(
"vgId:%d, invalid handle in retrieving result, code:0x%08x, QInfo:%p"
,
pVnode
->
vgId
,
code
,
(
void
*
)
pRetrieve
->
qhandle
);
vnodeBuildNoResultQueryRsp
(
pRet
);
vnodeBuildNoResultQueryRsp
(
pRet
);
return
code
;
return
code
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录