Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mz丶苗
TDengine
提交
5e1b9faa
T
TDengine
项目概览
Mz丶苗
/
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,发现更多精彩内容 >>
提交
5e1b9faa
编写于
4月 21, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-3902]update the log.
上级
d37fad65
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
175 addition
and
174 deletion
+175
-174
src/client/src/tscAsync.c
src/client/src/tscAsync.c
+7
-7
src/client/src/tscLocalMerge.c
src/client/src/tscLocalMerge.c
+7
-7
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+2
-2
src/client/src/tscProfile.c
src/client/src/tscProfile.c
+5
-5
src/client/src/tscSQLParser.c
src/client/src/tscSQLParser.c
+6
-6
src/client/src/tscServer.c
src/client/src/tscServer.c
+34
-34
src/client/src/tscSql.c
src/client/src/tscSql.c
+11
-11
src/client/src/tscStream.c
src/client/src/tscStream.c
+15
-15
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+76
-75
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+12
-12
未找到文件。
src/client/src/tscAsync.c
浏览文件 @
5e1b9faa
...
...
@@ -283,7 +283,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
static
void
tscAsyncResultCallback
(
SSchedMsg
*
pMsg
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
taosAcquireRef
(
tscObjRef
,
(
int64_t
)
pMsg
->
ahandle
);
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
tscDebug
(
"
%p SqlObj is freed, not add into queue async res"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" SqlObj is freed, not add into queue async res"
,
pSql
->
self
);
return
;
}
...
...
@@ -372,13 +372,13 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
goto
_error
;
}
tscDebug
(
"
%p get %s successfully"
,
pSql
,
msg
);
tscDebug
(
"
0x%"
PRIx64
" get %s successfully"
,
pSql
->
self
,
msg
);
if
(
pSql
->
pStream
==
NULL
)
{
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
// check if it is a sub-query of super table query first, if true, enter another routine
if
(
TSDB_QUERY_HAS_TYPE
(
pQueryInfo
->
type
,
(
TSDB_QUERY_TYPE_STABLE_SUBQUERY
|
TSDB_QUERY_TYPE_SUBQUERY
|
TSDB_QUERY_TYPE_TAG_FILTER_QUERY
)))
{
tscDebug
(
"
%p update local table meta, continue to process sql and send the corresponding query"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" update local table meta, continue to process sql and send the corresponding query"
,
pSql
->
self
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
...
...
@@ -402,7 +402,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
return
;
}
else
{
// continue to process normal async query
if
(
pCmd
->
parseFinished
)
{
tscDebug
(
"
%p update local table meta, continue to process sql and send corresponding query"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" update local table meta, continue to process sql and send corresponding query"
,
pSql
->
self
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
code
=
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
...
...
@@ -416,7 +416,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
assert
(
pCmd
->
command
!=
TSDB_SQL_INSERT
);
if
(
pCmd
->
command
==
TSDB_SQL_SELECT
)
{
tscDebug
(
"
%p redo parse sql string and proceed"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" redo parse sql string and proceed"
,
pSql
->
self
);
pCmd
->
parseFinished
=
false
;
tscResetSqlCmd
(
pCmd
,
true
);
...
...
@@ -436,7 +436,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
return
;
}
else
{
tscDebug
(
"
%p continue parse sql after get table meta"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" continue parse sql after get table meta"
,
pSql
->
self
);
code
=
tsParseSql
(
pSql
,
false
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
...
...
@@ -486,7 +486,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
}
}
tscDebug
(
"
%p stream:%p meta is updated, start new query, command:%d"
,
pSql
,
pSql
->
pStream
,
pSql
->
cmd
.
command
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p meta is updated, start new query, command:%d"
,
pSql
->
self
,
pSql
->
pStream
,
pSql
->
cmd
.
command
);
if
(
!
pSql
->
cmd
.
parseFinished
)
{
tsParseSql
(
pSql
,
false
);
}
...
...
src/client/src/tscLocalMerge.c
浏览文件 @
5e1b9faa
...
...
@@ -193,7 +193,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
int32_t
len
=
pMemBuffer
[
i
]
->
fileMeta
.
flushoutData
.
nLength
;
if
(
len
==
0
)
{
tscDebug
(
"
%p no data retrieved from orderOfVnode:%d"
,
pSql
,
i
+
1
);
tscDebug
(
"
0x%"
PRIx64
" no data retrieved from orderOfVnode:%d"
,
pSql
->
self
,
i
+
1
);
continue
;
}
...
...
@@ -203,7 +203,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
if
(
numOfFlush
==
0
||
numOfBuffer
==
0
)
{
tscLocalReducerEnvDestroy
(
pMemBuffer
,
pDesc
,
finalmodel
,
pFFModel
,
numOfBuffer
);
pCmd
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
// no result, set the result empty
tscDebug
(
"
%p retrieved no data"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" retrieved no data"
,
pSql
->
self
);
return
;
}
...
...
@@ -235,7 +235,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
pReducer
->
numOfVnode
=
numOfBuffer
;
pReducer
->
pDesc
=
pDesc
;
tscDebug
(
"
%p the number of merged leaves is: %d"
,
pSql
,
pReducer
->
numOfBuffer
);
tscDebug
(
"
0x%"
PRIx64
" the number of merged leaves is: %d"
,
pSql
->
self
,
pReducer
->
numOfBuffer
);
int32_t
idx
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
...
...
@@ -258,7 +258,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
ds
->
pageId
=
0
;
ds
->
rowIdx
=
0
;
tscDebug
(
"
%p load data from disk into memory, orderOfVnode:%d, total:%d"
,
pSql
,
i
+
1
,
idx
+
1
);
tscDebug
(
"
0x%"
PRIx64
" load data from disk into memory, orderOfVnode:%d, total:%d"
,
pSql
->
self
,
i
+
1
,
idx
+
1
);
tExtMemBufferLoadData
(
pMemBuffer
[
i
],
&
(
ds
->
filePage
),
j
,
0
);
#ifdef _DEBUG_VIEW
printf
(
"load data page into mem for build loser tree: %"
PRIu64
" rows
\n
"
,
ds
->
filePage
.
num
);
...
...
@@ -272,7 +272,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
#endif
if
(
ds
->
filePage
.
num
==
0
)
{
// no data in this flush, the index does not increase
tscDebug
(
"
%p flush data is empty, ignore %d flush record"
,
pSql
,
idx
);
tscDebug
(
"
0x%"
PRIx64
" flush data is empty, ignore %d flush record"
,
pSql
->
self
,
idx
);
tfree
(
ds
);
continue
;
}
...
...
@@ -547,10 +547,10 @@ void tscDestroyLocalMerger(SSqlObj *pSql) {
pLocalMerge
->
numOfCompleted
=
0
;
free
(
pLocalMerge
);
}
else
{
tscDebug
(
"
%p already freed or another free function is invoked"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" already freed or another free function is invoked"
,
pSql
->
self
);
}
tscDebug
(
"
%p free local reducer finished"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" free local reducer finished"
,
pSql
->
self
);
}
static
int32_t
createOrderDescriptor
(
tOrderDescriptor
**
pOrderDesc
,
SSqlCmd
*
pCmd
,
SColumnModel
*
pModel
)
{
...
...
src/client/src/tscParseInsert.c
浏览文件 @
5e1b9faa
...
...
@@ -1089,7 +1089,7 @@ int tsParseInsertSql(SSqlObj *pSql) {
str
=
pCmd
->
curSql
;
}
tscDebug
(
"
%p create data block list hashList:%p"
,
pSql
,
pCmd
->
pTableBlockHashList
);
tscDebug
(
"
0x%"
PRIx64
" create data block list hashList:%p"
,
pSql
->
self
,
pCmd
->
pTableBlockHashList
);
while
(
1
)
{
int32_t
index
=
0
;
...
...
@@ -1303,7 +1303,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
if
((
!
pCmd
->
parseFinished
)
&&
(
!
initial
))
{
tscDebug
(
"
%p resume to parse sql: %s"
,
pSql
,
pCmd
->
curSql
);
tscDebug
(
"
0x%"
PRIx64
" resume to parse sql: %s"
,
pSql
->
self
,
pCmd
->
curSql
);
}
ret
=
tscAllocPayload
(
&
pSql
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
...
...
src/client/src/tscProfile.c
浏览文件 @
5e1b9faa
...
...
@@ -61,7 +61,7 @@ void tscAddIntoSqlList(SSqlObj *pSql) {
pSql
->
stime
=
taosGetTimestampMs
();
pSql
->
listed
=
1
;
tscDebug
(
"
%p added into sqlList"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" added into sqlList"
,
pSql
->
self
);
}
void
tscSaveSlowQueryFpCb
(
void
*
param
,
TAOS_RES
*
result
,
int
code
)
{
...
...
@@ -99,7 +99,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
return
;
}
tscDebug
(
"
%p query time:%"
PRId64
" sql:%s"
,
pSql
,
pSql
->
res
.
useconds
,
pSql
->
sqlstr
);
tscDebug
(
"
0x%"
PRIx64
" query time:%"
PRId64
" sql:%s"
,
pSql
->
self
,
pSql
->
res
.
useconds
,
pSql
->
sqlstr
);
int32_t
sqlSize
=
(
int32_t
)(
TSDB_SLOW_QUERY_SQL_LEN
+
size
);
char
*
sql
=
malloc
(
sqlSize
);
...
...
@@ -141,7 +141,7 @@ void tscRemoveFromSqlList(SSqlObj *pSql) {
pSql
->
listed
=
0
;
tscSaveSlowQuery
(
pSql
);
tscDebug
(
"
%p removed from sqlList"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" removed from sqlList"
,
pSql
->
self
);
}
void
tscKillQuery
(
STscObj
*
pObj
,
uint32_t
killId
)
{
...
...
@@ -158,7 +158,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) {
if
(
pSql
==
NULL
)
{
tscError
(
"failed to kill query, id:%d, it may have completed/terminated"
,
killId
);
}
else
{
tscDebug
(
"
%p query is killed, queryId:%d"
,
pSql
,
killId
);
tscDebug
(
"
0x%"
PRIx64
" query is killed, queryId:%d"
,
pSql
->
self
,
killId
);
taos_stop_query
(
pSql
);
}
}
...
...
@@ -213,7 +213,7 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
pthread_mutex_unlock
(
&
pObj
->
mutex
);
if
(
pStream
)
{
tscDebug
(
"
%p stream:%p is killed, streamId:%d"
,
pStream
->
pSql
,
pStream
,
killId
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p is killed, streamId:%d"
,
pStream
->
pSql
->
self
,
pStream
,
killId
);
if
(
pStream
->
callback
)
{
pStream
->
callback
(
pStream
->
param
);
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
5e1b9faa
...
...
@@ -5508,15 +5508,15 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
pQueryInfo
->
clauseLimit
=
pQueryInfo
->
limit
.
limit
;
pQueryInfo
->
slimit
=
pQuerySqlNode
->
slimit
;
tscDebug
(
"
%p limit:%"
PRId64
", offset:%"
PRId64
" slimit:%"
PRId64
", soffset:%"
PRId64
,
pSql
,
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
slimit
.
limit
,
pQueryInfo
->
slimit
.
offset
);
tscDebug
(
"
0x%"
PRIx64
" limit:%"
PRId64
", offset:%"
PRId64
" slimit:%"
PRId64
", soffset:%"
PRId64
,
pSql
->
self
,
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
slimit
.
limit
,
pQueryInfo
->
slimit
.
offset
);
if
(
pQueryInfo
->
slimit
.
offset
<
0
||
pQueryInfo
->
limit
.
offset
<
0
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg0
);
}
if
(
pQueryInfo
->
limit
.
limit
==
0
)
{
tscDebug
(
"
%p limit 0, no output result"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" limit 0, no output result"
,
pSql
->
self
);
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -5538,7 +5538,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
}
if
(
pQueryInfo
->
slimit
.
limit
==
0
)
{
tscDebug
(
"
%p slimit 0, no output result"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" slimit 0, no output result"
,
pSql
->
self
);
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -5556,7 +5556,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
// No tables included. No results generated. Query results are empty.
if
(
pTableMetaInfo
->
vgroupList
->
numOfVgroups
==
0
)
{
tscDebug
(
"
%p no table in super table, no output result"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" no table in super table, no output result"
,
pSql
->
self
);
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -6351,7 +6351,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
assert
(
offset
<
totalBufSize
);
str
[
offset
]
=
']'
;
assert
(
offset
<
totalBufSize
);
tscDebug
(
"
%p select clause:%s"
,
pSql
,
str
);
tscDebug
(
"
0x%"
PRIx64
" select clause:%s"
,
pSql
->
self
,
str
);
}
int32_t
doCheckForCreateTable
(
SSqlObj
*
pSql
,
int32_t
subClauseIndex
,
SSqlInfo
*
pInfo
)
{
...
...
src/client/src/tscServer.c
浏览文件 @
5e1b9faa
...
...
@@ -147,7 +147,7 @@ static void tscUpdateVgroupInfo(SSqlObj *pSql, SRpcEpSet *pEpSet) {
// Update the local cached epSet info cached by SqlObj
int32_t
inUse
=
pSql
->
epSet
.
inUse
;
tscDumpEpSetFromVgroupInfo
(
&
pSql
->
epSet
,
&
vgroupInfo
);
tscDebug
(
"
%p update the epSet in SqlObj, in use before:%d, after:%d"
,
pSql
,
inUse
,
pSql
->
epSet
.
inUse
);
tscDebug
(
"
0x%"
PRIx64
" update the epSet in SqlObj, in use before:%d, after:%d"
,
pSql
->
self
,
inUse
,
pSql
->
epSet
.
inUse
);
}
...
...
@@ -245,11 +245,11 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if
(
pObj
->
hbrid
!=
0
)
{
int32_t
waitingDuring
=
tsShellActivityTimer
*
500
;
tscDebug
(
"
%p send heartbeat in %dms"
,
pSql
,
waitingDuring
);
tscDebug
(
"
0x%"
PRIx64
" send heartbeat in %dms"
,
pSql
->
self
,
waitingDuring
);
taosTmrReset
(
tscProcessActivityTimer
,
waitingDuring
,
(
void
*
)
pObj
->
rid
,
tscTmr
,
&
pObj
->
pTimer
);
}
else
{
tscDebug
(
"
%p start to close tscObj:%p, not send heartbeat again"
,
pSql
,
pObj
);
tscDebug
(
"
0x%"
PRIx64
" start to close tscObj:%p, not send heartbeat again"
,
pSql
->
self
,
pObj
);
}
}
...
...
@@ -326,7 +326,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pSql
->
rpcRid
=
-
1
;
if
(
pObj
->
signature
!=
pObj
)
{
tscDebug
(
"
%p DB connection is closed, cmd:%d pObj:%p signature:%p"
,
pSql
,
pCmd
->
command
,
pObj
,
pObj
->
signature
);
tscDebug
(
"
0x%"
PRIx64
" DB connection is closed, cmd:%d pObj:%p signature:%p"
,
pSql
->
self
,
pCmd
->
command
,
pObj
,
pObj
->
signature
);
taosRemoveRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
...
@@ -336,8 +336,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
if
(
pQueryInfo
!=
NULL
&&
pQueryInfo
->
type
==
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
tscDebug
(
"
%p
sqlObj needs to be released or DB connection is closed, cmd:%d type:%d, pObj:%p signature:%p"
,
pSql
,
pCmd
->
command
,
pQueryInfo
->
type
,
pObj
,
pObj
->
signature
);
tscDebug
(
"
0x%"
PRIx64
"
sqlObj needs to be released or DB connection is closed, cmd:%d type:%d, pObj:%p signature:%p"
,
pSql
->
self
,
pCmd
->
command
,
pQueryInfo
->
type
,
pObj
,
pObj
->
signature
);
taosRemoveRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
...
@@ -396,13 +396,13 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pRes
->
rspLen
=
0
;
if
(
pRes
->
code
==
TSDB_CODE_TSC_QUERY_CANCELLED
)
{
tscDebug
(
"
%p query is cancelled, code:%s"
,
pSql
,
tstrerror
(
pRes
->
code
));
tscDebug
(
"
0x%"
PRIx64
" query is cancelled, code:%s"
,
pSql
->
self
,
tstrerror
(
pRes
->
code
));
}
else
{
pRes
->
code
=
rpcMsg
->
code
;
}
if
(
pRes
->
code
==
TSDB_CODE_SUCCESS
)
{
tscDebug
(
"
%p reset retry counter to be 0 due to success rsp, old:%d"
,
pSql
,
pSql
->
retry
);
tscDebug
(
"
0x%"
PRIx64
" reset retry counter to be 0 due to success rsp, old:%d"
,
pSql
->
self
,
pSql
->
retry
);
pSql
->
retry
=
0
;
}
...
...
@@ -437,10 +437,10 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pMsg
->
numOfFailedBlocks
=
htonl
(
pMsg
->
numOfFailedBlocks
);
pRes
->
numOfRows
+=
pMsg
->
affectedRows
;
tscDebug
(
"
%p SQL cmd:%s, code:%s inserted rows:%d rspLen:%d"
,
pSql
,
sqlCmd
[
pCmd
->
command
],
tscDebug
(
"
0x%"
PRIx64
" SQL cmd:%s, code:%s inserted rows:%d rspLen:%d"
,
pSql
->
self
,
sqlCmd
[
pCmd
->
command
],
tstrerror
(
pRes
->
code
),
pMsg
->
affectedRows
,
pRes
->
rspLen
);
}
else
{
tscDebug
(
"
%p SQL cmd:%s, code:%s rspLen:%d"
,
pSql
,
sqlCmd
[
pCmd
->
command
],
tstrerror
(
pRes
->
code
),
pRes
->
rspLen
);
tscDebug
(
"
0x%"
PRIx64
" SQL cmd:%s, code:%s rspLen:%d"
,
pSql
->
self
,
sqlCmd
[
pCmd
->
command
],
tstrerror
(
pRes
->
code
),
pRes
->
rspLen
);
}
}
...
...
@@ -461,7 +461,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
if
(
shouldFree
)
{
// in case of table-meta/vgrouplist query, automatically free it
taosRemoveRef
(
tscObjRef
,
handle
);
tscDebug
(
"
%p sqlObj is automatically freed"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" sqlObj is automatically freed"
,
pSql
->
self
);
}
taosReleaseRef
(
tscObjRef
,
handle
);
...
...
@@ -522,7 +522,7 @@ int tscProcessSql(SSqlObj *pSql) {
assert
((
pQueryInfo
->
numOfTables
==
0
&&
pQueryInfo
->
command
==
TSDB_SQL_HB
)
||
pQueryInfo
->
numOfTables
>
0
);
}
tscDebug
(
"
%p SQL cmd:%s will be processed, name:%s, type:%d"
,
pSql
,
sqlCmd
[
pCmd
->
command
],
name
,
type
);
tscDebug
(
"
0x%"
PRIx64
" SQL cmd:%s will be processed, name:%s, type:%d"
,
pSql
->
self
,
sqlCmd
[
pCmd
->
command
],
name
,
type
);
if
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
// the pTableMetaInfo cannot be NULL
if
(
pTableMetaInfo
==
NULL
)
{
pSql
->
res
.
code
=
TSDB_CODE_TSC_APP_ERROR
;
...
...
@@ -562,11 +562,11 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
pRetrieveMsg
->
header
.
vgId
=
htonl
(
vgId
);
tscDebug
(
"
%p build fetch msg from vgId:%d, vgIndex:%d, qId:%"
PRIu64
,
pSql
,
vgId
,
vgIndex
,
pSql
->
res
.
qId
);
tscDebug
(
"
0x%"
PRIx64
" build fetch msg from vgId:%d, vgIndex:%d, qId:%"
PRIu64
,
pSql
->
self
,
vgId
,
vgIndex
,
pSql
->
res
.
qId
);
}
else
{
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pTableMeta
->
vgId
);
tscDebug
(
"
%p build fetch msg from only one vgroup, vgId:%d, qId:%"
PRIu64
,
pSql
,
pTableMeta
->
vgId
,
pSql
->
res
.
qId
);
tscDebug
(
"
0x%"
PRIx64
" build fetch msg from only one vgroup, vgId:%d, qId:%"
PRIu64
,
pSql
->
self
,
pTableMeta
->
vgId
,
pSql
->
res
.
qId
);
}
pSql
->
cmd
.
payloadLen
=
sizeof
(
SRetrieveTableMsg
);
...
...
@@ -605,7 +605,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
taosHashGetClone
(
tscVgroupMap
,
&
pTableMeta
->
vgId
,
sizeof
(
pTableMeta
->
vgId
),
NULL
,
&
vgroupInfo
,
sizeof
(
SNewVgroupInfo
));
tscDumpEpSetFromVgroupInfo
(
&
pSql
->
epSet
,
&
vgroupInfo
);
tscDebug
(
"
%p build submit msg, vgId:%d numOfTables:%d numberOfEP:%d"
,
pSql
,
pTableMeta
->
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
tscDebug
(
"
0x%"
PRIx64
" build submit msg, vgId:%d numOfTables:%d numberOfEP:%d"
,
pSql
->
self
,
pTableMeta
->
vgId
,
pSql
->
cmd
.
numOfTablesInSubmit
,
pSql
->
epSet
.
numOfEps
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -671,7 +671,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
vgId
=
pVgroupInfo
->
vgId
;
tscSetDnodeEpSet
(
&
pSql
->
epSet
,
pVgroupInfo
);
tscDebug
(
"
%p query on stable, vgIndex:%d, numOfVgroups:%d"
,
pSql
,
index
,
pTableMetaInfo
->
vgroupList
->
numOfVgroups
);
tscDebug
(
"
0x%"
PRIx64
" query on stable, vgIndex:%d, numOfVgroups:%d"
,
pSql
->
self
,
index
,
pTableMetaInfo
->
vgroupList
->
numOfVgroups
);
}
else
{
vgId
=
pTableMeta
->
vgId
;
...
...
@@ -704,7 +704,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pTableIdList
->
itemList
);
pQueryMsg
->
numOfTables
=
htonl
(
numOfTables
);
// set the number of tables
tscDebug
(
"
%p query on stable, vgId:%d, numOfTables:%d, vgIndex:%d, numOfVgroups:%d"
,
pSql
,
tscDebug
(
"
0x%"
PRIx64
" query on stable, vgId:%d, numOfTables:%d, vgIndex:%d, numOfVgroups:%d"
,
pSql
->
self
,
pTableIdList
->
vgInfo
.
vgId
,
numOfTables
,
index
,
numOfVgroups
);
// serialize each table id info
...
...
@@ -722,7 +722,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
char
n
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
n
);
tscDebug
(
"
%p vgId:%d, query on table:%s, tid:%d, uid:%"
PRIu64
,
pSql
,
htonl
(
pQueryMsg
->
head
.
vgId
),
n
,
pTableMeta
->
id
.
tid
,
pTableMeta
->
id
.
uid
);
tscDebug
(
"
0x%"
PRIx64
" vgId:%d, query on table:%s, tid:%d, uid:%"
PRIu64
,
pSql
->
self
,
htonl
(
pQueryMsg
->
head
.
vgId
),
n
,
pTableMeta
->
id
.
tid
,
pTableMeta
->
id
.
uid
);
return
pMsg
;
}
...
...
@@ -1139,7 +1139,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
msgLen
=
(
int32_t
)(
pMsg
-
pCmd
->
payload
);
tscDebug
(
"
%p msg built success, len:%d bytes"
,
pSql
,
msgLen
);
tscDebug
(
"
0x%"
PRIx64
" msg built success, len:%d bytes"
,
pSql
->
self
,
msgLen
);
pCmd
->
payloadLen
=
msgLen
;
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
...
...
@@ -1837,7 +1837,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
assert(pCmd->payloadLen + minMsgSize() <= pCmd->allocSize);
tscDebug("
%p build load multi-metermeta msg completed, numOfTables:%d, msg size:%d", pSql
, pCmd->count,
tscDebug("
0x%"PRIx64" build load multi-metermeta msg completed, numOfTables:%d, msg size:%d", pSql->self
, pCmd->count,
pCmd->payloadLen);
return pCmd->payloadLen;
...
...
@@ -2017,7 +2017,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
}
}
tscDebug
(
"
%p recv table meta, uid:%"
PRIu64
", tid:%d, name:%s"
,
pSql
,
pTableMeta
->
id
.
uid
,
pTableMeta
->
id
.
tid
,
tscDebug
(
"
0x%"
PRIx64
" recv table meta, uid:%"
PRIu64
", tid:%d, name:%s"
,
pSql
->
self
,
pTableMeta
->
id
.
uid
,
pTableMeta
->
id
.
tid
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
free
(
pTableMeta
);
...
...
@@ -2124,7 +2124,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
pSql->res.code = TSDB_CODE_SUCCESS;
pSql->res.numOfTotal = i;
tscDebug("
%p load multi-metermeta resp from complete num:%d", pSql
, pSql->res.numOfTotal);
tscDebug("
0x%"PRIx64" load multi-metermeta resp from complete num:%d", pSql->self
, pSql->res.numOfTotal);
#endif
return
TSDB_CODE_SUCCESS
;
...
...
@@ -2292,7 +2292,7 @@ static void createHbObj(STscObj* pObj) {
pSql
->
signature
=
pSql
;
registerSqlObj
(
pSql
);
tscDebug
(
"
%p HB is allocated, pObj:%p"
,
pSql
,
pObj
);
tscDebug
(
"
0x%"
PRIx64
" HB is allocated, pObj:%p"
,
pSql
->
self
,
pObj
);
pObj
->
hbrid
=
pSql
->
self
;
}
...
...
@@ -2318,7 +2318,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
tscUpdateMgmtEpSet
(
pSql
,
&
pConnect
->
epSet
);
for
(
int
i
=
0
;
i
<
pConnect
->
epSet
.
numOfEps
;
++
i
)
{
tscDebug
(
"
%p epSet.fqdn[%d]: %s, pObj:%p"
,
pSql
,
i
,
pConnect
->
epSet
.
fqdn
[
i
],
pObj
);
tscDebug
(
"
0x%"
PRIx64
" epSet.fqdn[%d]: %s, pObj:%p"
,
pSql
->
self
,
i
,
pConnect
->
epSet
.
fqdn
[
i
],
pObj
);
}
}
...
...
@@ -2362,7 +2362,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) {
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
tscDebug
(
"
%p remove table meta after drop table:%s, numOfRemain:%d"
,
pSql
,
name
,
(
int32_t
)
taosHashGetSize
(
tscTableMetaInfo
));
tscDebug
(
"
0x%"
PRIx64
" remove table meta after drop table:%s, numOfRemain:%d"
,
pSql
->
self
,
name
,
(
int32_t
)
taosHashGetSize
(
tscTableMetaInfo
));
pTableMetaInfo
->
pTableMeta
=
NULL
;
return
0
;
...
...
@@ -2374,7 +2374,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
tscDebug
(
"
%p remove tableMeta in hashMap after alter-table: %s"
,
pSql
,
name
);
tscDebug
(
"
0x%"
PRIx64
" remove tableMeta in hashMap after alter-table: %s"
,
pSql
->
self
,
name
);
bool
isSuperTable
=
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
);
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
...
...
@@ -2405,7 +2405,7 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
pRes
->
data
=
NULL
;
tscResetForNextRetrieve
(
pRes
);
tscDebug
(
"
%p query rsp received, qId:%"
PRIu64
,
pSql
,
pRes
->
qId
);
tscDebug
(
"
0x%"
PRIx64
" query rsp received, qId:%"
PRIu64
,
pSql
->
self
,
pRes
->
qId
);
return
0
;
}
...
...
@@ -2463,7 +2463,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
}
pRes
->
row
=
0
;
tscDebug
(
"
%p numOfRows:%d, offset:%"
PRId64
", complete:%d, qId:%"
PRIu64
,
pSql
,
pRes
->
numOfRows
,
pRes
->
offset
,
tscDebug
(
"
0x%"
PRIx64
" numOfRows:%d, offset:%"
PRId64
", complete:%d, qId:%"
PRIu64
,
pSql
->
self
,
pRes
->
numOfRows
,
pRes
->
offset
,
pRes
->
completed
,
pRes
->
qId
);
return
0
;
...
...
@@ -2507,14 +2507,14 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn
}
}
tscDebug
(
"%p new pSqlObj:%p to get tableMeta, auto create:%d"
,
pSql
,
pNew
,
pNew
->
cmd
.
autoCreated
);
registerSqlObj
(
pNew
);
tscDebug
(
"0x%"
PRIx64
" new pSqlObj:0x%"
PRIx64
" to get tableMeta, auto create:%d"
,
pSql
->
self
,
pNew
->
self
,
pNew
->
cmd
.
autoCreated
);
pNew
->
fp
=
tscTableMetaCallBack
;
pNew
->
param
=
(
void
*
)
pSql
->
self
;
tscDebug
(
"
%p metaRid from %"
PRId64
" to %"
PRId64
,
pSql
,
pSql
->
metaRid
,
pNew
->
self
);
tscDebug
(
"
0x%"
PRIx64
" metaRid from %"
PRId64
" to %"
PRId64
,
pSql
->
self
,
pSql
->
metaRid
,
pNew
->
self
);
pSql
->
metaRid
=
pNew
->
self
;
...
...
@@ -2585,7 +2585,7 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
pTableMeta
)
{
tscDebug
(
"
%p update table meta:%s, old meta numOfTags:%d, numOfCols:%d, uid:%"
PRId64
,
pSql
,
name
,
tscDebug
(
"
0x%"
PRIx64
" update table meta:%s, old meta numOfTags:%d, numOfCols:%d, uid:%"
PRId64
,
pSql
->
self
,
name
,
tscGetNumOfTags
(
pTableMeta
),
tscGetNumOfColumns
(
pTableMeta
),
pTableMeta
->
id
.
uid
);
}
...
...
@@ -2645,12 +2645,12 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
pNewQueryInfo
->
numOfTables
=
pQueryInfo
->
numOfTables
;
registerSqlObj
(
pNew
);
tscDebug
(
"
%p svgroupRid from %"
PRId64
" to %"
PRId64
,
pSql
,
pSql
->
svgroupRid
,
pNew
->
self
);
tscDebug
(
"
0x%"
PRIx64
" svgroupRid from %"
PRId64
" to %"
PRId64
,
pSql
->
self
,
pSql
->
svgroupRid
,
pNew
->
self
);
pSql
->
svgroupRid
=
pNew
->
self
;
tscDebug
(
"
%p new sqlObj:%p to get vgroupInfo, numOfTables:%d"
,
pSql
,
pNew
,
pNewQueryInfo
->
numOfTables
);
tscDebug
(
"
0x%"
PRIx64
" new sqlObj:%p to get vgroupInfo, numOfTables:%d"
,
pSql
->
self
,
pNew
,
pNewQueryInfo
->
numOfTables
);
pNew
->
fp
=
tscTableMetaCallBack
;
pNew
->
param
=
(
void
*
)
pSql
->
self
;
...
...
src/client/src/tscSql.c
浏览文件 @
5e1b9faa
...
...
@@ -292,7 +292,7 @@ void taos_close(TAOS *taos) {
pHb
->
rpcRid
=
-
1
;
}
tscDebug
(
"
%p HB is freed"
,
pHb
);
tscDebug
(
"
0x%"
PRIx64
" HB is freed"
,
pHb
->
self
);
taosReleaseRef
(
tscObjRef
,
pHb
->
self
);
#ifdef __APPLE__
// to satisfy later tsem_destroy in taos_free_result
...
...
@@ -576,7 +576,7 @@ static bool tscKillQueryInDnode(SSqlObj* pSql) {
cmd
==
TSDB_SQL_FETCH
))
{
pQueryInfo
->
type
=
TSDB_QUERY_TYPE_FREE_RESOURCE
;
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
tscDebug
(
"
%p send msg to dnode to free qhandle ASAP before free sqlObj, command:%s"
,
pSql
,
sqlCmd
[
pCmd
->
command
]);
tscDebug
(
"
0x%"
PRIx64
" send msg to dnode to free qhandle ASAP before free sqlObj, command:%s"
,
pSql
->
self
,
sqlCmd
[
pCmd
->
command
]);
tscProcessSql
(
pSql
);
return
false
;
...
...
@@ -594,7 +594,7 @@ void taos_free_result(TAOS_RES *res) {
bool
freeNow
=
tscKillQueryInDnode
(
pSql
);
if
(
freeNow
)
{
tscDebug
(
"
%p free sqlObj in cache"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" free sqlObj in cache"
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
}
}
...
...
@@ -708,7 +708,7 @@ static void tscKillSTableQuery(SSqlObj *pSql) {
tscUnlockByThread
(
&
pSql
->
squeryLock
);
tscDebug
(
"
%p super table query cancelled"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" super table query cancelled"
,
pSql
->
self
);
}
void
taos_stop_query
(
TAOS_RES
*
res
)
{
...
...
@@ -717,7 +717,7 @@ void taos_stop_query(TAOS_RES *res) {
return
;
}
tscDebug
(
"
%p start to cancel query"
,
res
);
tscDebug
(
"
0x%"
PRIx64
" start to cancel query"
,
pSql
->
self
);
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
// set the error code for master pSqlObj firstly
...
...
@@ -744,7 +744,7 @@ void taos_stop_query(TAOS_RES *res) {
}
}
tscDebug
(
"
%p query is cancelled"
,
res
);
tscDebug
(
"
0x%"
PRIx64
" query is cancelled"
,
pSql
->
self
);
}
bool
taos_is_null
(
TAOS_RES
*
res
,
int32_t
row
,
int32_t
col
)
{
...
...
@@ -877,7 +877,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes
->
numOfClauseTotal
=
0
;
tscDebug
(
"
%p Valid SQL: %s pObj:%p"
,
pSql
,
sql
,
pObj
);
tscDebug
(
"
0x%"
PRIx64
" Valid SQL: %s pObj:%p"
,
pSql
->
self
,
sql
,
pObj
);
int32_t
sqlLen
=
(
int32_t
)
strlen
(
sql
);
if
(
sqlLen
>
tsMaxSQLStringLen
)
{
...
...
@@ -889,7 +889,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pSql
->
sqlstr
=
realloc
(
pSql
->
sqlstr
,
sqlLen
+
1
);
if
(
pSql
->
sqlstr
==
NULL
)
{
tscError
(
"%p failed to malloc sql string buffer"
,
pSql
);
tscDebug
(
"
%p Valid SQL result:%d, %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
pSql
),
pObj
);
tscDebug
(
"
0x%"
PRIx64
" Valid SQL result:%d, %s pObj:%p"
,
pSql
->
self
,
pRes
->
code
,
taos_errstr
(
pSql
),
pObj
);
tfree
(
pSql
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
...
...
@@ -914,7 +914,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
tscDebug
(
"
%p Valid SQL result:%d, %s pObj:%p"
,
pSql
,
code
,
taos_errstr
(
pSql
),
pObj
);
tscDebug
(
"
0x%"
PRIx64
" Valid SQL result:%d, %s pObj:%p"
,
pSql
->
self
,
code
,
taos_errstr
(
pSql
),
pObj
);
}
taos_free_result
(
pSql
);
...
...
@@ -1027,7 +1027,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
pRes
->
numOfClauseTotal
=
0
;
assert
(
pSql
->
fp
==
NULL
);
tscDebug
(
"
%p tableNameList: %s pObj:%p"
,
pSql
,
tableNameList
,
pObj
);
tscDebug
(
"
0x%"
PRIx64
" tableNameList: %s pObj:%p"
,
pSql
->
self
,
tableNameList
,
pObj
);
int32_t
tblListLen
=
(
int32_t
)
strlen
(
tableNameList
);
if
(
tblListLen
>
MAX_TABLE_NAME_LENGTH
)
{
...
...
@@ -1061,7 +1061,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
tscDoQuery
(
pSql
);
tscDebug
(
"
%p load multi table meta result:%d %s pObj:%p"
,
pSql
,
pRes
->
code
,
taos_errstr
(
pSql
),
pObj
);
tscDebug
(
"
0x%"
PRIx64
" load multi table meta result:%d %s pObj:%p"
,
pSql
->
self
,
pRes
->
code
,
taos_errstr
(
pSql
),
pObj
);
if
((
code
=
pRes
->
code
)
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObj
(
pSql
);
}
...
...
src/client/src/tscStream.c
浏览文件 @
5e1b9faa
...
...
@@ -70,7 +70,7 @@ static void setRetryInfo(SSqlStream* pStream, int32_t code) {
pSql
->
res
.
code
=
code
;
int64_t
retryDelayTime
=
tscGetRetryDelayTime
(
pStream
,
pStream
->
interval
.
sliding
,
pStream
->
precision
);
tscDebug
(
"
%p stream:%p, get table Meta failed, retry in %"
PRId64
"ms"
,
pSql
,
pStream
,
retryDelayTime
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p, get table Meta failed, retry in %"
PRId64
"ms"
,
pSql
->
self
,
pStream
,
retryDelayTime
);
tscSetRetryTimer
(
pStream
,
pSql
,
retryDelayTime
);
}
...
...
@@ -104,7 +104,7 @@ static void doLaunchQuery(void* param, TAOS_RES* tres, int32_t code) {
// failed to get table Meta or vgroup list, retry in 10sec.
if
(
code
==
TSDB_CODE_SUCCESS
)
{
tscTansformFuncForSTableQuery
(
pQueryInfo
);
tscDebug
(
"
%p stream:%p, start stream query on:%s"
,
pSql
,
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
tscDebug
(
"
0x%"
PRIx64
" stream:%p, start stream query on:%s"
,
pSql
->
self
,
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
pSql
->
fp
=
tscProcessStreamQueryCallback
;
pSql
->
fetchFp
=
tscProcessStreamQueryCallback
;
...
...
@@ -131,7 +131,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) {
pStream
->
numOfRes
=
0
;
// reset the numOfRes.
SSqlObj
*
pSql
=
pStream
->
pSql
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
tscDebug
(
"
%p add into timer"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" add into timer"
,
pSql
->
self
);
if
(
pStream
->
isProject
)
{
/*
...
...
@@ -237,7 +237,7 @@ static void tscStreamFillTimeGap(SSqlStream* pStream, TSKEY ts) {
}
if (rowNum > 0) {
tscDebug("
%p
stream:%p %d rows padded", pSql, pStream, rowNum);
tscDebug("
0x%"PRIx64"
stream:%p %d rows padded", pSql, pStream, rowNum);
}
pRes->numOfRows = 0;
...
...
@@ -263,7 +263,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
TAOS_ROW
row
=
taos_fetch_row
(
res
);
if
(
row
!=
NULL
)
{
tscDebug
(
"
%p stream:%p fetch result"
,
pSql
,
pStream
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p fetch result"
,
pSql
->
self
,
pStream
);
tscStreamFillTimeGap
(
pStream
,
*
(
TSKEY
*
)
row
[
0
]);
pStream
->
stime
=
*
(
TSKEY
*
)
row
[
0
];
// user callback function
...
...
@@ -293,7 +293,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
pStream
->
stime
+=
1
;
}
tscDebug
(
"
%p stream:%p, query on:%s, fetch result completed, fetched rows:%"
PRId64
,
pSql
,
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
),
tscDebug
(
"
0x%"
PRIx64
" stream:%p, query on:%s, fetch result completed, fetched rows:%"
PRId64
,
pSql
->
self
,
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
),
pStream
->
numOfRes
);
tfree
(
pTableMetaInfo
->
pTableMeta
);
...
...
@@ -318,8 +318,8 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
/*
* current time window will be closed, since it too early to exceed the maxRetentWindow value
*/
tscDebug
(
"
%p
stream:%p, etime:%"
PRId64
" is too old, exceeds the max retention time window:%"
PRId64
", stop the stream"
,
pStream
->
pSql
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
tscDebug
(
"
0x%"
PRIx64
"
stream:%p, etime:%"
PRId64
" is too old, exceeds the max retention time window:%"
PRId64
", stop the stream"
,
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
// Callback function from upper level
...
...
@@ -329,10 +329,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
return
;
}
tscDebug
(
"
%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
,
pStream
,
tscDebug
(
"
0x%"
PRIx64
" stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
->
self
,
pStream
,
now
+
timer
,
timer
,
delay
,
pStream
->
stime
,
etime
);
}
else
{
tscDebug
(
"
%p stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
,
pStream
,
tscDebug
(
"
0x%"
PRIx64
" stream:%p, next start at %"
PRId64
", in %"
PRId64
"ms. delay:%"
PRId64
"ms qrange %"
PRId64
"-%"
PRId64
,
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
timer
,
delay
,
pStream
->
stime
-
pStream
->
interval
.
interval
,
pStream
->
stime
-
1
);
}
...
...
@@ -378,8 +378,8 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
*/
timer
=
pStream
->
interval
.
sliding
;
if
(
pStream
->
stime
>
pStream
->
etime
)
{
tscDebug
(
"
%p stream:%p, stime:%"
PRId64
" is larger than end time: %"
PRId64
", stop the stream"
,
pStream
->
pSql
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p, stime:%"
PRId64
" is larger than end time: %"
PRId64
", stop the stream"
,
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
// Callback function from upper level
...
...
@@ -392,7 +392,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
int64_t
stime
=
taosTimeTruncate
(
pStream
->
stime
-
1
,
&
pStream
->
interval
,
pStream
->
precision
);
//int64_t stime = taosGetIntervalStartTimestamp(pStream->stime - 1, pStream->interval.interval, pStream->interval.interval, pStream->interval.intervalUnit, pStream->precision);
if
(
stime
>=
pStream
->
etime
)
{
tscDebug
(
"
%p stream:%p, stime:%"
PRId64
" is larger than end time: %"
PRId64
", stop the stream"
,
pStream
->
pSql
,
pStream
,
tscDebug
(
"
0x%"
PRIx64
" stream:%p, stime:%"
PRId64
" is larger than end time: %"
PRId64
", stop the stream"
,
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
...
...
@@ -558,7 +558,7 @@ static void tscCreateStream(void *param, TAOS_RES *res, int code) {
taosTmrReset
(
tscProcessStreamTimer
,
(
int32_t
)
starttime
,
pStream
,
tscTmr
,
&
pStream
->
pTimer
);
tscDebug
(
"
%p stream:%p is opened, query on:%s, interval:%"
PRId64
", sliding:%"
PRId64
", first launched in:%"
PRId64
", sql:%s"
,
pSql
,
tscDebug
(
"
0x%"
PRIx64
" stream:%p is opened, query on:%s, interval:%"
PRId64
", sliding:%"
PRId64
", first launched in:%"
PRId64
", sql:%s"
,
pSql
->
self
,
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
),
pStream
->
interval
.
interval
,
pStream
->
interval
.
sliding
,
starttime
,
pSql
->
sqlstr
);
}
...
...
@@ -645,7 +645,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
taosTmrStopA
(
&
(
pStream
->
pTimer
));
tscDebug
(
"
%p stream:%p is closed"
,
pSql
,
pStream
);
tscDebug
(
"
0x%"
PRIx64
" stream:%p is closed"
,
pSql
->
self
,
pStream
);
// notify CQ to release the pStream object
pStream
->
fp
(
pStream
->
param
,
NULL
,
NULL
);
pStream
->
pSql
=
NULL
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
5e1b9faa
此差异已折叠。
点击以展开。
src/client/src/tscUtil.c
浏览文件 @
5e1b9faa
...
...
@@ -496,10 +496,10 @@ void tscFreeSubobj(SSqlObj* pSql) {
return
;
}
tscDebug
(
"
%p start to free sub SqlObj, numOfSub:%d"
,
pSql
,
pSql
->
subState
.
numOfSub
);
tscDebug
(
"
0x%"
PRIx64
" start to free sub SqlObj, numOfSub:%d"
,
pSql
->
self
,
pSql
->
subState
.
numOfSub
);
for
(
int32_t
i
=
0
;
i
<
pSql
->
subState
.
numOfSub
;
++
i
)
{
tscDebug
(
"
%p free sub SqlObj:%p, index:%d"
,
pSql
,
pSql
->
pSubs
[
i
],
i
);
tscDebug
(
"
0x%"
PRIx64
" free sub SqlObj:%p, index:%d"
,
pSql
->
self
,
pSql
->
pSubs
[
i
],
i
);
taos_free_result
(
pSql
->
pSubs
[
i
]);
pSql
->
pSubs
[
i
]
=
NULL
;
}
...
...
@@ -530,7 +530,7 @@ void tscFreeRegisteredSqlObj(void *pSql) {
int32_t
num
=
atomic_sub_fetch_32
(
&
pTscObj
->
numOfObj
,
1
);
int32_t
total
=
atomic_sub_fetch_32
(
&
tscNumOfObj
,
1
);
tscDebug
(
"
%p free SqlObj, total in tscObj:%d, total:%d"
,
pSql
,
num
,
total
);
tscDebug
(
"
0x%"
PRIx64
" free SqlObj, total in tscObj:%d, total:%d"
,
p
->
self
,
num
,
total
);
tscFreeSqlObj
(
p
);
taosReleaseRef
(
tscRefId
,
pTscObj
->
rid
);
...
...
@@ -553,7 +553,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
return
;
}
tscDebug
(
"
%p start to free sqlObj"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" start to free sqlObj"
,
pSql
->
self
);
pSql
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
...
...
@@ -945,7 +945,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, bool freeBlockMap) {
tscSortRemoveDataBlockDupRows
(
pOneTableBlock
);
char
*
ekey
=
(
char
*
)
pBlocks
->
data
+
pOneTableBlock
->
rowSize
*
(
pBlocks
->
numOfRows
-
1
);
tscDebug
(
"
%p name:%s, name:%d rows:%d sversion:%d skey:%"
PRId64
", ekey:%"
PRId64
,
pSql
,
tNameGetTableName
(
&
pOneTableBlock
->
tableName
),
tscDebug
(
"
0x%"
PRIx64
" name:%s, name:%d rows:%d sversion:%d skey:%"
PRId64
", ekey:%"
PRId64
,
pSql
->
self
,
tNameGetTableName
(
&
pOneTableBlock
->
tableName
),
pBlocks
->
tid
,
pBlocks
->
numOfRows
,
pBlocks
->
sversion
,
GET_INT64_VAL
(
pBlocks
->
data
),
GET_INT64_VAL
(
ekey
));
int32_t
len
=
pBlocks
->
numOfRows
*
(
pOneTableBlock
->
rowSize
+
expandSize
)
+
sizeof
(
STColumn
)
*
tscGetNumOfColumns
(
pOneTableBlock
->
pTableMeta
);
...
...
@@ -2109,7 +2109,7 @@ void registerSqlObj(SSqlObj* pSql) {
int32_t
num
=
atomic_add_fetch_32
(
&
pSql
->
pTscObj
->
numOfObj
,
1
);
int32_t
total
=
atomic_add_fetch_32
(
&
tscNumOfObj
,
1
);
tscDebug
(
"
%p new SqlObj from %p, total in tscObj:%d, total:%d"
,
pSql
,
pSql
->
pTscObj
,
num
,
total
);
tscDebug
(
"
0x%"
PRIx64
" new SqlObj from %p, total in tscObj:%d, total:%d"
,
pSql
->
self
,
pSql
->
pTscObj
,
num
,
total
);
}
SSqlObj
*
createSimpleSubObj
(
SSqlObj
*
pSql
,
__async_cb_func_t
fp
,
void
*
param
,
int32_t
cmd
)
{
...
...
@@ -2376,7 +2376,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
tscPrintSelectClause
(
pNew
,
0
);
}
else
{
tscDebug
(
"
%p new sub insertion: %p, vnodeIdx:%d"
,
pSql
,
pNew
,
pTableMetaInfo
->
vgroupIndex
);
tscDebug
(
"
0x%"
PRIx64
" new sub insertion: %p, vnodeIdx:%d"
,
pSql
->
self
,
pNew
,
pTableMetaInfo
->
vgroupIndex
);
}
registerSqlObj
(
pNew
);
...
...
@@ -2627,7 +2627,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
if
(
++
pTableMetaInfo
->
vgroupIndex
<
totalVgroups
)
{
tscDebug
(
"
%p results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%"
PRId64
,
pSql
,
tscDebug
(
"
0x%"
PRIx64
" results from vgroup index:%d completed, try next:%d. total vgroups:%d. current numOfRes:%"
PRId64
,
pSql
->
self
,
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
/*
...
...
@@ -2646,8 +2646,8 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
pQueryInfo
->
limit
.
offset
=
pRes
->
offset
;
assert
((
pRes
->
offset
>=
0
&&
pRes
->
numOfRows
==
0
)
||
(
pRes
->
offset
==
0
&&
pRes
->
numOfRows
>=
0
));
tscDebug
(
"
%p
new query to next vgroup, index:%d, limit:%"
PRId64
", offset:%"
PRId64
", glimit:%"
PRId64
,
pSql
,
pTableMetaInfo
->
vgroupIndex
,
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
clauseLimit
);
tscDebug
(
"
0x%"
PRIx64
"
new query to next vgroup, index:%d, limit:%"
PRId64
", offset:%"
PRId64
", glimit:%"
PRId64
,
pSql
->
self
,
pTableMetaInfo
->
vgroupIndex
,
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
clauseLimit
);
/*
* For project query with super table join, the numOfSub is equalled to the number of all subqueries.
...
...
@@ -2664,7 +2664,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
pSql
->
fp
=
fp
;
tscProcessSql
(
pSql
);
}
else
{
tscDebug
(
"
%p try all %d vnodes, query complete. current numOfRes:%"
PRId64
,
pSql
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
tscDebug
(
"
0x%"
PRIx64
" try all %d vnodes, query complete. current numOfRes:%"
PRId64
,
pSql
->
self
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
}
}
...
...
@@ -2690,7 +2690,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
pSql
->
subState
.
numOfSub
=
0
;
pSql
->
fp
=
fp
;
tscDebug
(
"
%p try data in the next subclause:%d, total subclause:%d"
,
pSql
,
pCmd
->
clauseIndex
,
pCmd
->
numOfClause
);
tscDebug
(
"
0x%"
PRIx64
" try data in the next subclause:%d, total subclause:%d"
,
pSql
->
self
,
pCmd
->
clauseIndex
,
pCmd
->
numOfClause
);
if
(
pCmd
->
command
>
TSDB_SQL_LOCAL
)
{
tscProcessLocalCmd
(
pSql
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录