Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
436bc5cb
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
436bc5cb
编写于
12月 30, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: remove asserts
上级
2673b6a5
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
46 addition
and
41 deletion
+46
-41
source/libs/catalog/inc/catalogInt.h
source/libs/catalog/inc/catalogInt.h
+8
-8
source/libs/catalog/src/ctgDbg.c
source/libs/catalog/src/ctgDbg.c
+0
-1
source/libs/catalog/src/ctgRemote.c
source/libs/catalog/src/ctgRemote.c
+16
-6
source/libs/command/src/command.c
source/libs/command/src/command.c
+0
-1
source/libs/command/src/explain.c
source/libs/command/src/explain.c
+0
-1
source/libs/qcom/src/queryUtil.c
source/libs/qcom/src/queryUtil.c
+6
-7
source/libs/qworker/inc/qwInt.h
source/libs/qworker/inc/qwInt.h
+8
-8
source/libs/qworker/src/qworker.c
source/libs/qworker/src/qworker.c
+0
-1
source/libs/scheduler/inc/schInt.h
source/libs/scheduler/inc/schInt.h
+8
-8
未找到文件。
source/libs/catalog/inc/catalogInt.h
浏览文件 @
436bc5cb
...
...
@@ -582,34 +582,34 @@ typedef struct SCtgOperation {
#define CTG_LOCK(type, _lock) \
do { \
if (CTG_READ == (type)) { \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value before read lock");
\
CTG_LOCK_DEBUG("CTG RLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRLockLatch(_lock); \
CTG_LOCK_DEBUG("CTG RLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) > 0);
\
ASSERTS(atomic_load_32((_lock)) > 0, "invalid lock value after read lock");
\
} else { \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value before write lock");
\
CTG_LOCK_DEBUG("CTG WLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWLockLatch(_lock); \
CTG_LOCK_DEBUG("CTG WLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value after write lock");
\
} \
} while (0)
#define CTG_UNLOCK(type, _lock) \
do { \
if (CTG_READ == (type)) { \
assert(atomic_load_32((_lock)) > 0);
\
ASSERTS(atomic_load_32((_lock)) > 0, "invalid lock value before read unlock");
\
CTG_LOCK_DEBUG("CTG RULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRUnLockLatch(_lock); \
CTG_LOCK_DEBUG("CTG RULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after read unlock");
\
} else { \
assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value before write unlock");
\
CTG_LOCK_DEBUG("CTG WULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWUnLockLatch(_lock); \
CTG_LOCK_DEBUG("CTG WULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after write unlock");
\
} \
} while (0)
...
...
source/libs/catalog/src/ctgDbg.c
浏览文件 @
436bc5cb
...
...
@@ -22,7 +22,6 @@ extern SCatalogMgmt gCtgMgmt;
SCtgDebug
gCTGDebug
=
{
0
};
void
ctgdUserCallback
(
SMetaData
*
pResult
,
void
*
param
,
int32_t
code
)
{
ASSERT
(
*
(
int32_t
*
)
param
==
1
);
taosMemoryFree
(
param
);
qDebug
(
"async call result: %s"
,
tstrerror
(
code
));
...
...
source/libs/catalog/src/ctgRemote.c
浏览文件 @
436bc5cb
...
...
@@ -40,7 +40,9 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
msgNum
=
taosArrayGetSize
(
batchRsp
.
pRsps
);
}
ASSERT
(
taskNum
==
msgNum
||
0
==
msgNum
);
if
(
ASSERTS
(
taskNum
==
msgNum
||
0
==
msgNum
,
"taskNum %d mis-match msgNum %d"
,
taskNum
,
msgNum
))
{
msgNum
=
0
;
}
ctgDebug
(
"QID:0x%"
PRIx64
" ctg got batch %d rsp %s"
,
pJob
->
queryId
,
cbParam
->
batchId
,
TMSG_INFO
(
cbParam
->
reqType
+
1
));
...
...
@@ -58,11 +60,19 @@ int32_t ctgHandleBatchRsp(SCtgJob* pJob, SCtgTaskCallbackParam* cbParam, SDataBu
if
(
msgNum
>
0
)
{
pRsp
=
taosArrayGet
(
batchRsp
.
pRsps
,
i
);
taskMsg
.
msgType
=
pRsp
->
reqType
;
taskMsg
.
pData
=
pRsp
->
msg
;
taskMsg
.
len
=
pRsp
->
msgLen
;
ASSERT
(
pRsp
->
msgIdx
==
*
msgIdx
);
if
(
ASSERTS
(
pRsp
->
msgIdx
==
*
msgIdx
,
"rsp msgIdx %d mis-match msgIdx %d"
,
pRsp
->
msgIdx
,
*
msgIdx
))
{
pRsp
=
&
rsp
;
pRsp
->
msgIdx
=
*
msgIdx
;
pRsp
->
reqType
=
-
1
;
pRsp
->
rspCode
=
0
;
taskMsg
.
msgType
=
-
1
;
taskMsg
.
pData
=
NULL
;
taskMsg
.
len
=
0
;
}
else
{
taskMsg
.
msgType
=
pRsp
->
reqType
;
taskMsg
.
pData
=
pRsp
->
msg
;
taskMsg
.
len
=
pRsp
->
msgLen
;
}
}
else
{
pRsp
=
&
rsp
;
pRsp
->
msgIdx
=
*
msgIdx
;
...
...
source/libs/command/src/command.c
浏览文件 @
436bc5cb
...
...
@@ -40,7 +40,6 @@ static int32_t buildRetrieveTableRsp(SSDataBlock* pBlock, int32_t numOfCols, SRe
(
*
pRsp
)
->
numOfCols
=
htonl
(
numOfCols
);
int32_t
len
=
blockEncode
(
pBlock
,
(
*
pRsp
)
->
data
,
numOfCols
);
ASSERT
(
len
==
rspSize
-
sizeof
(
SRetrieveTableRsp
));
return
TSDB_CODE_SUCCESS
;
}
...
...
source/libs/command/src/explain.c
浏览文件 @
436bc5cb
...
...
@@ -1666,7 +1666,6 @@ int32_t qExplainGetRspFromCtx(void *ctx, SRetrieveTableRsp **pRsp) {
rsp
->
numOfRows
=
htobe64
((
int64_t
)
rowNum
);
int32_t
len
=
blockEncode
(
pBlock
,
rsp
->
data
,
taosArrayGetSize
(
pBlock
->
pDataBlock
));
ASSERT
(
len
==
rspSize
-
sizeof
(
SRetrieveTableRsp
));
rsp
->
compLen
=
htonl
(
len
);
...
...
source/libs/qcom/src/queryUtil.c
浏览文件 @
436bc5cb
...
...
@@ -116,8 +116,6 @@ int32_t cleanupTaskQueue() {
}
static
void
execHelper
(
struct
SSchedMsg
*
pSchedMsg
)
{
assert
(
pSchedMsg
!=
NULL
&&
pSchedMsg
->
ahandle
!=
NULL
);
__async_exec_fn_t
execFn
=
(
__async_exec_fn_t
)
pSchedMsg
->
ahandle
;
int32_t
code
=
execFn
(
pSchedMsg
->
thandle
);
if
(
code
!=
0
&&
pSchedMsg
->
msg
!=
NULL
)
{
...
...
@@ -126,8 +124,6 @@ static void execHelper(struct SSchedMsg* pSchedMsg) {
}
int32_t
taosAsyncExec
(
__async_exec_fn_t
execFn
,
void
*
execParam
,
int32_t
*
code
)
{
assert
(
execFn
!=
NULL
);
SSchedMsg
schedMsg
=
{
0
};
schedMsg
.
fp
=
execHelper
;
schedMsg
.
ahandle
=
execFn
;
...
...
@@ -138,7 +134,10 @@ int32_t taosAsyncExec(__async_exec_fn_t execFn, void* execParam, int32_t* code)
}
void
destroySendMsgInfo
(
SMsgSendInfo
*
pMsgBody
)
{
assert
(
pMsgBody
!=
NULL
);
if
(
NULL
==
pMsgBody
)
{
return
;
}
taosMemoryFreeClear
(
pMsgBody
->
target
.
dbFName
);
taosMemoryFreeClear
(
pMsgBody
->
msgInfo
.
pData
);
if
(
pMsgBody
->
paramFreeFp
)
{
...
...
@@ -394,7 +393,7 @@ char* parseTagDatatoJson(void* p) {
}
else
if
(
pTagVal
->
nData
==
0
)
{
value
=
cJSON_CreateString
(
""
);
}
else
{
ASSERT
(
0
)
;
goto
end
;
}
cJSON_AddItemToObject
(
json
,
tagJsonKey
,
value
);
...
...
@@ -413,7 +412,7 @@ char* parseTagDatatoJson(void* p) {
}
cJSON_AddItemToObject
(
json
,
tagJsonKey
,
value
);
}
else
{
ASSERT
(
0
)
;
goto
end
;
}
}
string
=
cJSON_PrintUnformatted
(
json
);
...
...
source/libs/qworker/inc/qwInt.h
浏览文件 @
436bc5cb
...
...
@@ -316,34 +316,34 @@ typedef struct SQWorkerMgmt {
#define QW_LOCK(type, _lock) \
do { \
if (QW_READ == (type)) { \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value before read lock");
\
QW_LOCK_DEBUG("QW RLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRLockLatch(_lock); \
QW_LOCK_DEBUG("QW RLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) > 0);
\
ASSERTS(atomic_load_32((_lock)) > 0, "invalid lock value after read lock");
\
} else { \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value before write lock");
\
QW_LOCK_DEBUG("QW WLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWLockLatch(_lock); \
QW_LOCK_DEBUG("QW WLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value after write lock");
\
} \
} while (0)
#define QW_UNLOCK(type, _lock) \
do { \
if (QW_READ == (type)) { \
assert(atomic_load_32((_lock)) > 0);
\
ASSERTS(atomic_load_32((_lock)) > 0, "invalid lock value before read unlock");
\
QW_LOCK_DEBUG("QW RULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRUnLockLatch(_lock); \
QW_LOCK_DEBUG("QW RULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after read unlock");
\
} else { \
assert(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32((_lock)) == TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value before write unlock");
\
QW_LOCK_DEBUG("QW WULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWUnLockLatch(_lock); \
QW_LOCK_DEBUG("QW WULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after write unlock");
\
} \
} while (0)
...
...
source/libs/qworker/src/qworker.c
浏览文件 @
436bc5cb
...
...
@@ -147,7 +147,6 @@ int32_t qwExecTask(QW_FPARAMS_DEF, SQWTaskCtx *ctx, bool *queryStop) {
size_t
numOfResBlock
=
taosArrayGetSize
(
pResList
);
for
(
int32_t
j
=
0
;
j
<
numOfResBlock
;
++
j
)
{
SSDataBlock
*
pRes
=
taosArrayGetP
(
pResList
,
j
);
ASSERT
(
pRes
->
info
.
rows
>
0
);
SInputData
inputData
=
{.
pData
=
pRes
};
code
=
dsPutDataBlock
(
sinkHandle
,
&
inputData
,
&
qcontinue
);
...
...
source/libs/scheduler/inc/schInt.h
浏览文件 @
436bc5cb
...
...
@@ -478,34 +478,34 @@ extern SSchedulerMgmt schMgmt;
#define SCH_LOCK(type, _lock) \
do { \
if (SCH_READ == (type)) { \
assert(atomic_load_32(_lock) >= 0);
\
ASSERTS(atomic_load_32(_lock) >= 0, "invalid lock value before read lock");
\
SCH_LOCK_DEBUG("SCH RLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRLockLatch(_lock); \
SCH_LOCK_DEBUG("SCH RLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32(_lock) > 0);
\
ASSERTS(atomic_load_32(_lock) > 0, "invalid lock value after read lock");
\
} else { \
assert(atomic_load_32(_lock) >= 0);
\
ASSERTS(atomic_load_32(_lock) >= 0, "invalid lock value before write lock");
\
SCH_LOCK_DEBUG("SCH WLOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWLockLatch(_lock); \
SCH_LOCK_DEBUG("SCH WLOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32(_lock) == TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32(_lock) == TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value after write lock");
\
} \
} while (0)
#define SCH_UNLOCK(type, _lock) \
do { \
if (SCH_READ == (type)) { \
assert(atomic_load_32((_lock)) > 0);
\
ASSERTS(atomic_load_32((_lock)) > 0, "invalid lock value before read unlock");
\
SCH_LOCK_DEBUG("SCH RULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosRUnLockLatch(_lock); \
SCH_LOCK_DEBUG("SCH RULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after read unlock");
\
} else { \
assert(atomic_load_32((_lock)) & TD_RWLATCH_WRITE_FLAG_COPY);
\
ASSERTS(atomic_load_32((_lock)) & TD_RWLATCH_WRITE_FLAG_COPY, "invalid lock value before write unlock");
\
SCH_LOCK_DEBUG("SCH WULOCK%p:%d, %s:%d B", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
taosWUnLockLatch(_lock); \
SCH_LOCK_DEBUG("SCH WULOCK%p:%d, %s:%d E", (_lock), atomic_load_32(_lock), __FILE__, __LINE__); \
assert(atomic_load_32((_lock)) >= 0);
\
ASSERTS(atomic_load_32((_lock)) >= 0, "invalid lock value after write unlock");
\
} \
} while (0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录