Skip to content

Commit ed0674c

Browse files
Merge branch 'main' into cmake/simon/0408
2 parents df4f077 + e04ac2f commit ed0674c

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

source/libs/executor/src/executor.c

+1-10
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,6 @@ int32_t qGetQueryTableSchemaVersion(qTaskInfo_t tinfo, char* dbName, int32_t dbN
626626

627627
bool qIsDynamicExecTask(qTaskInfo_t tinfo) { return ((SExecTaskInfo*)tinfo)->dynamicTask; }
628628

629-
void destroyOperatorParam(SOperatorParam* pParam) {
630-
if (NULL == pParam) {
631-
return;
632-
}
633-
634-
// TODO
635-
}
636-
637629
void qDestroyOperatorParam(SOperatorParam* pParam) {
638630
if (NULL == pParam) {
639631
return;
@@ -642,8 +634,7 @@ void qDestroyOperatorParam(SOperatorParam* pParam) {
642634
}
643635

644636
void qUpdateOperatorParam(qTaskInfo_t tinfo, void* pParam) {
645-
destroyOperatorParam(((SExecTaskInfo*)tinfo)->pOpParam);
646-
((SExecTaskInfo*)tinfo)->pOpParam = pParam;
637+
TSWAP(pParam, ((SExecTaskInfo*)tinfo)->pOpParam);
647638
((SExecTaskInfo*)tinfo)->paramSet = false;
648639
}
649640

source/libs/executor/src/executorInt.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,9 @@ void freeOperatorParamImpl(SOperatorParam* pParam, SOperatorParamType type) {
11931193
}
11941194

11951195
taosArrayDestroy(pParam->pChildren);
1196+
pParam->pChildren = NULL;
11961197

1197-
taosMemoryFree(pParam->value);
1198+
taosMemoryFreeClear(pParam->value);
11981199

11991200
taosMemoryFree(pParam);
12001201
}

source/libs/executor/src/querytask.c

+4
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ void doDestroyTask(SExecTaskInfo* pTaskInfo) {
287287

288288
taosArrayDestroyEx(pTaskInfo->pResultBlockList, freeBlock);
289289
taosArrayDestroy(pTaskInfo->stopInfo.pStopInfo);
290+
if (!pTaskInfo->paramSet) {
291+
freeOperatorParam(pTaskInfo->pOpParam, OP_GET_PARAM);
292+
pTaskInfo->pOpParam = NULL;
293+
}
290294
taosMemoryFreeClear(pTaskInfo->sql);
291295
taosMemoryFreeClear(pTaskInfo->id.str);
292296
taosMemoryFreeClear(pTaskInfo);

source/libs/qworker/src/qworker.c

+1
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ int32_t qwProcessFetch(QW_FPARAMS_DEF, SQWMsg *qwMsg) {
10661066

10671067
if (qwMsg->msg) {
10681068
qDestroyOperatorParam(qwMsg->msg);
1069+
qwMsg->msg = NULL;
10691070
}
10701071

10711072
input.code = code;

source/os/test/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ add_test(
7979
COMMAND osSleepTests
8080
)
8181

82+
if(NOT TD_WINDOWS)
8283
add_executable(osStringTests "osStringTests.cpp")
8384
target_link_libraries(osStringTests os util gtest_main)
8485
add_test(
8586
NAME osStringTests
8687
COMMAND osStringTests
8788
)
89+
endif()
8890

8991
add_executable(osSystemTests "osSystemTests.cpp")
9092
target_link_libraries(osSystemTests os util gtest_main)

tests/system-test/2-query/fill2.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -988,19 +988,19 @@ def validate_fill_prev_one_group(self, fill_res_one_group, interval_res_one_grou
988988
## from now on, all rows are generated by fill
989989
for colIdx in range(1, colNum):
990990
if fill_row[colIdx] != last_valid_row_val[colIdx]:
991-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {last_valid_row_val[colIdx]} got: {fill_row[colIdx]}")
991+
tdLog.exit(f"1 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {last_valid_row_val[colIdx]} got: {fill_row}")
992992
if desc_row[colIdx] != last_valid_row_val[colIdx]:
993-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {last_valid_row_val[colIdx]} got: {desc_row[colIdx]}")
993+
tdLog.exit(f"2 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {last_valid_row_val[colIdx]} got: {desc_row}")
994994
i += 1
995995
else:
996996
if fill_ts < interval_row[0]:
997997
## this row is generated by fill
998998
for colIdx in range(1, colNum):
999999
val = self.find_valid_val_for_col(interval_res_one_group, j-1, False, colIdx)
10001000
if val != fill_row[colIdx]:
1001-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row[colIdx]}")
1001+
tdLog.exit(f"3 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row}")
10021002
if val != desc_row[colIdx]:
1003-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {desc_row[colIdx]}")
1003+
tdLog.exit(f"4 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {desc_row}")
10041004
i += 1
10051005
else:
10061006
## this row is copied from interval, but NULL cols are generated by fill
@@ -1012,9 +1012,9 @@ def validate_fill_prev_one_group(self, fill_res_one_group, interval_res_one_grou
10121012
else:
10131013
val = interval_row[colIdx]
10141014
if val != fill_row[colIdx]:
1015-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row[colIdx]}")
1015+
tdLog.exit(f"5 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row}")
10161016
if filled and val != desc_row[colIdx]:
1017-
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {desc_row[colIdx]}")
1017+
tdLog.exit(f"6 got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {desc_row}")
10181018
i += 1
10191019
j += 1
10201020

@@ -1263,9 +1263,9 @@ def validate_fill_linear_one_group(self, fill_res_one_group, interval_res_one_gr
12631263
if fill_row[colIdx] is not None or desc_row[colIdx] is not None:
12641264
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row[colIdx]}")
12651265
else:
1266-
if not math.isclose(val, fill_row[colIdx], rel_tol=1e-6, abs_tol=1e-6):
1266+
if not math.isclose(val, fill_row[colIdx], rel_tol=1e-5, abs_tol=1e-6):
12671267
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {fill_row[colIdx]}")
1268-
if not math.isclose(val, desc_row[colIdx], rel_tol=1e-6, abs_tol=1e-6):
1268+
if not math.isclose(val, desc_row[colIdx], rel_tol=1e-5, abs_tol=1e-6):
12691269
tdLog.exit(f"got different val for fill_res: {fill_row} rowIdx: {i} colIdx: {colIdx}, expect: {val} got: {desc_row[colIdx]}")
12701270
i += 1
12711271
else:

0 commit comments

Comments
 (0)