Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
5e1b9faa
T
TDengine
项目概览
慢慢CG
/
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看板
提交
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) {
...
@@ -283,7 +283,7 @@ void tscQueueAsyncError(void(*fp), void *param, int32_t code) {
static
void
tscAsyncResultCallback
(
SSchedMsg
*
pMsg
)
{
static
void
tscAsyncResultCallback
(
SSchedMsg
*
pMsg
)
{
SSqlObj
*
pSql
=
(
SSqlObj
*
)
taosAcquireRef
(
tscObjRef
,
(
int64_t
)
pMsg
->
ahandle
);
SSqlObj
*
pSql
=
(
SSqlObj
*
)
taosAcquireRef
(
tscObjRef
,
(
int64_t
)
pMsg
->
ahandle
);
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
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
;
return
;
}
}
...
@@ -372,13 +372,13 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -372,13 +372,13 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
goto
_error
;
goto
_error
;
}
}
tscDebug
(
"
%p get %s successfully"
,
pSql
,
msg
);
tscDebug
(
"
0x%"
PRIx64
" get %s successfully"
,
pSql
->
self
,
msg
);
if
(
pSql
->
pStream
==
NULL
)
{
if
(
pSql
->
pStream
==
NULL
)
{
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
// check if it is a sub-query of super table query first, if true, enter another routine
// 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
)))
{
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
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
...
@@ -402,7 +402,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -402,7 +402,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
return
;
return
;
}
else
{
// continue to process normal async query
}
else
{
// continue to process normal async query
if
(
pCmd
->
parseFinished
)
{
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
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetTableMetaInfoFromCmd
(
pCmd
,
pCmd
->
clauseIndex
,
0
);
code
=
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
code
=
tscGetTableMeta
(
pSql
,
pTableMetaInfo
);
...
@@ -416,7 +416,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -416,7 +416,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
assert
(
pCmd
->
command
!=
TSDB_SQL_INSERT
);
assert
(
pCmd
->
command
!=
TSDB_SQL_INSERT
);
if
(
pCmd
->
command
==
TSDB_SQL_SELECT
)
{
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
;
pCmd
->
parseFinished
=
false
;
tscResetSqlCmd
(
pCmd
,
true
);
tscResetSqlCmd
(
pCmd
,
true
);
...
@@ -436,7 +436,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -436,7 +436,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
return
;
return
;
}
else
{
}
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
);
code
=
tsParseSql
(
pSql
,
false
);
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
if
(
code
==
TSDB_CODE_TSC_ACTION_IN_PROGRESS
)
{
...
@@ -486,7 +486,7 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) {
...
@@ -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
)
{
if
(
!
pSql
->
cmd
.
parseFinished
)
{
tsParseSql
(
pSql
,
false
);
tsParseSql
(
pSql
,
false
);
}
}
...
...
src/client/src/tscLocalMerge.c
浏览文件 @
5e1b9faa
...
@@ -193,7 +193,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
...
@@ -193,7 +193,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
int32_t
len
=
pMemBuffer
[
i
]
->
fileMeta
.
flushoutData
.
nLength
;
int32_t
len
=
pMemBuffer
[
i
]
->
fileMeta
.
flushoutData
.
nLength
;
if
(
len
==
0
)
{
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
;
continue
;
}
}
...
@@ -203,7 +203,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
...
@@ -203,7 +203,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
if
(
numOfFlush
==
0
||
numOfBuffer
==
0
)
{
if
(
numOfFlush
==
0
||
numOfBuffer
==
0
)
{
tscLocalReducerEnvDestroy
(
pMemBuffer
,
pDesc
,
finalmodel
,
pFFModel
,
numOfBuffer
);
tscLocalReducerEnvDestroy
(
pMemBuffer
,
pDesc
,
finalmodel
,
pFFModel
,
numOfBuffer
);
pCmd
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
// no result, set the result empty
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
;
return
;
}
}
...
@@ -235,7 +235,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
...
@@ -235,7 +235,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
pReducer
->
numOfVnode
=
numOfBuffer
;
pReducer
->
numOfVnode
=
numOfBuffer
;
pReducer
->
pDesc
=
pDesc
;
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
;
int32_t
idx
=
0
;
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfBuffer
;
++
i
)
{
...
@@ -258,7 +258,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
...
@@ -258,7 +258,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
ds
->
pageId
=
0
;
ds
->
pageId
=
0
;
ds
->
rowIdx
=
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
);
tExtMemBufferLoadData
(
pMemBuffer
[
i
],
&
(
ds
->
filePage
),
j
,
0
);
#ifdef _DEBUG_VIEW
#ifdef _DEBUG_VIEW
printf
(
"load data page into mem for build loser tree: %"
PRIu64
" rows
\n
"
,
ds
->
filePage
.
num
);
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
...
@@ -272,7 +272,7 @@ void tscCreateLocalMerger(tExtMemBuffer **pMemBuffer, int32_t numOfBuffer, tOrde
#endif
#endif
if
(
ds
->
filePage
.
num
==
0
)
{
// no data in this flush, the index does not increase
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
);
tfree
(
ds
);
continue
;
continue
;
}
}
...
@@ -547,10 +547,10 @@ void tscDestroyLocalMerger(SSqlObj *pSql) {
...
@@ -547,10 +547,10 @@ void tscDestroyLocalMerger(SSqlObj *pSql) {
pLocalMerge
->
numOfCompleted
=
0
;
pLocalMerge
->
numOfCompleted
=
0
;
free
(
pLocalMerge
);
free
(
pLocalMerge
);
}
else
{
}
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
)
{
static
int32_t
createOrderDescriptor
(
tOrderDescriptor
**
pOrderDesc
,
SSqlCmd
*
pCmd
,
SColumnModel
*
pModel
)
{
...
...
src/client/src/tscParseInsert.c
浏览文件 @
5e1b9faa
...
@@ -1089,7 +1089,7 @@ int tsParseInsertSql(SSqlObj *pSql) {
...
@@ -1089,7 +1089,7 @@ int tsParseInsertSql(SSqlObj *pSql) {
str
=
pCmd
->
curSql
;
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
)
{
while
(
1
)
{
int32_t
index
=
0
;
int32_t
index
=
0
;
...
@@ -1303,7 +1303,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
...
@@ -1303,7 +1303,7 @@ int tsParseSql(SSqlObj *pSql, bool initial) {
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
if
((
!
pCmd
->
parseFinished
)
&&
(
!
initial
))
{
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
);
ret
=
tscAllocPayload
(
&
pSql
->
cmd
,
TSDB_DEFAULT_PAYLOAD_SIZE
);
...
...
src/client/src/tscProfile.c
浏览文件 @
5e1b9faa
...
@@ -61,7 +61,7 @@ void tscAddIntoSqlList(SSqlObj *pSql) {
...
@@ -61,7 +61,7 @@ void tscAddIntoSqlList(SSqlObj *pSql) {
pSql
->
stime
=
taosGetTimestampMs
();
pSql
->
stime
=
taosGetTimestampMs
();
pSql
->
listed
=
1
;
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
)
{
void
tscSaveSlowQueryFpCb
(
void
*
param
,
TAOS_RES
*
result
,
int
code
)
{
...
@@ -99,7 +99,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
...
@@ -99,7 +99,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
return
;
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
);
int32_t
sqlSize
=
(
int32_t
)(
TSDB_SLOW_QUERY_SQL_LEN
+
size
);
char
*
sql
=
malloc
(
sqlSize
);
char
*
sql
=
malloc
(
sqlSize
);
...
@@ -141,7 +141,7 @@ void tscRemoveFromSqlList(SSqlObj *pSql) {
...
@@ -141,7 +141,7 @@ void tscRemoveFromSqlList(SSqlObj *pSql) {
pSql
->
listed
=
0
;
pSql
->
listed
=
0
;
tscSaveSlowQuery
(
pSql
);
tscSaveSlowQuery
(
pSql
);
tscDebug
(
"
%p removed from sqlList"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" removed from sqlList"
,
pSql
->
self
);
}
}
void
tscKillQuery
(
STscObj
*
pObj
,
uint32_t
killId
)
{
void
tscKillQuery
(
STscObj
*
pObj
,
uint32_t
killId
)
{
...
@@ -158,7 +158,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) {
...
@@ -158,7 +158,7 @@ void tscKillQuery(STscObj *pObj, uint32_t killId) {
if
(
pSql
==
NULL
)
{
if
(
pSql
==
NULL
)
{
tscError
(
"failed to kill query, id:%d, it may have completed/terminated"
,
killId
);
tscError
(
"failed to kill query, id:%d, it may have completed/terminated"
,
killId
);
}
else
{
}
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
);
taos_stop_query
(
pSql
);
}
}
}
}
...
@@ -213,7 +213,7 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
...
@@ -213,7 +213,7 @@ void tscKillStream(STscObj *pObj, uint32_t killId) {
pthread_mutex_unlock
(
&
pObj
->
mutex
);
pthread_mutex_unlock
(
&
pObj
->
mutex
);
if
(
pStream
)
{
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
)
{
if
(
pStream
->
callback
)
{
pStream
->
callback
(
pStream
->
param
);
pStream
->
callback
(
pStream
->
param
);
}
}
...
...
src/client/src/tscSQLParser.c
浏览文件 @
5e1b9faa
...
@@ -5508,15 +5508,15 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
...
@@ -5508,15 +5508,15 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
pQueryInfo
->
clauseLimit
=
pQueryInfo
->
limit
.
limit
;
pQueryInfo
->
clauseLimit
=
pQueryInfo
->
limit
.
limit
;
pQueryInfo
->
slimit
=
pQuerySqlNode
->
slimit
;
pQueryInfo
->
slimit
=
pQuerySqlNode
->
slimit
;
tscDebug
(
"
%p limit:%"
PRId64
", offset:%"
PRId64
" slimit:%"
PRId64
", soffset:%"
PRId64
,
pSql
,
pQueryInfo
->
limit
.
limit
,
tscDebug
(
"
0x%"
PRIx64
" limit:%"
PRId64
", offset:%"
PRId64
" slimit:%"
PRId64
", soffset:%"
PRId64
,
pSql
->
self
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
slimit
.
limit
,
pQueryInfo
->
slimit
.
offset
);
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
slimit
.
limit
,
pQueryInfo
->
slimit
.
offset
);
if
(
pQueryInfo
->
slimit
.
offset
<
0
||
pQueryInfo
->
limit
.
offset
<
0
)
{
if
(
pQueryInfo
->
slimit
.
offset
<
0
||
pQueryInfo
->
limit
.
offset
<
0
)
{
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg0
);
return
invalidSqlErrMsg
(
tscGetErrorMsgPayload
(
pCmd
),
msg0
);
}
}
if
(
pQueryInfo
->
limit
.
limit
==
0
)
{
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
;
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -5538,7 +5538,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
...
@@ -5538,7 +5538,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
}
}
if
(
pQueryInfo
->
slimit
.
limit
==
0
)
{
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
;
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -5556,7 +5556,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
...
@@ -5556,7 +5556,7 @@ int32_t parseLimitClause(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t clauseIn
// No tables included. No results generated. Query results are empty.
// No tables included. No results generated. Query results are empty.
if
(
pTableMetaInfo
->
vgroupList
->
numOfVgroups
==
0
)
{
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
;
pQueryInfo
->
command
=
TSDB_SQL_RETRIEVE_EMPTY_RESULT
;
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -6351,7 +6351,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
...
@@ -6351,7 +6351,7 @@ void tscPrintSelectClause(SSqlObj* pSql, int32_t subClauseIndex) {
assert
(
offset
<
totalBufSize
);
assert
(
offset
<
totalBufSize
);
str
[
offset
]
=
']'
;
str
[
offset
]
=
']'
;
assert
(
offset
<
totalBufSize
);
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
)
{
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) {
...
@@ -147,7 +147,7 @@ static void tscUpdateVgroupInfo(SSqlObj *pSql, SRpcEpSet *pEpSet) {
// Update the local cached epSet info cached by SqlObj
// Update the local cached epSet info cached by SqlObj
int32_t
inUse
=
pSql
->
epSet
.
inUse
;
int32_t
inUse
=
pSql
->
epSet
.
inUse
;
tscDumpEpSetFromVgroupInfo
(
&
pSql
->
epSet
,
&
vgroupInfo
);
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) {
...
@@ -245,11 +245,11 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if
(
pObj
->
hbrid
!=
0
)
{
if
(
pObj
->
hbrid
!=
0
)
{
int32_t
waitingDuring
=
tsShellActivityTimer
*
500
;
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
);
taosTmrReset
(
tscProcessActivityTimer
,
waitingDuring
,
(
void
*
)
pObj
->
rid
,
tscTmr
,
&
pObj
->
pTimer
);
}
else
{
}
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) {
...
@@ -326,7 +326,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pSql
->
rpcRid
=
-
1
;
pSql
->
rpcRid
=
-
1
;
if
(
pObj
->
signature
!=
pObj
)
{
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
);
taosRemoveRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
@@ -336,8 +336,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -336,8 +336,8 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
0
);
if
(
pQueryInfo
!=
NULL
&&
pQueryInfo
->
type
==
TSDB_QUERY_TYPE_FREE_RESOURCE
)
{
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"
,
tscDebug
(
"
0x%"
PRIx64
"
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
);
pSql
->
self
,
pCmd
->
command
,
pQueryInfo
->
type
,
pObj
,
pObj
->
signature
);
taosRemoveRef
(
tscObjRef
,
handle
);
taosRemoveRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
@@ -396,13 +396,13 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -396,13 +396,13 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pRes
->
rspLen
=
0
;
pRes
->
rspLen
=
0
;
if
(
pRes
->
code
==
TSDB_CODE_TSC_QUERY_CANCELLED
)
{
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
{
}
else
{
pRes
->
code
=
rpcMsg
->
code
;
pRes
->
code
=
rpcMsg
->
code
;
}
}
if
(
pRes
->
code
==
TSDB_CODE_SUCCESS
)
{
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
;
pSql
->
retry
=
0
;
}
}
...
@@ -437,10 +437,10 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
...
@@ -437,10 +437,10 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
pMsg
->
numOfFailedBlocks
=
htonl
(
pMsg
->
numOfFailedBlocks
);
pMsg
->
numOfFailedBlocks
=
htonl
(
pMsg
->
numOfFailedBlocks
);
pRes
->
numOfRows
+=
pMsg
->
affectedRows
;
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
);
tstrerror
(
pRes
->
code
),
pMsg
->
affectedRows
,
pRes
->
rspLen
);
}
else
{
}
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) {
...
@@ -461,7 +461,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
if
(
shouldFree
)
{
// in case of table-meta/vgrouplist query, automatically free it
if
(
shouldFree
)
{
// in case of table-meta/vgrouplist query, automatically free it
taosRemoveRef
(
tscObjRef
,
handle
);
taosRemoveRef
(
tscObjRef
,
handle
);
tscDebug
(
"
%p sqlObj is automatically freed"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" sqlObj is automatically freed"
,
pSql
->
self
);
}
}
taosReleaseRef
(
tscObjRef
,
handle
);
taosReleaseRef
(
tscObjRef
,
handle
);
...
@@ -522,7 +522,7 @@ int tscProcessSql(SSqlObj *pSql) {
...
@@ -522,7 +522,7 @@ int tscProcessSql(SSqlObj *pSql) {
assert
((
pQueryInfo
->
numOfTables
==
0
&&
pQueryInfo
->
command
==
TSDB_SQL_HB
)
||
pQueryInfo
->
numOfTables
>
0
);
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
(
pCmd
->
command
<
TSDB_SQL_MGMT
)
{
// the pTableMetaInfo cannot be NULL
if
(
pTableMetaInfo
==
NULL
)
{
if
(
pTableMetaInfo
==
NULL
)
{
pSql
->
res
.
code
=
TSDB_CODE_TSC_APP_ERROR
;
pSql
->
res
.
code
=
TSDB_CODE_TSC_APP_ERROR
;
...
@@ -562,11 +562,11 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -562,11 +562,11 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
}
}
pRetrieveMsg
->
header
.
vgId
=
htonl
(
vgId
);
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
{
}
else
{
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pTableMeta
->
vgId
);
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
);
pSql
->
cmd
.
payloadLen
=
sizeof
(
SRetrieveTableMsg
);
...
@@ -605,7 +605,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -605,7 +605,7 @@ int tscBuildSubmitMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
taosHashGetClone
(
tscVgroupMap
,
&
pTableMeta
->
vgId
,
sizeof
(
pTableMeta
->
vgId
),
NULL
,
&
vgroupInfo
,
sizeof
(
SNewVgroupInfo
));
taosHashGetClone
(
tscVgroupMap
,
&
pTableMeta
->
vgId
,
sizeof
(
pTableMeta
->
vgId
),
NULL
,
&
vgroupInfo
,
sizeof
(
SNewVgroupInfo
));
tscDumpEpSetFromVgroupInfo
(
&
pSql
->
epSet
,
&
vgroupInfo
);
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
);
pSql
->
epSet
.
numOfEps
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
...
@@ -671,7 +671,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -671,7 +671,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
vgId
=
pVgroupInfo
->
vgId
;
vgId
=
pVgroupInfo
->
vgId
;
tscSetDnodeEpSet
(
&
pSql
->
epSet
,
pVgroupInfo
);
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
{
}
else
{
vgId
=
pTableMeta
->
vgId
;
vgId
=
pTableMeta
->
vgId
;
...
@@ -704,7 +704,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -704,7 +704,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pTableIdList
->
itemList
);
int32_t
numOfTables
=
(
int32_t
)
taosArrayGetSize
(
pTableIdList
->
itemList
);
pQueryMsg
->
numOfTables
=
htonl
(
numOfTables
);
// set the number of tables
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
);
pTableIdList
->
vgInfo
.
vgId
,
numOfTables
,
index
,
numOfVgroups
);
// serialize each table id info
// serialize each table id info
...
@@ -722,7 +722,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
...
@@ -722,7 +722,7 @@ static char *doSerializeTableInfo(SQueryTableMsg* pQueryMsg, SSqlObj *pSql, char
char
n
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
char
n
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
n
);
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
;
return
pMsg
;
}
}
...
@@ -1139,7 +1139,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1139,7 +1139,7 @@ int tscBuildQueryMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
int32_t
msgLen
=
(
int32_t
)(
pMsg
-
pCmd
->
payload
);
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
;
pCmd
->
payloadLen
=
msgLen
;
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
pSql
->
cmd
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
...
@@ -1837,7 +1837,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
...
@@ -1837,7 +1837,7 @@ int tscBuildMultiMeterMetaMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
assert(pCmd->payloadLen + minMsgSize() <= pCmd->allocSize);
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);
pCmd->payloadLen);
return pCmd->payloadLen;
return pCmd->payloadLen;
...
@@ -2017,7 +2017,7 @@ int tscProcessTableMetaRsp(SSqlObj *pSql) {
...
@@ -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
));
tNameGetTableName
(
&
pTableMetaInfo
->
name
));
free
(
pTableMeta
);
free
(
pTableMeta
);
...
@@ -2124,7 +2124,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
...
@@ -2124,7 +2124,7 @@ int tscProcessMultiMeterMetaRsp(SSqlObj *pSql) {
pSql->res.code = TSDB_CODE_SUCCESS;
pSql->res.code = TSDB_CODE_SUCCESS;
pSql->res.numOfTotal = i;
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
#endif
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
@@ -2292,7 +2292,7 @@ static void createHbObj(STscObj* pObj) {
...
@@ -2292,7 +2292,7 @@ static void createHbObj(STscObj* pObj) {
pSql
->
signature
=
pSql
;
pSql
->
signature
=
pSql
;
registerSqlObj
(
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
;
pObj
->
hbrid
=
pSql
->
self
;
}
}
...
@@ -2318,7 +2318,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
...
@@ -2318,7 +2318,7 @@ int tscProcessConnectRsp(SSqlObj *pSql) {
tscUpdateMgmtEpSet
(
pSql
,
&
pConnect
->
epSet
);
tscUpdateMgmtEpSet
(
pSql
,
&
pConnect
->
epSet
);
for
(
int
i
=
0
;
i
<
pConnect
->
epSet
.
numOfEps
;
++
i
)
{
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) {
...
@@ -2362,7 +2362,7 @@ int tscProcessDropTableRsp(SSqlObj *pSql) {
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
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
;
pTableMetaInfo
->
pTableMeta
=
NULL
;
return
0
;
return
0
;
...
@@ -2374,7 +2374,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
...
@@ -2374,7 +2374,7 @@ int tscProcessAlterTableMsgRsp(SSqlObj *pSql) {
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
char
name
[
TSDB_TABLE_FNAME_LEN
]
=
{
0
};
tNameExtractFullName
(
&
pTableMetaInfo
->
name
,
name
);
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
);
bool
isSuperTable
=
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
);
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
taosHashRemove
(
tscTableMetaInfo
,
name
,
strnlen
(
name
,
TSDB_TABLE_FNAME_LEN
));
...
@@ -2405,7 +2405,7 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
...
@@ -2405,7 +2405,7 @@ int tscProcessQueryRsp(SSqlObj *pSql) {
pRes
->
data
=
NULL
;
pRes
->
data
=
NULL
;
tscResetForNextRetrieve
(
pRes
);
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
;
return
0
;
}
}
...
@@ -2463,7 +2463,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
...
@@ -2463,7 +2463,7 @@ int tscProcessRetrieveRspFromNode(SSqlObj *pSql) {
}
}
pRes
->
row
=
0
;
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
);
pRes
->
completed
,
pRes
->
qId
);
return
0
;
return
0
;
...
@@ -2507,14 +2507,14 @@ static int32_t getTableMetaFromMnode(SSqlObj *pSql, STableMetaInfo *pTableMetaIn
...
@@ -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
);
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
->
fp
=
tscTableMetaCallBack
;
pNew
->
param
=
(
void
*
)
pSql
->
self
;
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
;
pSql
->
metaRid
=
pNew
->
self
;
...
@@ -2585,7 +2585,7 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
...
@@ -2585,7 +2585,7 @@ int tscRenewTableMeta(SSqlObj *pSql, int32_t tableIndex) {
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
if
(
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
);
tscGetNumOfTags
(
pTableMeta
),
tscGetNumOfColumns
(
pTableMeta
),
pTableMeta
->
id
.
uid
);
}
}
...
@@ -2645,12 +2645,12 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
...
@@ -2645,12 +2645,12 @@ int tscGetSTableVgroupInfo(SSqlObj *pSql, int32_t clauseIndex) {
pNewQueryInfo
->
numOfTables
=
pQueryInfo
->
numOfTables
;
pNewQueryInfo
->
numOfTables
=
pQueryInfo
->
numOfTables
;
registerSqlObj
(
pNew
);
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
;
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
->
fp
=
tscTableMetaCallBack
;
pNew
->
param
=
(
void
*
)
pSql
->
self
;
pNew
->
param
=
(
void
*
)
pSql
->
self
;
...
...
src/client/src/tscSql.c
浏览文件 @
5e1b9faa
...
@@ -292,7 +292,7 @@ void taos_close(TAOS *taos) {
...
@@ -292,7 +292,7 @@ void taos_close(TAOS *taos) {
pHb
->
rpcRid
=
-
1
;
pHb
->
rpcRid
=
-
1
;
}
}
tscDebug
(
"
%p HB is freed"
,
pHb
);
tscDebug
(
"
0x%"
PRIx64
" HB is freed"
,
pHb
->
self
);
taosReleaseRef
(
tscObjRef
,
pHb
->
self
);
taosReleaseRef
(
tscObjRef
,
pHb
->
self
);
#ifdef __APPLE__
#ifdef __APPLE__
// to satisfy later tsem_destroy in taos_free_result
// to satisfy later tsem_destroy in taos_free_result
...
@@ -576,7 +576,7 @@ static bool tscKillQueryInDnode(SSqlObj* pSql) {
...
@@ -576,7 +576,7 @@ static bool tscKillQueryInDnode(SSqlObj* pSql) {
cmd
==
TSDB_SQL_FETCH
))
{
cmd
==
TSDB_SQL_FETCH
))
{
pQueryInfo
->
type
=
TSDB_QUERY_TYPE_FREE_RESOURCE
;
pQueryInfo
->
type
=
TSDB_QUERY_TYPE_FREE_RESOURCE
;
pCmd
->
command
=
(
pCmd
->
command
>
TSDB_SQL_MGMT
)
?
TSDB_SQL_RETRIEVE
:
TSDB_SQL_FETCH
;
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
);
tscProcessSql
(
pSql
);
return
false
;
return
false
;
...
@@ -594,7 +594,7 @@ void taos_free_result(TAOS_RES *res) {
...
@@ -594,7 +594,7 @@ void taos_free_result(TAOS_RES *res) {
bool
freeNow
=
tscKillQueryInDnode
(
pSql
);
bool
freeNow
=
tscKillQueryInDnode
(
pSql
);
if
(
freeNow
)
{
if
(
freeNow
)
{
tscDebug
(
"
%p free sqlObj in cache"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" free sqlObj in cache"
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
}
}
}
}
...
@@ -708,7 +708,7 @@ static void tscKillSTableQuery(SSqlObj *pSql) {
...
@@ -708,7 +708,7 @@ static void tscKillSTableQuery(SSqlObj *pSql) {
tscUnlockByThread
(
&
pSql
->
squeryLock
);
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
)
{
void
taos_stop_query
(
TAOS_RES
*
res
)
{
...
@@ -717,7 +717,7 @@ void taos_stop_query(TAOS_RES *res) {
...
@@ -717,7 +717,7 @@ void taos_stop_query(TAOS_RES *res) {
return
;
return
;
}
}
tscDebug
(
"
%p start to cancel query"
,
res
);
tscDebug
(
"
0x%"
PRIx64
" start to cancel query"
,
pSql
->
self
);
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
SSqlCmd
*
pCmd
=
&
pSql
->
cmd
;
// set the error code for master pSqlObj firstly
// set the error code for master pSqlObj firstly
...
@@ -744,7 +744,7 @@ void taos_stop_query(TAOS_RES *res) {
...
@@ -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
)
{
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) {
...
@@ -877,7 +877,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pRes
->
numOfClauseTotal
=
0
;
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
);
int32_t
sqlLen
=
(
int32_t
)
strlen
(
sql
);
if
(
sqlLen
>
tsMaxSQLStringLen
)
{
if
(
sqlLen
>
tsMaxSQLStringLen
)
{
...
@@ -889,7 +889,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
...
@@ -889,7 +889,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
pSql
->
sqlstr
=
realloc
(
pSql
->
sqlstr
,
sqlLen
+
1
);
pSql
->
sqlstr
=
realloc
(
pSql
->
sqlstr
,
sqlLen
+
1
);
if
(
pSql
->
sqlstr
==
NULL
)
{
if
(
pSql
->
sqlstr
==
NULL
)
{
tscError
(
"%p failed to malloc sql string buffer"
,
pSql
);
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
);
tfree
(
pSql
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
}
...
@@ -914,7 +914,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
...
@@ -914,7 +914,7 @@ int taos_validate_sql(TAOS *taos, const char *sql) {
}
}
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
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
);
taos_free_result
(
pSql
);
...
@@ -1027,7 +1027,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
...
@@ -1027,7 +1027,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
pRes
->
numOfClauseTotal
=
0
;
pRes
->
numOfClauseTotal
=
0
;
assert
(
pSql
->
fp
==
NULL
);
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
);
int32_t
tblListLen
=
(
int32_t
)
strlen
(
tableNameList
);
if
(
tblListLen
>
MAX_TABLE_NAME_LENGTH
)
{
if
(
tblListLen
>
MAX_TABLE_NAME_LENGTH
)
{
...
@@ -1061,7 +1061,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
...
@@ -1061,7 +1061,7 @@ int taos_load_table_info(TAOS *taos, const char *tableNameList) {
tscDoQuery
(
pSql
);
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
)
{
if
((
code
=
pRes
->
code
)
!=
TSDB_CODE_SUCCESS
)
{
tscFreeSqlObj
(
pSql
);
tscFreeSqlObj
(
pSql
);
}
}
...
...
src/client/src/tscStream.c
浏览文件 @
5e1b9faa
...
@@ -70,7 +70,7 @@ static void setRetryInfo(SSqlStream* pStream, int32_t code) {
...
@@ -70,7 +70,7 @@ static void setRetryInfo(SSqlStream* pStream, int32_t code) {
pSql
->
res
.
code
=
code
;
pSql
->
res
.
code
=
code
;
int64_t
retryDelayTime
=
tscGetRetryDelayTime
(
pStream
,
pStream
->
interval
.
sliding
,
pStream
->
precision
);
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
);
tscSetRetryTimer
(
pStream
,
pSql
,
retryDelayTime
);
}
}
...
@@ -104,7 +104,7 @@ static void doLaunchQuery(void* param, TAOS_RES* tres, int32_t code) {
...
@@ -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.
// failed to get table Meta or vgroup list, retry in 10sec.
if
(
code
==
TSDB_CODE_SUCCESS
)
{
if
(
code
==
TSDB_CODE_SUCCESS
)
{
tscTansformFuncForSTableQuery
(
pQueryInfo
);
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
->
fp
=
tscProcessStreamQueryCallback
;
pSql
->
fetchFp
=
tscProcessStreamQueryCallback
;
pSql
->
fetchFp
=
tscProcessStreamQueryCallback
;
...
@@ -131,7 +131,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) {
...
@@ -131,7 +131,7 @@ static void tscProcessStreamTimer(void *handle, void *tmrId) {
pStream
->
numOfRes
=
0
;
// reset the numOfRes.
pStream
->
numOfRes
=
0
;
// reset the numOfRes.
SSqlObj
*
pSql
=
pStream
->
pSql
;
SSqlObj
*
pSql
=
pStream
->
pSql
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pSql
->
cmd
,
0
);
tscDebug
(
"
%p add into timer"
,
pSql
);
tscDebug
(
"
0x%"
PRIx64
" add into timer"
,
pSql
->
self
);
if
(
pStream
->
isProject
)
{
if
(
pStream
->
isProject
)
{
/*
/*
...
@@ -237,7 +237,7 @@ static void tscStreamFillTimeGap(SSqlStream* pStream, TSKEY ts) {
...
@@ -237,7 +237,7 @@ static void tscStreamFillTimeGap(SSqlStream* pStream, TSKEY ts) {
}
}
if (rowNum > 0) {
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;
pRes->numOfRows = 0;
...
@@ -263,7 +263,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
...
@@ -263,7 +263,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
++
i
)
{
TAOS_ROW
row
=
taos_fetch_row
(
res
);
TAOS_ROW
row
=
taos_fetch_row
(
res
);
if
(
row
!=
NULL
)
{
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
]);
tscStreamFillTimeGap
(
pStream
,
*
(
TSKEY
*
)
row
[
0
]);
pStream
->
stime
=
*
(
TSKEY
*
)
row
[
0
];
pStream
->
stime
=
*
(
TSKEY
*
)
row
[
0
];
// user callback function
// user callback function
...
@@ -293,7 +293,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
...
@@ -293,7 +293,7 @@ static void tscProcessStreamRetrieveResult(void *param, TAOS_RES *res, int numOf
pStream
->
stime
+=
1
;
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
);
pStream
->
numOfRes
);
tfree
(
pTableMetaInfo
->
pTableMeta
);
tfree
(
pTableMetaInfo
->
pTableMeta
);
...
@@ -318,8 +318,8 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
...
@@ -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
* 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"
,
tscDebug
(
"
0x%"
PRIx64
"
stream:%p, etime:%"
PRId64
" is too old, exceeds the max retention time window:%"
PRId64
", stop the stream"
,
pStream
->
pSql
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
if
(
pStream
->
callback
)
{
// Callback function from upper level
// Callback function from upper level
...
@@ -329,10 +329,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
...
@@ -329,10 +329,10 @@ static void tscSetRetryTimer(SSqlStream *pStream, SSqlObj *pSql, int64_t timer)
return
;
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
);
now
+
timer
,
timer
,
delay
,
pStream
->
stime
,
etime
);
}
else
{
}
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
);
pStream
->
stime
,
timer
,
delay
,
pStream
->
stime
-
pStream
->
interval
.
interval
,
pStream
->
stime
-
1
);
}
}
...
@@ -378,8 +378,8 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
...
@@ -378,8 +378,8 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
*/
*/
timer
=
pStream
->
interval
.
sliding
;
timer
=
pStream
->
interval
.
sliding
;
if
(
pStream
->
stime
>
pStream
->
etime
)
{
if
(
pStream
->
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
->
stime
,
pStream
->
etime
);
pStream
->
pSql
->
self
,
pStream
,
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
if
(
pStream
->
callback
)
{
// Callback function from upper level
// Callback function from upper level
...
@@ -392,7 +392,7 @@ static void tscSetNextLaunchTimer(SSqlStream *pStream, SSqlObj *pSql) {
...
@@ -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
=
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);
//int64_t stime = taosGetIntervalStartTimestamp(pStream->stime - 1, pStream->interval.interval, pStream->interval.interval, pStream->interval.intervalUnit, pStream->precision);
if
(
stime
>=
pStream
->
etime
)
{
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
);
pStream
->
stime
,
pStream
->
etime
);
// TODO : How to terminate stream here
// TODO : How to terminate stream here
if
(
pStream
->
callback
)
{
if
(
pStream
->
callback
)
{
...
@@ -558,7 +558,7 @@ static void tscCreateStream(void *param, TAOS_RES *res, int code) {
...
@@ -558,7 +558,7 @@ static void tscCreateStream(void *param, TAOS_RES *res, int code) {
taosTmrReset
(
tscProcessStreamTimer
,
(
int32_t
)
starttime
,
pStream
,
tscTmr
,
&
pStream
->
pTimer
);
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
);
pStream
,
tNameGetTableName
(
&
pTableMetaInfo
->
name
),
pStream
->
interval
.
interval
,
pStream
->
interval
.
sliding
,
starttime
,
pSql
->
sqlstr
);
}
}
...
@@ -645,7 +645,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
...
@@ -645,7 +645,7 @@ void taos_close_stream(TAOS_STREAM *handle) {
taosTmrStopA
(
&
(
pStream
->
pTimer
));
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
// notify CQ to release the pStream object
pStream
->
fp
(
pStream
->
param
,
NULL
,
NULL
);
pStream
->
fp
(
pStream
->
param
,
NULL
,
NULL
);
pStream
->
pSql
=
NULL
;
pStream
->
pSql
=
NULL
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
5e1b9faa
此差异已折叠。
点击以展开。
src/client/src/tscUtil.c
浏览文件 @
5e1b9faa
...
@@ -496,10 +496,10 @@ void tscFreeSubobj(SSqlObj* pSql) {
...
@@ -496,10 +496,10 @@ void tscFreeSubobj(SSqlObj* pSql) {
return
;
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
)
{
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
]);
taos_free_result
(
pSql
->
pSubs
[
i
]);
pSql
->
pSubs
[
i
]
=
NULL
;
pSql
->
pSubs
[
i
]
=
NULL
;
}
}
...
@@ -530,7 +530,7 @@ void tscFreeRegisteredSqlObj(void *pSql) {
...
@@ -530,7 +530,7 @@ void tscFreeRegisteredSqlObj(void *pSql) {
int32_t
num
=
atomic_sub_fetch_32
(
&
pTscObj
->
numOfObj
,
1
);
int32_t
num
=
atomic_sub_fetch_32
(
&
pTscObj
->
numOfObj
,
1
);
int32_t
total
=
atomic_sub_fetch_32
(
&
tscNumOfObj
,
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
);
tscFreeSqlObj
(
p
);
taosReleaseRef
(
tscRefId
,
pTscObj
->
rid
);
taosReleaseRef
(
tscRefId
,
pTscObj
->
rid
);
...
@@ -553,7 +553,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
...
@@ -553,7 +553,7 @@ void tscFreeSqlObj(SSqlObj* pSql) {
return
;
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
;
pSql
->
res
.
code
=
TSDB_CODE_TSC_QUERY_CANCELLED
;
...
@@ -945,7 +945,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, bool freeBlockMap) {
...
@@ -945,7 +945,7 @@ int32_t tscMergeTableDataBlocks(SSqlObj* pSql, bool freeBlockMap) {
tscSortRemoveDataBlockDupRows
(
pOneTableBlock
);
tscSortRemoveDataBlockDupRows
(
pOneTableBlock
);
char
*
ekey
=
(
char
*
)
pBlocks
->
data
+
pOneTableBlock
->
rowSize
*
(
pBlocks
->
numOfRows
-
1
);
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
));
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
);
int32_t
len
=
pBlocks
->
numOfRows
*
(
pOneTableBlock
->
rowSize
+
expandSize
)
+
sizeof
(
STColumn
)
*
tscGetNumOfColumns
(
pOneTableBlock
->
pTableMeta
);
...
@@ -2109,7 +2109,7 @@ void registerSqlObj(SSqlObj* pSql) {
...
@@ -2109,7 +2109,7 @@ void registerSqlObj(SSqlObj* pSql) {
int32_t
num
=
atomic_add_fetch_32
(
&
pSql
->
pTscObj
->
numOfObj
,
1
);
int32_t
num
=
atomic_add_fetch_32
(
&
pSql
->
pTscObj
->
numOfObj
,
1
);
int32_t
total
=
atomic_add_fetch_32
(
&
tscNumOfObj
,
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
)
{
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
...
@@ -2376,7 +2376,7 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t
tscPrintSelectClause
(
pNew
,
0
);
tscPrintSelectClause
(
pNew
,
0
);
}
else
{
}
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
);
registerSqlObj
(
pNew
);
...
@@ -2627,7 +2627,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
...
@@ -2627,7 +2627,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
int32_t
totalVgroups
=
pTableMetaInfo
->
vgroupList
->
numOfVgroups
;
if
(
++
pTableMetaInfo
->
vgroupIndex
<
totalVgroups
)
{
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
);
pTableMetaInfo
->
vgroupIndex
-
1
,
pTableMetaInfo
->
vgroupIndex
,
totalVgroups
,
pRes
->
numOfClauseTotal
);
/*
/*
...
@@ -2646,8 +2646,8 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
...
@@ -2646,8 +2646,8 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
pQueryInfo
->
limit
.
offset
=
pRes
->
offset
;
pQueryInfo
->
limit
.
offset
=
pRes
->
offset
;
assert
((
pRes
->
offset
>=
0
&&
pRes
->
numOfRows
==
0
)
||
(
pRes
->
offset
==
0
&&
pRes
->
numOfRows
>=
0
));
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
,
tscDebug
(
"
0x%"
PRIx64
"
new query to next vgroup, index:%d, limit:%"
PRId64
", offset:%"
PRId64
", glimit:%"
PRId64
,
pSql
,
pTableMetaInfo
->
vgroupIndex
,
pQueryInfo
->
limit
.
limit
,
pQueryInfo
->
limit
.
offset
,
pQueryInfo
->
clauseLimit
);
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.
* 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) {
...
@@ -2664,7 +2664,7 @@ void tscTryQueryNextVnode(SSqlObj* pSql, __async_cb_func_t fp) {
pSql
->
fp
=
fp
;
pSql
->
fp
=
fp
;
tscProcessSql
(
pSql
);
tscProcessSql
(
pSql
);
}
else
{
}
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) {
...
@@ -2690,7 +2690,7 @@ void tscTryQueryNextClause(SSqlObj* pSql, __async_cb_func_t fp) {
pSql
->
subState
.
numOfSub
=
0
;
pSql
->
subState
.
numOfSub
=
0
;
pSql
->
fp
=
fp
;
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
)
{
if
(
pCmd
->
command
>
TSDB_SQL_LOCAL
)
{
tscProcessLocalCmd
(
pSql
);
tscProcessLocalCmd
(
pSql
);
}
else
{
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录