From 96252b6abd4ab9252fb8ba51f3b11d3e3fa3d603 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Tue, 29 Aug 2017 17:35:27 +0200 Subject: - New distribution enabling or disabling the MONGO table type modified: storage/connect/CMakeLists.txt modified: storage/connect/ha_connect.cc modified: storage/connect/mycat.cc - Extend SRCDEF parameter processing to MYSQL modified: storage/connect/tabext.cpp modified: storage/connect/tabext.h modified: storage/connect/tabmysql.cpp - Typo modified: storage/connect/mysql-test/connect/std_data/Mongo2.jar modified: storage/connect/mysql-test/connect/std_data/Mongo3.jar --- storage/connect/CMakeLists.txt | 44 +++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'storage/connect/CMakeLists.txt') diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index af6bb5374a4..c23598323a3 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -245,7 +245,7 @@ int main() { ENDIF(CONNECT_WITH_ODBC) # -# JDBC and MongoDB Java Driver +# JDBC with MongoDB Java Driver included and enabled # OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) @@ -264,21 +264,14 @@ IF(CONNECT_WITH_JDBC) JdbcInterface.java ApacheInterface.java MariadbInterface.java MysqlInterface.java OracleInterface.java PostgresqlInterface.java JavaWrappers.jar) - # TODO: Find how to compile and install the java wrapper classes - # Find required libraries and include directories - SET (JAVA_SOURCES JdbcInterface.java) - add_jar(JdbcInterface ${JAVA_SOURCES}) - install_jar(JdbcInterface DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/JavaWrappers.jar - DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) add_definitions(-DJDBC_SUPPORT) - IF(CONNECT_WITH_MONGO) + IF(CONNECT_WITH_MONGO) SET(CONNECT_SOURCES ${CONNECT_SOURCES} jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp jmgfam.h jmgoconn.h mongo.h tabjmg.h Mongo2Interface.java Mongo3Interface.java) add_definitions(-DMONGO_SUPPORT) - ENDIF() + ENDIF() ELSE() SET(JDBC_LIBRARY "") ENDIF() @@ -314,7 +307,7 @@ ENDIF(CONNECT_WITH_ZIP) # IF (MONGO_FOUND) # INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR}) # SET(MONGO_LIBRARY ${MONGO_LIBRARIES}) -# SET(CONNECT_SOURCES ${CONNECT_SOURCES} +# SET(CONNECT_SOURCES ${CONNECT_SOURCES} # cmgoconn.cpp cmgfam.cpp tabcmg.cpp # cmgoconn.h cmgfam.h tabcmg.h) # add_definitions(-DCMGO_SUPPORT) @@ -348,4 +341,33 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES} LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}) +IF(NOT TARGET connect) + RETURN() +ENDIF() + +# Install some extra files that belong to connect engine +IF(WIN32) + # install ha_connect.lib + GET_TARGET_PROPERTY(CONNECT_LOCATION connect LOCATION) + STRING(REPLACE "dll" "lib" CONNECT_LIB ${CONNECT_LOCATION}) + IF(CMAKE_CONFIGURATION_TYPES) + STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" + CONNECT_LIB ${CONNECT_LIB}) + ENDIF() + INSTALL(FILES ${CONNECT_LIB} + DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) +ENDIF(WIN32) + +IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND) + # TODO: Find how to compile and install the java wrapper classes + # Find required libraries and include directories + SET (JAVA_SOURCES JdbcInterface.java) + add_jar(JdbcInterface ${JAVA_SOURCES}) + INSTALL(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/JavaWrappers.jar + ${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar + DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) +ENDIF() + + -- cgit v1.2.1 From 36b2dec1141f04479d4805e068bd549248c4c4c7 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Thu, 31 Aug 2017 01:22:50 +0200 Subject: - Set MONGO_ENABLED modified: storage/connect/CMakeLists.txt - Avoid gcc warnings for "fall through" modified: storage/connect/array.cpp modified: storage/connect/filamdbf.cpp modified: storage/connect/filamfix.cpp modified: storage/connect/filamtxt.cpp modified: storage/connect/filamvct.cpp modified: storage/connect/filamzip.cpp modified: storage/connect/filter.cpp modified: storage/connect/ha_connect.cc modified: storage/connect/jsonudf.cpp modified: storage/connect/plgdbutl.cpp modified: storage/connect/reldef.cpp modified: storage/connect/tabdos.cpp modified: storage/connect/tabjson.cpp modified: storage/connect/xobject.cpp --- storage/connect/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage/connect/CMakeLists.txt') diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index c23598323a3..d9bef33a835 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -270,7 +270,7 @@ IF(CONNECT_WITH_JDBC) jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp jmgfam.h jmgoconn.h mongo.h tabjmg.h Mongo2Interface.java Mongo3Interface.java) - add_definitions(-DMONGO_SUPPORT) + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=1) ENDIF() ELSE() SET(JDBC_LIBRARY "") -- cgit v1.2.1 From 01d86c74af2330e01d7b424563d2d3b6d0762e54 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 2 Sep 2017 10:59:39 +0200 Subject: - Fix MongoDB C Driver adding for CMAKE. Requires MongoDB C Driver version 1.7 now available modified: storage/connect/CMakeLists.txt --- storage/connect/CMakeLists.txt | 53 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'storage/connect/CMakeLists.txt') diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index d9bef33a835..32172a59448 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -290,33 +290,33 @@ IF(CONNECT_WITH_ZIP) ENDIF(CONNECT_WITH_ZIP) # -# MONGO C Driver (CMAKE NOT YET WORKING) +# MONGO C Driver # -#IF(CONNECT_WITH_MONGO) -# IF(WIN32) -# # Adding some typical places to search in -# SET(PC_MONGO_INCLUDE_DIRS -# C:/mongo-c-driver/include -# D:/mongo-c-driver/include) -# SET(PC_MONGO_LIBRARY_DIRS -# C:/mongo-c-driver/lib -# D:/mongo-c-driver/lib) -# ENDIF(WIN32) -# FIND_PACKAGE(libmongoc 1.7) -# IF (MONGO_FOUND) -# INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR}) -# SET(MONGO_LIBRARY ${MONGO_LIBRARIES}) -# SET(CONNECT_SOURCES ${CONNECT_SOURCES} -# cmgoconn.cpp cmgfam.cpp tabcmg.cpp -# cmgoconn.h cmgfam.h tabcmg.h) -# add_definitions(-DCMGO_SUPPORT) -# IF (NOT JAVA_FOUND AND JNI_FOUND) -# SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h) -# add_definitions(-DMONGO_SUPPORT) -# ENDIF (NOT JAVA_FOUND AND JNI_FOUND) -# ENDIF(MONGO_FOUND) -#ENDIF(CONNECT_WITH_MONGO) +IF(CONNECT_WITH_MONGO) + IF(WIN32) + # Adding some typical places to search in + SET(PC_MONGO_INCLUDE_DIRS + C:/mongo-c-driver/include + D:/mongo-c-driver/include) + SET(PC_MONGO_LIBRARY_DIRS + C:/mongo-c-driver/lib + D:/mongo-c-driver/lib) + ENDIF(WIN32) + FIND_PACKAGE(libmongoc-1.0 1.7) + IF (libmongoc-1.0_FOUND) + INCLUDE_DIRECTORIES(${MONGOC_INCLUDE_DIRS}) + SET(MONGOC_LIBRARY ${MONGOC_LIBRARIES}) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} + cmgoconn.cpp cmgfam.cpp tabcmg.cpp + cmgoconn.h cmgfam.h tabcmg.h) + add_definitions(-DCMGO_SUPPORT) + IF (NOT JAVA_FOUND AND JNI_FOUND) + SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h) + add_definitions(-DMONGO_SUPPORT) + ENDIF (NOT JAVA_FOUND AND JNI_FOUND) + ENDIF(libmongoc-1.0_FOUND) +ENDIF(CONNECT_WITH_MONGO) # @@ -337,9 +337,8 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES} STORAGE_ENGINE COMPONENT connect-engine RECOMPILE_FOR_EMBEDDED -# LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} $(MONGO_LIBRARY) LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} - ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}) + ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY}) IF(NOT TARGET connect) RETURN() -- cgit v1.2.1 From 7ccce51b0991d41b5145c6f132121c71de62fc85 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Sat, 2 Sep 2017 14:57:49 +0200 Subject: Disable MONGO modified: storage/connect/CMakeLists.txt --- storage/connect/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage/connect/CMakeLists.txt') diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index 32172a59448..a2e30cc2689 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -245,7 +245,7 @@ int main() { ENDIF(CONNECT_WITH_ODBC) # -# JDBC with MongoDB Java Driver included and enabled +# JDBC with MongoDB Java Driver included but disabled # OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON) @@ -270,7 +270,7 @@ IF(CONNECT_WITH_JDBC) jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp jmgfam.h jmgoconn.h mongo.h tabjmg.h Mongo2Interface.java Mongo3Interface.java) - add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=1) + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=0) ENDIF() ELSE() SET(JDBC_LIBRARY "") -- cgit v1.2.1 From bf34e9db7be5baf64d131ce7c793be77172e4ed2 Mon Sep 17 00:00:00 2001 From: Olivier Bertrand Date: Mon, 11 Sep 2017 16:23:06 +0200 Subject: Enable MONGO for the C driver. Modified: modified: storage/connect/CMakeLists.txt --- storage/connect/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'storage/connect/CMakeLists.txt') diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index a2e30cc2689..9c02a60e6b3 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -313,7 +313,10 @@ IF(CONNECT_WITH_MONGO) add_definitions(-DCMGO_SUPPORT) IF (NOT JAVA_FOUND AND JNI_FOUND) SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h) - add_definitions(-DMONGO_SUPPORT) + add_definitions(-DMONGO_SUPPORT -DMONGO_ENABLED=1) + ELSE () + remove_definitions(-DMONGO_ENABLED=0) + add_definitions(-DMONGO_ENABLED=1) ENDIF (NOT JAVA_FOUND AND JNI_FOUND) ENDIF(libmongoc-1.0_FOUND) ENDIF(CONNECT_WITH_MONGO) @@ -368,5 +371,3 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND) DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine) ENDIF() - - -- cgit v1.2.1