Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
cabc32e7
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看板
提交
cabc32e7
编写于
12月 16, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225]fix clang-tidy warning.
上级
25e031a1
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
93 addition
and
94 deletion
+93
-94
src/client/inc/tscLog.h
src/client/inc/tscLog.h
+9
-9
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+1
-1
src/client/src/tscParseInsert.c
src/client/src/tscParseInsert.c
+1
-1
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+4
-4
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+3
-3
src/common/inc/tulog.h
src/common/inc/tulog.h
+1
-1
src/common/src/tglobal.c
src/common/src/tglobal.c
+10
-11
src/os/inc/osMemory.h
src/os/inc/osMemory.h
+1
-1
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+1
-1
src/query/inc/queryLog.h
src/query/inc/queryLog.h
+8
-8
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+52
-52
src/rpc/inc/rpcLog.h
src/rpc/inc/rpcLog.h
+1
-1
src/util/src/ttimer.c
src/util/src/ttimer.c
+1
-1
未找到文件。
src/client/inc/tscLog.h
浏览文件 @
cabc32e7
...
...
@@ -22,16 +22,16 @@ extern "C" {
#include "tlog.h"
extern
int32_t
cDebugFlag
;
extern
int32_t
tscEmbedded
;
extern
u
int32_t
cDebugFlag
;
extern
u
int32_t
tscEmbedded
;
#define tscFatal(...)
{ if (cDebugFlag & DEBUG_FATAL) { taosPrintLog("TSC FATAL ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscError(...)
{ if (cDebugFlag & DEBUG_ERROR) { taosPrintLog("TSC ERROR ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscWarn(...)
{ if (cDebugFlag & DEBUG_WARN) { taosPrintLog("TSC WARN ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscInfo(...)
{ if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }}
#define tscDebug(...)
{ if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); }}
#define tscTrace(...)
{ if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); }}
#define tscDebugL(...)
{ if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", cDebugFlag, __VA_ARGS__); }}
#define tscFatal(...)
do { if (cDebugFlag & DEBUG_FATAL) { taosPrintLog("TSC FATAL ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }} while(0)
#define tscError(...)
do { if (cDebugFlag & DEBUG_ERROR) { taosPrintLog("TSC ERROR ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }} while(0)
#define tscWarn(...)
do { if (cDebugFlag & DEBUG_WARN) { taosPrintLog("TSC WARN ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }} while(0)
#define tscInfo(...)
do { if (cDebugFlag & DEBUG_INFO) { taosPrintLog("TSC ", tscEmbedded ? 255 : cDebugFlag, __VA_ARGS__); }} while(0)
#define tscDebug(...)
do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); }} while(0)
#define tscTrace(...)
do { if (cDebugFlag & DEBUG_TRACE) { taosPrintLog("TSC ", cDebugFlag, __VA_ARGS__); }} while(0)
#define tscDebugL(...)
do { if (cDebugFlag & DEBUG_DEBUG) { taosPrintLongString("TSC ", cDebugFlag, __VA_ARGS__); }} while(0)
#ifdef __cplusplus
}
...
...
src/client/inc/tsclient.h
浏览文件 @
cabc32e7
...
...
@@ -229,7 +229,7 @@ typedef struct {
int32_t
numOfTablesInSubmit
;
};
int32_t
insertType
;
uint32_t
insertType
;
int32_t
clauseIndex
;
// index of multiple subclause query
char
*
curSql
;
// current sql, resume position of sql after parsing paused
...
...
src/client/src/tscParseInsert.c
浏览文件 @
cabc32e7
...
...
@@ -1523,7 +1523,7 @@ void tscProcessMultiVnodesImportFromFile(SSqlObj *pSql) {
pSql
->
res
.
code
=
TAOS_SYSTEM_ERROR
(
errno
);
tscError
(
"%p failed to open file %s to load data from file, code:%s"
,
pSql
,
pCmd
->
payload
,
tstrerror
(
pSql
->
res
.
code
));
tfree
(
pSupporter
)
tfree
(
pSupporter
)
;
tscQueueAsyncRes
(
pSql
);
return
;
...
...
src/client/src/tscSubquery.c
浏览文件 @
cabc32e7
...
...
@@ -384,7 +384,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
}
SQueryInfo
*
pSubQueryInfo
=
tscGetQueryInfoDetail
(
&
pPrevSub
->
cmd
,
0
);
STSBuf
*
pTS
Buf
=
pSubQueryInfo
->
tsBuf
;
STSBuf
*
pTs
Buf
=
pSubQueryInfo
->
tsBuf
;
pSubQueryInfo
->
tsBuf
=
NULL
;
// free result for async object will also free sqlObj
...
...
@@ -402,7 +402,7 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) {
pSql
->
pSubs
[
i
]
=
pNew
;
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
&
pNew
->
cmd
,
0
);
pQueryInfo
->
tsBuf
=
pT
S
Buf
;
// transfer the ownership of timestamp comp-z data to the new created object
pQueryInfo
->
tsBuf
=
pT
s
Buf
;
// transfer the ownership of timestamp comp-z data to the new created object
// set the second stage sub query for join process
TSDB_QUERY_SET_TYPE
(
pQueryInfo
->
type
,
TSDB_QUERY_TYPE_JOIN_SEC_STAGE
);
...
...
@@ -1648,7 +1648,7 @@ int32_t tscHandleMasterSTableQuery(SSqlObj *pSql) {
pRes
->
qhandle
=
0x1
;
// hack the qhandle check
const
uint32_t
nBufferSize
=
(
1u
<<
16
);
// 64KB
const
uint32_t
nBufferSize
=
(
1u
<<
16
u
);
// 64KB
SQueryInfo
*
pQueryInfo
=
tscGetQueryInfoDetail
(
pCmd
,
pCmd
->
clauseIndex
);
STableMetaInfo
*
pTableMetaInfo
=
tscGetMetaInfo
(
pQueryInfo
,
0
);
...
...
@@ -2151,7 +2151,7 @@ void tscRetrieveDataRes(void *param, TAOS_RES *tres, int code) {
static
bool
needRetryInsert
(
SSqlObj
*
pParentObj
,
int32_t
numOfSub
)
{
if
(
pParentObj
->
retry
>
pParentObj
->
maxRetry
)
{
tscError
(
"%p max retry reached, abort the retry effort"
,
pParentObj
)
tscError
(
"%p max retry reached, abort the retry effort"
,
pParentObj
)
;
return
false
;
}
...
...
src/common/inc/tglobal.h
浏览文件 @
cabc32e7
...
...
@@ -134,7 +134,7 @@ extern int32_t tsEnableStream;
// internal
extern
int32_t
tsPrintAuth
;
extern
int32_t
tscEmbedded
;
extern
u
int32_t
tscEmbedded
;
extern
char
configDir
[];
extern
char
tsVnodeDir
[];
extern
char
tsDnodeDir
[];
...
...
@@ -177,7 +177,7 @@ extern int32_t tsLogKeepDays;
extern
int32_t
dDebugFlag
;
extern
int32_t
vDebugFlag
;
extern
int32_t
mDebugFlag
;
extern
int32_t
cDebugFlag
;
extern
u
int32_t
cDebugFlag
;
extern
int32_t
jniDebugFlag
;
extern
int32_t
tmrDebugFlag
;
extern
int32_t
sdbDebugFlag
;
...
...
@@ -187,7 +187,7 @@ extern int32_t monDebugFlag;
extern
int32_t
uDebugFlag
;
extern
int32_t
rpcDebugFlag
;
extern
int32_t
odbcDebugFlag
;
extern
int32_t
qDebugFlag
;
extern
u
int32_t
qDebugFlag
;
extern
int32_t
wDebugFlag
;
extern
int32_t
cqDebugFlag
;
extern
int32_t
debugFlag
;
...
...
src/common/inc/tulog.h
浏览文件 @
cabc32e7
...
...
@@ -23,7 +23,7 @@ extern "C" {
#include "tlog.h"
extern
int32_t
uDebugFlag
;
extern
int32_t
tscEmbedded
;
extern
u
int32_t
tscEmbedded
;
#define uFatal(...) { if (uDebugFlag & DEBUG_FATAL) { taosPrintLog("UTL FATAL", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
#define uError(...) { if (uDebugFlag & DEBUG_ERROR) { taosPrintLog("UTL ERROR ", tscEmbedded ? 255 : uDebugFlag, __VA_ARGS__); }}
...
...
src/common/src/tglobal.c
浏览文件 @
cabc32e7
...
...
@@ -25,7 +25,6 @@
#include "tutil.h"
#include "tlocale.h"
#include "ttimezone.h"
#include "tsync.h"
// cluster
char
tsFirst
[
TSDB_EP_LEN
]
=
{
0
};
...
...
@@ -172,7 +171,7 @@ int32_t tsEnableStream = 1;
// internal
int32_t
tsPrintAuth
=
0
;
int32_t
tscEmbedded
=
0
;
u
int32_t
tscEmbedded
=
0
;
char
configDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
tsVnodeDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
char
tsDnodeDir
[
TSDB_FILENAME_LEN
]
=
{
0
};
...
...
@@ -210,13 +209,13 @@ int32_t mDebugFlag = 131;
int32_t
sdbDebugFlag
=
131
;
int32_t
dDebugFlag
=
135
;
int32_t
vDebugFlag
=
135
;
int32_t
cDebugFlag
=
131
;
u
int32_t
cDebugFlag
=
131
;
int32_t
jniDebugFlag
=
131
;
int32_t
odbcDebugFlag
=
131
;
int32_t
httpDebugFlag
=
131
;
int32_t
mqttDebugFlag
=
131
;
int32_t
monDebugFlag
=
131
;
int32_t
qDebugFlag
=
131
;
u
int32_t
qDebugFlag
=
131
;
int32_t
rpcDebugFlag
=
131
;
int32_t
uDebugFlag
=
131
;
int32_t
debugFlag
=
0
;
...
...
src/os/inc/osMemory.h
浏览文件 @
cabc32e7
...
...
@@ -52,7 +52,7 @@ void taosTMemset(void *ptr, int c);
free((void *)(x)); \
x = 0; \
} \
} while (0)
;
} while (0)
#ifdef TAOS_MEM_CHECK
#ifdef TAOS_MEM_CHECK_TEST
...
...
src/query/inc/qExecutor.h
浏览文件 @
cabc32e7
...
...
@@ -185,7 +185,7 @@ typedef struct SQueryRuntimeEnv {
uint16_t
scanFlag
;
// denotes reversed scan of data or not
SFillInfo
*
pFillInfo
;
SResultRowInfo
windowResInfo
;
STSBuf
*
pT
S
Buf
;
STSBuf
*
pT
s
Buf
;
STSCursor
cur
;
SQueryCostInfo
summary
;
void
*
pQueryHandle
;
...
...
src/query/inc/queryLog.h
浏览文件 @
cabc32e7
...
...
@@ -22,15 +22,15 @@ extern "C" {
#include "tlog.h"
extern
int32_t
qDebugFlag
;
extern
int32_t
tscEmbedded
;
extern
u
int32_t
qDebugFlag
;
extern
u
int32_t
tscEmbedded
;
#define qFatal(...)
{ if (qDebugFlag & DEBUG_FATAL) { taosPrintLog("QRY FATAL ", 255, __VA_ARGS__); }}
#define qError(...)
{ if (qDebugFlag & DEBUG_ERROR) { taosPrintLog("QRY ERROR ", 255, __VA_ARGS__); }}
#define qWarn(...)
{ if (qDebugFlag & DEBUG_WARN) { taosPrintLog("QRY WARN ", 255, __VA_ARGS__); }}
#define qInfo(...)
{ if (qDebugFlag & DEBUG_INFO) { taosPrintLog("QRY ", 255, __VA_ARGS__); }}
#define qDebug(...)
{ if (qDebugFlag & DEBUG_DEBUG) { taosPrintLog("QRY ", qDebugFlag, __VA_ARGS__); }}
#define qTrace(...)
{ if (qDebugFlag & DEBUG_TRACE) { taosPrintLog("QRY ", qDebugFlag, __VA_ARGS__); }}
#define qFatal(...)
do { if (qDebugFlag & DEBUG_FATAL) { taosPrintLog("QRY FATAL ", 255, __VA_ARGS__); }} while(0)
#define qError(...)
do { if (qDebugFlag & DEBUG_ERROR) { taosPrintLog("QRY ERROR ", 255, __VA_ARGS__); }} while(0)
#define qWarn(...)
do { if (qDebugFlag & DEBUG_WARN) { taosPrintLog("QRY WARN ", 255, __VA_ARGS__); }} while(0)
#define qInfo(...)
do { if (qDebugFlag & DEBUG_INFO) { taosPrintLog("QRY ", 255, __VA_ARGS__); }} while(0)
#define qDebug(...)
do { if (qDebugFlag & DEBUG_DEBUG) { taosPrintLog("QRY ", qDebugFlag, __VA_ARGS__); }} while(0)
#define qTrace(...)
do { if (qDebugFlag & DEBUG_TRACE) { taosPrintLog("QRY ", qDebugFlag, __VA_ARGS__); }} while(0)
#ifdef __cplusplus
}
...
...
src/query/src/qExecutor.c
浏览文件 @
cabc32e7
...
...
@@ -35,7 +35,7 @@
* check if the primary column is load by default, otherwise, the program will
* forced to load primary column explicitly.
*/
#define Q_STATUS_EQUAL(p, s) (((p) & (s)) != 0)
#define Q_STATUS_EQUAL(p, s) (((p) & (s)) != 0
u
)
#define QUERY_IS_ASC_QUERY(q) (GET_FORWARD_DIRECTION_FACTOR((q)->order.order) == QUERY_ASC_FORWARD_STEP)
#define IS_MASTER_SCAN(runtime) ((runtime)->scanFlag == MASTER_SCAN)
...
...
@@ -1420,7 +1420,7 @@ static char *getGroupbyColumnData(SQuery *pQuery, int16_t *type, int16_t *bytes,
static
int32_t
doTSJoinFilter
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
offset
)
{
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pT
S
Buf
);
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pT
s
Buf
);
SQLFunctionCtx
*
pCtx
=
pRuntimeEnv
->
pCtx
;
// compare tag first
...
...
@@ -1432,8 +1432,8 @@ static int32_t doTSJoinFilter(SQueryRuntimeEnv *pRuntimeEnv, int32_t offset) {
#if defined(_DEBUG_VIEW)
printf
(
"elem in comp ts file:%"
PRId64
", key:%"
PRId64
", tag:%"
PRIu64
", query order:%d, ts order:%d, traverse:%d, index:%d
\n
"
,
elem
.
ts
,
key
,
elem
.
tag
.
i64Key
,
pQuery
->
order
.
order
,
pRuntimeEnv
->
pT
S
Buf
->
tsOrder
,
pRuntimeEnv
->
pT
SBuf
->
cur
.
order
,
pRuntimeEnv
->
pTS
Buf
->
cur
.
tsIndex
);
elem
.
ts
,
key
,
elem
.
tag
.
i64Key
,
pQuery
->
order
.
order
,
pRuntimeEnv
->
pT
s
Buf
->
tsOrder
,
pRuntimeEnv
->
pT
sBuf
->
cur
.
order
,
pRuntimeEnv
->
pTs
Buf
->
cur
.
tsIndex
);
#endif
if
(
QUERY_IS_ASC_QUERY
(
pQuery
))
{
...
...
@@ -1603,9 +1603,9 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS
// from top to bottom in desc
// from bottom to top in asc order
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
qDebug
(
"QInfo:%p process data rows, numOfRows:%d, query order:%d, ts comp order:%d"
,
pQInfo
,
pDataBlockInfo
->
rows
,
pQuery
->
order
.
order
,
pRuntimeEnv
->
pT
S
Buf
->
cur
.
order
);
pQuery
->
order
.
order
,
pRuntimeEnv
->
pT
s
Buf
->
cur
.
order
);
}
int32_t
offset
=
-
1
;
...
...
@@ -1615,7 +1615,7 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS
for
(
int32_t
j
=
0
;
j
<
pDataBlockInfo
->
rows
;
++
j
)
{
offset
=
GET_COL_DATA_POS
(
pQuery
,
j
,
step
);
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
int32_t
ret
=
doTSJoinFilter
(
pRuntimeEnv
,
offset
);
if
(
ret
==
TS_JOIN_TAG_NOT_EQUALS
)
{
break
;
...
...
@@ -1729,9 +1729,9 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS
prevTs
=
tsCols
[
offset
];
prevRowIndex
=
offset
;
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
// if timestamp filter list is empty, quit current query
if
(
!
tsBufNextPos
(
pRuntimeEnv
->
pT
S
Buf
))
{
if
(
!
tsBufNextPos
(
pRuntimeEnv
->
pT
s
Buf
))
{
setQueryStatus
(
pQuery
,
QUERY_COMPLETED
);
break
;
}
...
...
@@ -1745,8 +1745,8 @@ static void rowwiseApplyFunctions(SQueryRuntimeEnv *pRuntimeEnv, SDataStatis *pS
item
->
lastKey
=
(
QUERY_IS_ASC_QUERY
(
pQuery
)
?
pDataBlockInfo
->
window
.
ekey
:
pDataBlockInfo
->
window
.
skey
)
+
step
;
}
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
item
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
item
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
}
// todo refactor: extract method
...
...
@@ -1768,7 +1768,7 @@ static int32_t tableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBl
STableQueryInfo
*
pTableQInfo
=
pQuery
->
current
;
SResultRowInfo
*
pWindowResInfo
=
&
pRuntimeEnv
->
windowResInfo
;
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
||
pRuntimeEnv
->
groupbyNormalCol
)
{
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
||
pRuntimeEnv
->
groupbyNormalCol
)
{
rowwiseApplyFunctions
(
pRuntimeEnv
,
pStatis
,
pDataBlockInfo
,
pWindowResInfo
,
pDataBlock
);
}
else
{
blockwiseApplyFunctions
(
pRuntimeEnv
,
pStatis
,
pDataBlockInfo
,
pWindowResInfo
,
searchFn
,
pDataBlock
);
...
...
@@ -2109,7 +2109,7 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
destroyResultBuf
(
pRuntimeEnv
->
pResultBuf
);
doFreeQueryHandle
(
pQInfo
);
pRuntimeEnv
->
pT
SBuf
=
tsBufDestroy
(
pRuntimeEnv
->
pTS
Buf
);
pRuntimeEnv
->
pT
sBuf
=
tsBufDestroy
(
pRuntimeEnv
->
pTs
Buf
);
tfree
(
pRuntimeEnv
->
offset
);
tfree
(
pRuntimeEnv
->
keyBuf
);
...
...
@@ -2621,7 +2621,7 @@ int32_t loadDataBlockOnDemand(SQueryRuntimeEnv *pRuntimeEnv, SResultRowInfo * pW
*
status
=
BLK_DATA_NO_NEEDED
;
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
S
Buf
>
0
)
{
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
s
Buf
>
0
)
{
*
status
=
BLK_DATA_ALL_NEEDED
;
}
else
{
// check if this data block is required to load
...
...
@@ -3009,7 +3009,7 @@ void setTagVal(SQueryRuntimeEnv *pRuntimeEnv, void *pTable, void *tsdb) {
// set the join tag for first column
SSqlFuncMsg
*
pFuncMsg
=
&
pExprInfo
->
base
;
if
((
pFuncMsg
->
functionId
==
TSDB_FUNC_TS
||
pFuncMsg
->
functionId
==
TSDB_FUNC_PRJ
)
&&
pRuntimeEnv
->
pT
S
Buf
!=
NULL
&&
if
((
pFuncMsg
->
functionId
==
TSDB_FUNC_TS
||
pFuncMsg
->
functionId
==
TSDB_FUNC_PRJ
)
&&
pRuntimeEnv
->
pT
s
Buf
!=
NULL
&&
pFuncMsg
->
colInfo
.
colIndex
==
PRIMARYKEY_TIMESTAMP_COL_INDEX
)
{
assert
(
pFuncMsg
->
numOfParams
==
1
);
...
...
@@ -3901,10 +3901,10 @@ static void setEnvBeforeReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatusI
SQInfo
*
pQInfo
=
GET_QINFO_ADDR
(
pRuntimeEnv
);
SQuery
*
pQuery
=
pRuntimeEnv
->
pQuery
;
pStatus
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
// save the cursor
if
(
pRuntimeEnv
->
pT
S
Buf
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
S
Buf
->
cur
.
order
);
bool
ret
=
tsBufNextPos
(
pRuntimeEnv
->
pT
S
Buf
);
pStatus
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
// save the cursor
if
(
pRuntimeEnv
->
pT
s
Buf
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
s
Buf
->
cur
.
order
);
bool
ret
=
tsBufNextPos
(
pRuntimeEnv
->
pT
s
Buf
);
assert
(
ret
);
}
...
...
@@ -3946,9 +3946,9 @@ static void clearEnvAfterReverseScan(SQueryRuntimeEnv *pRuntimeEnv, SQueryStatus
SWITCH_ORDER
(
pQuery
->
order
.
order
);
switchCtxOrder
(
pRuntimeEnv
);
tsBufSetCursor
(
pRuntimeEnv
->
pT
S
Buf
,
&
pStatus
->
cur
);
if
(
pRuntimeEnv
->
pT
S
Buf
)
{
pRuntimeEnv
->
pT
S
Buf
->
cur
.
order
=
pQuery
->
order
.
order
;
tsBufSetCursor
(
pRuntimeEnv
->
pT
s
Buf
,
&
pStatus
->
cur
);
if
(
pRuntimeEnv
->
pT
s
Buf
)
{
pRuntimeEnv
->
pT
s
Buf
->
cur
.
order
=
pQuery
->
order
.
order
;
}
SET_MASTER_SCAN_FLAG
(
pRuntimeEnv
);
...
...
@@ -4137,7 +4137,7 @@ void setExecutionContext(SQInfo *pQInfo, int32_t groupIndex, TSKEY nextKey) {
// lastKey needs to be updated
pTableQueryInfo
->
lastKey
=
nextKey
;
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
setAdditionalInfo
(
pQInfo
,
pTableQueryInfo
->
pTable
,
pTableQueryInfo
);
}
...
...
@@ -4226,13 +4226,13 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
setTagVal
(
pRuntimeEnv
,
pTable
,
pQInfo
->
tsdb
);
// both the master and supplement scan needs to set the correct ts comp start position
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
tVariant
*
pTag
=
&
pRuntimeEnv
->
pCtx
[
0
].
tag
;
if
(
pTableQueryInfo
->
cur
.
vgroupIndex
==
-
1
)
{
tVariantAssign
(
&
pTableQueryInfo
->
tag
,
pTag
);
STSElem
elem
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
S
Buf
,
pQInfo
->
vgId
,
&
pTableQueryInfo
->
tag
);
STSElem
elem
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
s
Buf
,
pQInfo
->
vgId
,
&
pTableQueryInfo
->
tag
);
// failed to find data with the specified tag value and vnodeId
if
(
!
tsBufIsValidElem
(
&
elem
))
{
...
...
@@ -4246,7 +4246,7 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
}
// keep the cursor info of current meter
pTableQueryInfo
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
pTableQueryInfo
->
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p find tag:%s start pos in ts_comp, blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
pz
,
pTableQueryInfo
->
cur
.
blockIndex
,
pTableQueryInfo
->
cur
.
tsIndex
);
}
else
{
...
...
@@ -4254,7 +4254,7 @@ int32_t setAdditionalInfo(SQInfo *pQInfo, void* pTable, STableQueryInfo *pTableQ
}
}
else
{
tsBufSetCursor
(
pRuntimeEnv
->
pT
S
Buf
,
&
pTableQueryInfo
->
cur
);
tsBufSetCursor
(
pRuntimeEnv
->
pT
s
Buf
,
&
pTableQueryInfo
->
cur
);
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p find tag:%s start pos in ts_comp, blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
pz
,
pTableQueryInfo
->
cur
.
blockIndex
,
pTableQueryInfo
->
cur
.
tsIndex
);
...
...
@@ -4463,7 +4463,7 @@ static void stableApplyFunctionsOnBlock(SQueryRuntimeEnv *pRuntimeEnv, SDataBloc
SResultRowInfo
*
pWindowResInfo
=
&
pTableQueryInfo
->
windowResInfo
;
pQuery
->
pos
=
QUERY_IS_ASC_QUERY
(
pQuery
)
?
0
:
pDataBlockInfo
->
rows
-
1
;
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
||
pRuntimeEnv
->
groupbyNormalCol
)
{
if
(
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
||
pRuntimeEnv
->
groupbyNormalCol
)
{
rowwiseApplyFunctions
(
pRuntimeEnv
,
pStatis
,
pDataBlockInfo
,
pWindowResInfo
,
pDataBlock
);
}
else
{
blockwiseApplyFunctions
(
pRuntimeEnv
,
pStatis
,
pDataBlockInfo
,
pWindowResInfo
,
searchFn
,
pDataBlock
);
...
...
@@ -4789,7 +4789,7 @@ static bool skipTimeInterval(SQueryRuntimeEnv *pRuntimeEnv, TSKEY* start) {
assert
(
*
start
<=
pQuery
->
current
->
lastKey
);
// if queried with value filter, do NOT forward query start position
if
(
pQuery
->
limit
.
offset
<=
0
||
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
||
pRuntimeEnv
->
pFillInfo
!=
NULL
)
{
if
(
pQuery
->
limit
.
offset
<=
0
||
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
||
pRuntimeEnv
->
pFillInfo
!=
NULL
)
{
return
true
;
}
...
...
@@ -4994,15 +4994,15 @@ int32_t doInitQInfo(SQInfo *pQInfo, STSBuf *pTsBuf, void *tsdb, int32_t vgId, bo
pQInfo
->
vgId
=
vgId
;
pRuntimeEnv
->
pQuery
=
pQuery
;
pRuntimeEnv
->
pT
S
Buf
=
pTsBuf
;
pRuntimeEnv
->
pT
s
Buf
=
pTsBuf
;
pRuntimeEnv
->
cur
.
vgroupIndex
=
-
1
;
pRuntimeEnv
->
stableQuery
=
isSTableQuery
;
pRuntimeEnv
->
prevGroupId
=
INT32_MIN
;
pRuntimeEnv
->
groupbyNormalCol
=
isGroupbyNormalCol
(
pQuery
->
pGroupbyExpr
);
if
(
pTsBuf
!=
NULL
)
{
int16_t
order
=
(
pQuery
->
order
.
order
==
pRuntimeEnv
->
pT
S
Buf
->
tsOrder
)
?
TSDB_ORDER_ASC
:
TSDB_ORDER_DESC
;
tsBufSetTraverseOrder
(
pRuntimeEnv
->
pT
S
Buf
,
order
);
int16_t
order
=
(
pQuery
->
order
.
order
==
pRuntimeEnv
->
pT
s
Buf
->
tsOrder
)
?
TSDB_ORDER_ASC
:
TSDB_ORDER_DESC
;
tsBufSetTraverseOrder
(
pRuntimeEnv
->
pT
s
Buf
,
order
);
}
int32_t
ps
=
DEFAULT_PAGE_SIZE
;
...
...
@@ -5096,7 +5096,7 @@ static FORCE_INLINE void setEnvForEachBlock(SQInfo* pQInfo, STableQueryInfo* pTa
TSKEY
nextKey
=
pBlockInfo
->
window
.
skey
;
setIntervalQueryRange
(
pQInfo
,
nextKey
);
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
setAdditionalInfo
(
pQInfo
,
pTableQueryInfo
->
pTable
,
pTableQueryInfo
);
}
}
...
...
@@ -5189,7 +5189,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
SArray
*
group
=
GET_TABLEGROUP
(
pQInfo
,
0
);
STableQueryInfo
*
pCheckInfo
=
taosArrayGetP
(
group
,
index
);
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
hasTagResults
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
setTagVal
(
pRuntimeEnv
,
pCheckInfo
->
pTable
,
pQInfo
->
tsdb
);
}
...
...
@@ -5227,11 +5227,11 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
longjmp
(
pRuntimeEnv
->
env
,
terrno
);
}
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
tVariant
*
pTag
=
&
pRuntimeEnv
->
pCtx
[
0
].
tag
;
if
(
pRuntimeEnv
->
cur
.
vgroupIndex
==
-
1
)
{
STSElem
elem
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
S
Buf
,
pQInfo
->
vgId
,
pTag
);
STSElem
elem
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
s
Buf
,
pQInfo
->
vgId
,
pTag
);
// failed to find data with the specified tag value and vnodeId
if
(
!
tsBufIsValidElem
(
&
elem
))
{
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
...
...
@@ -5242,7 +5242,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
return
false
;
}
else
{
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p find tag:%s start pos in ts_comp, blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
pz
,
...
...
@@ -5253,10 +5253,10 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
}
}
}
else
{
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pT
S
Buf
);
STSElem
elem
=
tsBufGetElem
(
pRuntimeEnv
->
pT
s
Buf
);
if
(
tVariantCompare
(
elem
.
tag
,
&
pRuntimeEnv
->
pCtx
[
0
].
tag
)
!=
0
)
{
STSElem
elem1
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
S
Buf
,
pQInfo
->
vgId
,
pTag
);
STSElem
elem1
=
tsBufGetElemStartPos
(
pRuntimeEnv
->
pT
s
Buf
,
pQInfo
->
vgId
,
pTag
);
// failed to find data with the specified tag value and vnodeId
if
(
!
tsBufIsValidElem
(
&
elem1
))
{
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
...
...
@@ -5267,7 +5267,7 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
return
false
;
}
else
{
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p find tag:%s start pos in ts_comp, blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
pz
,
cur
.
blockIndex
,
cur
.
tsIndex
);
}
else
{
...
...
@@ -5276,8 +5276,8 @@ static bool multiTableMultioutputHelper(SQInfo *pQInfo, int32_t index) {
}
}
else
{
tsBufSetCursor
(
pRuntimeEnv
->
pT
S
Buf
,
&
pRuntimeEnv
->
cur
);
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
S
Buf
);
tsBufSetCursor
(
pRuntimeEnv
->
pT
s
Buf
,
&
pRuntimeEnv
->
cur
);
STSCursor
cur
=
tsBufGetCursor
(
pRuntimeEnv
->
pT
s
Buf
);
if
(
pTag
->
nType
==
TSDB_DATA_TYPE_BINARY
||
pTag
->
nType
==
TSDB_DATA_TYPE_NCHAR
)
{
qDebug
(
"QInfo:%p continue scan ts_comp file, tag:%s blockIndex:%d, tsIndex:%d"
,
pQInfo
,
pTag
->
pz
,
cur
.
blockIndex
,
cur
.
tsIndex
);
}
else
{
...
...
@@ -5475,7 +5475,7 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
clearClosedResultRows
(
pRuntimeEnv
,
&
pRuntimeEnv
->
windowResInfo
);
break
;
}
}
else
if
(
pRuntimeEnv
->
queryWindowIdentical
&&
pRuntimeEnv
->
pT
S
Buf
==
NULL
&&
!
isTSCompQuery
(
pQuery
))
{
}
else
if
(
pRuntimeEnv
->
queryWindowIdentical
&&
pRuntimeEnv
->
pT
s
Buf
==
NULL
&&
!
isTSCompQuery
(
pQuery
))
{
//super table projection query with identical query time range for all tables.
SDataBlockInfo
blockInfo
=
SDATA_BLOCK_INITIALIZER
;
resetDefaultResInfoOutputBuf
(
pRuntimeEnv
);
...
...
@@ -5686,8 +5686,8 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
break
;
}
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
pRuntimeEnv
->
cur
=
pRuntimeEnv
->
pT
S
Buf
->
cur
;
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
pRuntimeEnv
->
cur
=
pRuntimeEnv
->
pT
s
Buf
->
cur
;
}
}
else
{
...
...
@@ -5722,8 +5722,8 @@ static void sequentialTableProcess(SQInfo *pQInfo) {
finalizeQueryResult
(
pRuntimeEnv
);
}
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
pRuntimeEnv
->
cur
=
pRuntimeEnv
->
pT
S
Buf
->
cur
;
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
pRuntimeEnv
->
cur
=
pRuntimeEnv
->
pT
s
Buf
->
cur
;
}
qDebug
(
"QInfo %p numOfTables:%"
PRIu64
", index:%d, numOfGroups:%"
PRIzu
", %"
PRId64
...
...
@@ -5741,8 +5741,8 @@ static void doSaveContext(SQInfo *pQInfo) {
SWAP
(
pQuery
->
window
.
skey
,
pQuery
->
window
.
ekey
,
TSKEY
);
SWITCH_ORDER
(
pQuery
->
order
.
order
);
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
S
Buf
->
cur
.
order
);
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
s
Buf
->
cur
.
order
);
}
STsdbQueryCond
cond
=
createTsdbQueryCond
(
pQuery
,
&
pQuery
->
window
);
...
...
@@ -5770,8 +5770,8 @@ static void doRestoreContext(SQInfo *pQInfo) {
SWAP
(
pQuery
->
window
.
skey
,
pQuery
->
window
.
ekey
,
TSKEY
);
if
(
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
S
Buf
->
cur
.
order
);
if
(
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
{
SWITCH_ORDER
(
pRuntimeEnv
->
pT
s
Buf
->
cur
.
order
);
}
switchCtxOrder
(
pRuntimeEnv
);
...
...
@@ -6038,7 +6038,7 @@ static void tableIntervalProcessImpl(SQueryRuntimeEnv *pRuntimeEnv, TSKEY start)
// here we can ignore the records in case of no interpolation
// todo handle offset, in case of top/bottom interval query
if
((
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
S
Buf
!=
NULL
)
&&
pQuery
->
limit
.
offset
>
0
&&
if
((
pQuery
->
numOfFilterCols
>
0
||
pRuntimeEnv
->
pT
s
Buf
!=
NULL
)
&&
pQuery
->
limit
.
offset
>
0
&&
pQuery
->
fillType
==
TSDB_FILL_NONE
)
{
// maxOutput <= 0, means current query does not generate any results
int32_t
numOfClosed
=
numOfClosedResultRows
(
&
pRuntimeEnv
->
windowResInfo
);
...
...
src/rpc/inc/rpcLog.h
浏览文件 @
cabc32e7
...
...
@@ -23,7 +23,7 @@ extern "C" {
#include "tlog.h"
extern
int32_t
rpcDebugFlag
;
extern
int32_t
tscEmbedded
;
extern
u
int32_t
tscEmbedded
;
#define tFatal(...) { if (rpcDebugFlag & DEBUG_FATAL) { taosPrintLog("RPC FATAL ", tscEmbedded ? 255 : rpcDebugFlag, __VA_ARGS__); }}
#define tError(...) { if (rpcDebugFlag & DEBUG_ERROR) { taosPrintLog("RPC ERROR ", tscEmbedded ? 255 : rpcDebugFlag, __VA_ARGS__); }}
...
...
src/util/src/ttimer.c
浏览文件 @
cabc32e7
...
...
@@ -19,7 +19,7 @@
#include "ttimer.h"
#include "tutil.h"
extern
int32_t
tscEmbedded
;
extern
u
int32_t
tscEmbedded
;
#define tmrFatal(...) { if (tmrDebugFlag & DEBUG_FATAL) { taosPrintLog("TMR FATAL ", tscEmbedded ? 255 : tmrDebugFlag, __VA_ARGS__); }}
#define tmrError(...) { if (tmrDebugFlag & DEBUG_ERROR) { taosPrintLog("TMR ERROR ", tscEmbedded ? 255 : tmrDebugFlag, __VA_ARGS__); }}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录