diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index 105072eb9b..55401d7eb2 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -24,7 +24,6 @@ #include "scheduler.h" #include "tcompare.h" #include "tdatablock.h" -#include "tgeosctx.h" #include "tglobal.h" #include "tmsg.h" #include "tref.h" diff --git a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c index a593a36049..fdce9fd4c9 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmMgmt.c +++ b/source/dnode/mgmt/node_mgmt/src/dmMgmt.c @@ -19,7 +19,6 @@ #include "index.h" #include "qworker.h" #include "tcompression.h" -#include "tgeosctx.h" #include "tglobal.h" #include "tgrant.h" #include "tstream.h" diff --git a/source/libs/geometry/src/geosWrapper.c b/source/libs/geometry/src/geosWrapper.c index b55ece4037..b362faa28c 100644 --- a/source/libs/geometry/src/geosWrapper.c +++ b/source/libs/geometry/src/geosWrapper.c @@ -419,7 +419,6 @@ int32_t readGeometry(const unsigned char *input, GEOSGeometry **outputGeom, SGeosContext *geosCtx = NULL; TAOS_CHECK_RETURN(getThreadLocalGeosCtx(&geosCtx)); - *outputGeom = GEOSWKBReader_read_r(geosCtx->handle, geosCtx->WKBReader, varDataVal(input), varDataLen(input)); if (*outputGeom == NULL) { return TSDB_CODE_FUNC_FUNTION_PARA_VALUE; diff --git a/source/util/src/tgeosctx.c b/source/util/src/tgeosctx.c index bfaed88671..e8015f691a 100644 --- a/source/util/src/tgeosctx.c +++ b/source/util/src/tgeosctx.c @@ -72,21 +72,13 @@ int32_t getThreadLocalGeosCtx(SGeosContext **ppCtx) { TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); } - tlGeosCtx = taosThreadGetSpecific(tlGeosCtxKey); - if (tlGeosCtx == NULL) { - if (errno) { - TAOS_CHECK_EXIT(TAOS_SYSTEM_ERROR(errno)); - } else { - TAOS_CHECK_EXIT(TSDB_CODE_NOT_FOUND); - } - } + tlGeosCtx = &tlGeosCtxObj; *ppCtx = tlGeosCtx; _exit: if (code != 0) { *ppCtx = NULL; uError("failed to get geos context at lino:%d since %s", lino, tstrerror(code)); } - TAOS_RETURN(code); }