Skip to content

Commit c23b832

Browse files
committed
- Fix MongoDB C Driver adding for CMAKE.
Requires MongoDB C Driver version 1.7 now available modified: storage/connect/CMakeLists.txt - Add more trace to tbl_thread.test (to debug failure) modified: storage/connect/mysql-test/connect/r/tbl_thread.result modified: storage/connect/mysql-test/connect/t/tbl_thread.test
1 parent f610310 commit c23b832

File tree

3 files changed

+37
-28
lines changed

3 files changed

+37
-28
lines changed

storage/connect/CMakeLists.txt

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
3838
# Definitions that are shared for all OSes
3939
#
4040
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
41-
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT -DUSE_TRY )
41+
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT )
4242

4343

4444
#
@@ -290,33 +290,33 @@ IF(CONNECT_WITH_ZIP)
290290
ENDIF(CONNECT_WITH_ZIP)
291291

292292
#
293-
# MONGO C Driver (CMAKE NOT YET WORKING)
293+
# MONGO C Driver
294294
#
295295

296-
#IF(CONNECT_WITH_MONGO)
297-
# IF(WIN32)
298-
# # Adding some typical places to search in
299-
# SET(PC_MONGO_INCLUDE_DIRS
300-
# C:/mongo-c-driver/include
301-
# D:/mongo-c-driver/include)
302-
# SET(PC_MONGO_LIBRARY_DIRS
303-
# C:/mongo-c-driver/lib
304-
# D:/mongo-c-driver/lib)
305-
# ENDIF(WIN32)
306-
# FIND_PACKAGE(libmongoc 1.7)
307-
# IF (MONGO_FOUND)
308-
# INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR})
309-
# SET(MONGO_LIBRARY ${MONGO_LIBRARIES})
310-
# SET(CONNECT_SOURCES ${CONNECT_SOURCES}
311-
# cmgoconn.cpp cmgfam.cpp tabcmg.cpp
312-
# cmgoconn.h cmgfam.h tabcmg.h)
313-
# add_definitions(-DCMGO_SUPPORT)
314-
# IF (NOT JAVA_FOUND AND JNI_FOUND)
315-
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
316-
# add_definitions(-DMONGO_SUPPORT)
317-
# ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
318-
# ENDIF(MONGO_FOUND)
319-
#ENDIF(CONNECT_WITH_MONGO)
296+
IF(CONNECT_WITH_MONGO)
297+
IF(WIN32)
298+
# Adding some typical places to search in
299+
SET(PC_MONGO_INCLUDE_DIRS
300+
C:/mongo-c-driver/include
301+
D:/mongo-c-driver/include)
302+
SET(PC_MONGO_LIBRARY_DIRS
303+
C:/mongo-c-driver/lib
304+
D:/mongo-c-driver/lib)
305+
ENDIF(WIN32)
306+
FIND_PACKAGE(libmongoc-1.0 1.7)
307+
IF (libmongoc-1.0_FOUND)
308+
INCLUDE_DIRECTORIES(${MONGOC_INCLUDE_DIRS})
309+
SET(MONGOC_LIBRARY ${MONGOC_LIBRARIES})
310+
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
311+
cmgoconn.cpp cmgfam.cpp tabcmg.cpp
312+
cmgoconn.h cmgfam.h tabcmg.h)
313+
add_definitions(-DCMGO_SUPPORT)
314+
IF (NOT JAVA_FOUND AND JNI_FOUND)
315+
SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
316+
add_definitions(-DMONGO_SUPPORT)
317+
ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
318+
ENDIF(libmongoc-1.0_FOUND)
319+
ENDIF(CONNECT_WITH_MONGO)
320320

321321

322322
#
@@ -337,9 +337,8 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
337337
STORAGE_ENGINE
338338
COMPONENT connect-engine
339339
RECOMPILE_FOR_EMBEDDED
340-
# LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} $(MONGO_LIBRARY)
341340
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
342-
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY})
341+
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${MONGOC_LIBRARY} ${IPHLPAPI_LIBRARY})
343342

344343
IF(NOT TARGET connect)
345344
RETURN()
@@ -369,3 +368,5 @@ IF(CONNECT_WITH_JDBC AND JAVA_FOUND AND JNI_FOUND)
369368
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
370369
ENDIF()
371370

371+
372+

storage/connect/mysql-test/connect/r/tbl_thread.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ a b
7979
CREATE TABLE total (a int, b char(10))
8080
ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4,t5'
8181
OPTION_LIST='thread=yes,port=PORT';
82+
set connect_xtrace=1;
8283
SELECT * FROM total order by a desc;
8384
a b
8485
19 test19
@@ -101,6 +102,7 @@ a b
101102
2 test02
102103
1 test01
103104
0 test00
105+
set connect_xtrace=0;
104106
DROP TABLE rt2;
105107
DROP TABLE rt3,rt4,rt5;
106108
DROP TABLE t1,t2,t3,t4,t5,total;
@@ -116,10 +118,12 @@ SELECT * FROM t2;
116118
v
117119
22
118120
CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=PORT';;
121+
set connect_xtrace=1;
119122
SELECT * FROM total order by v desc;
120123
v
121124
22
122125
11
126+
set connect_xtrace=0;
123127
DROP TABLE t1,t2,total;
124128
#
125129
# Old thread TBL tables test not modified (suppressed until MDEV-10179 is fixed)

storage/connect/mysql-test/connect/t/tbl_thread.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ SELECT * FROM t5;
5656
eval CREATE TABLE total (a int, b char(10))
5757
ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2,t3,t4,t5'
5858
OPTION_LIST='thread=yes,port=$PORT';
59+
set connect_xtrace=1;
5960
SELECT * FROM total order by a desc;
61+
set connect_xtrace=0;
6062

6163
connection master;
6264

@@ -83,7 +85,9 @@ SELECT * FROM t2;
8385

8486
--replace_result $PORT PORT
8587
--eval CREATE TABLE total (v BIGINT(20) UNSIGNED NOT NULL) ENGINE=CONNECT TABLE_TYPE=TBL TABLE_LIST='t1,t2' OPTION_LIST='thread=yes,port=$PORT';
88+
set connect_xtrace=1;
8689
SELECT * FROM total order by v desc;
90+
set connect_xtrace=0;
8791
DROP TABLE t1,t2,total;
8892

8993
--echo #

0 commit comments

Comments
 (0)