diff --git a/source/libs/index/CMakeLists.txt b/source/libs/index/CMakeLists.txt index 33133d21ae287c6de281cc90665b4a81f0d51931..0c2ce37c4030dbb018eb7871f396be60aa0fc076 100644 --- a/source/libs/index/CMakeLists.txt +++ b/source/libs/index/CMakeLists.txt @@ -35,7 +35,7 @@ if (${BUILD_WITH_INVERTEDINDEX}) endif(${BUILD_WITH_INVERTEDINDEX}) -# if (${BUILD_TEST}) -# add_subdirectory(test) -# endif(${BUILD_TEST}) +if (${BUILD_TEST}) + add_subdirectory(test) +endif(${BUILD_TEST}) diff --git a/source/libs/index/src/indexFstFile.c b/source/libs/index/src/indexFstFile.c index 77dce211504046a796474cb0311bf67deb437314..9106caebd6b61581041167bfd4ac4e4a6b090cf1 100644 --- a/source/libs/index/src/indexFstFile.c +++ b/source/libs/index/src/indexFstFile.c @@ -71,9 +71,7 @@ static int idxFileCtxGetSize(IFileCtx* ctx) { } static int idxFileCtxDoFlush(IFileCtx* ctx) { if (ctx->type == TFile) { - // taosFsyncFile(ctx->file.pFile); taosFsyncFile(ctx->file.pFile); - // tfFlush(ctx->file.pFile); } else { // do nothing } @@ -190,13 +188,11 @@ int idxFileRead(IdxFstFile* write, uint8_t* buf, uint32_t len) { return 0; } IFileCtx* ctx = write->wrt; - int nRead = ctx->read(ctx, buf, len); - // assert(nRead == len); - return nRead; + return ctx->read(ctx, buf, len); } uint32_t idxFileMaskedCheckSum(IdxFstFile* write) { - // opt + ////// return write->summer; } diff --git a/source/libs/index/src/indexTfile.c b/source/libs/index/src/indexTfile.c index e9abd3e577614b2225a71cc17277ff2a17f9c52b..70cdedd91782d0ae39240ac29f47cb98224c401a 100644 --- a/source/libs/index/src/indexTfile.c +++ b/source/libs/index/src/indexTfile.c @@ -457,7 +457,10 @@ static int32_t tfSearchCompareFunc_JSON(void* reader, SIndexTerm* tem, SIdxTRslt } else if (0 != strncmp(ch, p, skip)) { continue; } - cond = cmpFn(ch + skip, tem->colVal, IDX_TYPE_GET_TYPE(tem->colType)); + char* tBuf = taosMemoryCalloc(1, sz + 1); + memcpy(tBuf, ch, sz); + cond = cmpFn(tBuf + skip, tem->colVal, IDX_TYPE_GET_TYPE(tem->colType)); + taosMemoryFree(tBuf); } if (MATCH == cond) { tfileReaderLoadTableIds((TFileReader*)reader, rt->out.out, tr->total); diff --git a/source/libs/transport/src/transSvr.c b/source/libs/transport/src/transSvr.c index 4f33c8cdc1fd214e7bcce1578f7386ce4d29d161..58d6d5368468f1814e82e89a93e0243ed23c0915 100644 --- a/source/libs/transport/src/transSvr.c +++ b/source/libs/transport/src/transSvr.c @@ -1,7 +1,6 @@ /* * Copyright (c) 2019 TAOS Data, Inc. - * - * This program is free software: you can use, redistribute, and/or modify + * * This program is free software: you can use, redistribute, and/or modify * it under the terms of the GNU Affero General Public License, version 3 * or later ("AGPL"), as published by the Free Software Foundation. *