From 8476adc48497a03c7692bdb30b5444cf8e3828a0 Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Sun, 8 Oct 2023 10:19:10 +0200 Subject: [PATCH] Move explain utility functions to src/import This moves EXPLAIN utility functions into apache to make it available to all custom nodes. Since these are copies of static postgres functions there is no reason for them to be TSL licensed. --- src/import/CMakeLists.txt | 5 +++-- {tsl/src => src}/import/ts_explain.c | 4 ++-- {tsl/src => src}/import/ts_explain.h | 14 ++++++++------ tsl/src/CMakeLists.txt | 1 - tsl/src/import/CMakeLists.txt | 2 -- 5 files changed, 13 insertions(+), 13 deletions(-) rename {tsl/src => src}/import/ts_explain.c (95%) rename {tsl/src => src}/import/ts_explain.h (51%) delete mode 100644 tsl/src/import/CMakeLists.txt diff --git a/src/import/CMakeLists.txt b/src/import/CMakeLists.txt index d77fe535a7a..f6e08a0c6a4 100644 --- a/src/import/CMakeLists.txt +++ b/src/import/CMakeLists.txt @@ -1,6 +1,7 @@ set(SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/planner.c ${CMAKE_CURRENT_SOURCE_DIR}/allpaths.c - ${CMAKE_CURRENT_SOURCE_DIR}/ht_hypertable_modify.c) + ${CMAKE_CURRENT_SOURCE_DIR}/ht_hypertable_modify.c + ${CMAKE_CURRENT_SOURCE_DIR}/planner.c + ${CMAKE_CURRENT_SOURCE_DIR}/ts_explain.c) target_sources(${PROJECT_NAME} PRIVATE ${SOURCES}) diff --git a/tsl/src/import/ts_explain.c b/src/import/ts_explain.c similarity index 95% rename from tsl/src/import/ts_explain.c rename to src/import/ts_explain.c index 35dbd07e909..69b41711f52 100644 --- a/tsl/src/import/ts_explain.c +++ b/src/import/ts_explain.c @@ -1,7 +1,7 @@ /* - * This file and its contents are licensed under the Timescale License. + * This file and its contents are licensed under the Apache License 2.0. * Please see the included NOTICE for copyright information and - * LICENSE-TIMESCALE for a copy of the license. + * LICENSE-APACHE for a copy of the license. */ /* diff --git a/tsl/src/import/ts_explain.h b/src/import/ts_explain.h similarity index 51% rename from tsl/src/import/ts_explain.h rename to src/import/ts_explain.h index cddb65a5c57..030b61ec9c5 100644 --- a/tsl/src/import/ts_explain.h +++ b/src/import/ts_explain.h @@ -1,7 +1,7 @@ /* - * This file and its contents are licensed under the Timescale License. + * This file and its contents are licensed under the Apache License 2.0. * Please see the included NOTICE for copyright information and - * LICENSE-TIMESCALE for a copy of the license. + * LICENSE-APACHE for a copy of the license. */ /* @@ -19,8 +19,10 @@ #include #include -void ts_show_scan_qual(List *qual, const char *qlabel, PlanState *planstate, List *ancestors, - ExplainState *es); +#include "export.h" -void ts_show_instrumentation_count(const char *qlabel, int which, PlanState *planstate, - ExplainState *es); +extern TSDLLEXPORT void ts_show_scan_qual(List *qual, const char *qlabel, PlanState *planstate, + List *ancestors, ExplainState *es); + +extern TSDLLEXPORT void ts_show_instrumentation_count(const char *qlabel, int which, + PlanState *planstate, ExplainState *es); diff --git a/tsl/src/CMakeLists.txt b/tsl/src/CMakeLists.txt index ee1a2de3e6b..1e8ceadb4de 100644 --- a/tsl/src/CMakeLists.txt +++ b/tsl/src/CMakeLists.txt @@ -61,6 +61,5 @@ add_subdirectory(bgw_policy) add_subdirectory(compression) add_subdirectory(continuous_aggs) add_subdirectory(fdw) -add_subdirectory(import) add_subdirectory(nodes) add_subdirectory(remote) diff --git a/tsl/src/import/CMakeLists.txt b/tsl/src/import/CMakeLists.txt deleted file mode 100644 index beccff95dd9..00000000000 --- a/tsl/src/import/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ts_explain.c) -target_sources(${TSL_LIBRARY_NAME} PRIVATE ${SOURCES})