From d266bfe1875e758bcb33a23243fb69d1b022dcb0 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 20 Jul 2022 08:39:52 +0800 Subject: [PATCH] fix: fix stmt memory leak --- include/os/osSysinfo.h | 2 +- source/dnode/mgmt/exe/dmMain.c | 4 ++-- source/libs/function/src/udfd.c | 4 ++-- source/os/src/osSysinfo.c | 2 +- tests/script/api/batchprepare.c | 9 +++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/os/osSysinfo.h b/include/os/osSysinfo.h index 4ec2e2884e..6eed31b5e9 100644 --- a/include/os/osSysinfo.h +++ b/include/os/osSysinfo.h @@ -33,7 +33,7 @@ typedef struct { SDiskSize size; } SDiskSpace; -bool taosCheckSystemIsSmallEnd(); +bool taosCheckSystemIsLittleEnd(); void taosGetSystemInfo(); int32_t taosGetEmail(char *email, int32_t maxLen); int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen); diff --git a/source/dnode/mgmt/exe/dmMain.c b/source/dnode/mgmt/exe/dmMain.c index 00c32e1990..013cc05c65 100644 --- a/source/dnode/mgmt/exe/dmMain.c +++ b/source/dnode/mgmt/exe/dmMain.c @@ -158,8 +158,8 @@ static void taosCleanupArgs() { } int main(int argc, char const *argv[]) { - if (!taosCheckSystemIsSmallEnd()) { - printf("failed to start since on non-small-end machines\n"); + if (!taosCheckSystemIsLittleEnd()) { + printf("failed to start since on non-little-end machines\n"); return -1; } diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 74fca69aa7..2402607251 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -913,8 +913,8 @@ void udfdConnectMnodeThreadFunc(void *args) { } int main(int argc, char *argv[]) { - if (!taosCheckSystemIsSmallEnd()) { - printf("failed to start since on non-small-end machines\n"); + if (!taosCheckSystemIsLittleEnd()) { + printf("failed to start since on non-little-end machines\n"); return -1; } diff --git a/source/os/src/osSysinfo.c b/source/os/src/osSysinfo.c index b6220b0ae8..8450e8baea 100644 --- a/source/os/src/osSysinfo.c +++ b/source/os/src/osSysinfo.c @@ -210,7 +210,7 @@ static int32_t taosGetProcCpuInfo(ProcCpuInfo *cpuInfo) { } -bool taosCheckSystemIsSmallEnd() { +bool taosCheckSystemIsLittleEnd() { union check { int16_t i; char ch[2]; diff --git a/tests/script/api/batchprepare.c b/tests/script/api/batchprepare.c index e89a8b33eb..ada2039460 100644 --- a/tests/script/api/batchprepare.c +++ b/tests/script/api/batchprepare.c @@ -299,7 +299,7 @@ CaseCtrl gCaseCtrl = { // query case with specified col&oper .printRes = true, .runTimes = 0, .caseRunIdx = -1, - .caseIdx = 23, + .caseIdx = 5, .caseNum = 1, .caseRunNum = 1, }; @@ -1408,7 +1408,7 @@ void bpCheckColFields(TAOS_STMT *stmt, TAOS_MULTI_BIND* pBind) { void bpShowBindParam(TAOS_MULTI_BIND *bind, int32_t num) { for (int32_t i = 0; i < num; ++i) { TAOS_MULTI_BIND* b = &bind[i]; - printf("Bind %d: type[%d],buf[%p],buflen[%d],len[%],null[%d],num[%d]\n", + printf("Bind %d: type[%d],buf[%p],buflen[%d],len[%d],null[%d],num[%d]\n", i, b->buffer_type, b->buffer, b->buffer_length, b->length ? *b->length : 0, b->is_null ? *b->is_null : 0, b->num); } } @@ -2599,7 +2599,6 @@ void runAll(TAOS *taos) { runCaseList(taos); #if 0 - strcpy(gCaseCtrl.caseCatalog, "Micro DB precision Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); gCaseCtrl.precision = TIME_PRECISION_MICRO; @@ -2655,13 +2654,15 @@ void runAll(TAOS *taos) { gCaseCtrl.bindColNum = 6; runCaseList(taos); gCaseCtrl.bindColNum = 0; +#endif +/* strcpy(gCaseCtrl.caseCatalog, "Bind Col Type Test"); printf("%s Begin\n", gCaseCtrl.caseCatalog); gCaseCtrl.bindColTypeNum = tListLen(bindColTypeList); gCaseCtrl.bindColTypeList = bindColTypeList; runCaseList(taos); -#endif +*/ printf("All Test End\n"); } -- GitLab