Skip to content

Commit 678fb20

Browse files
committed
Merge branch 'connect/10.2' into 10.2
2 parents 58b56f1 + 60fa113 commit 678fb20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+33656
-882
lines changed

storage/connect/CMakeLists.txt

Lines changed: 15 additions & 15 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 )
41+
add_definitions( -DNEW_MAR -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT )
4242

4343

4444
#
@@ -247,11 +247,8 @@ ENDIF(CONNECT_WITH_ODBC)
247247
#
248248
# JDBC and MongoDB Java Driver
249249
#
250-
IF(APPLE)
251-
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine without JDBC support" OFF)
252-
ELSE()
253-
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)
254-
ENDIF()
250+
OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON)
251+
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)
255252

256253
IF(CONNECT_WITH_JDBC)
257254
FIND_PACKAGE(Java 1.6)
@@ -263,12 +260,9 @@ IF(CONNECT_WITH_JDBC)
263260
# SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked
264261
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
265262
javaconn.cpp jdbconn.cpp tabjdbc.cpp
266-
jmgoconn.cpp jmgfam.cpp mongo.cpp tabjmg.cpp
267263
jdbccat.h javaconn.h jdbconn.h tabjdbc.h
268-
jmgoconn.h jmgfam.h mongo.h tabjmg.h
269264
JdbcInterface.java ApacheInterface.java MariadbInterface.java
270265
MysqlInterface.java OracleInterface.java PostgresqlInterface.java
271-
Mongo2Interface.java Mongo3Interface.java
272266
JavaWrappers.jar)
273267
# TODO: Find how to compile and install the java wrapper classes
274268
# Find required libraries and include directories
@@ -278,6 +272,13 @@ IF(CONNECT_WITH_JDBC)
278272
${CMAKE_CURRENT_BINARY_DIR}/JdbcInterface.jar
279273
DESTINATION ${INSTALL_PLUGINDIR} COMPONENT connect-engine)
280274
add_definitions(-DJDBC_SUPPORT)
275+
IF(CONNECT_WITH_MONGO)
276+
SET(CONNECT_SOURCES ${CONNECT_SOURCES}
277+
jmgfam.cpp jmgoconn.cpp mongo.cpp tabjmg.cpp
278+
jmgfam.h jmgoconn.h mongo.h tabjmg.h
279+
Mongo2Interface.java Mongo3Interface.java)
280+
add_definitions(-DMONGO_SUPPORT)
281+
ENDIF()
281282
ELSE()
282283
SET(JDBC_LIBRARY "")
283284
ENDIF()
@@ -299,8 +300,6 @@ ENDIF(CONNECT_WITH_ZIP)
299300
# MONGO C Driver (CMAKE NOT YET WORKING)
300301
#
301302

302-
#OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON)
303-
304303
#IF(CONNECT_WITH_MONGO)
305304
# IF(WIN32)
306305
# # Adding some typical places to search in
@@ -311,17 +310,18 @@ ENDIF(CONNECT_WITH_ZIP)
311310
# C:/mongo-c-driver/lib
312311
# D:/mongo-c-driver/lib)
313312
# ENDIF(WIN32)
314-
# FIND_PACKAGE(libmongoc)
313+
# FIND_PACKAGE(libmongoc 1.7)
315314
# IF (MONGO_FOUND)
316315
# INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR})
317316
# SET(MONGO_LIBRARY ${MONGO_LIBRARIES})
318317
# SET(CONNECT_SOURCES ${CONNECT_SOURCES}
319-
# cmgoconn.cpp mongofam.cpp tabmgo.cpp
320-
# cmgoconn.h mongofam.h tabmgo.h)
318+
# cmgoconn.cpp cmgfam.cpp tabcmg.cpp
319+
# cmgoconn.h cmgfam.h tabcmg.h)
320+
# add_definitions(-DCMGO_SUPPORT)
321321
# IF (NOT JAVA_FOUND AND JNI_FOUND)
322322
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
323+
# add_definitions(-DMONGO_SUPPORT)
323324
# ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
324-
# add_definitions(-DMONGO_SUPPORT)
325325
# ENDIF(MONGO_FOUND)
326326
#ENDIF(CONNECT_WITH_MONGO)
327327

storage/connect/JavaWrappers.jar

4.23 KB
Binary file not shown.

storage/connect/mongofam.cpp renamed to storage/connect/cmgfam.cpp

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/************ MONGO FAM C++ Program Source Code File (.CPP) ************/
2-
/* PROGRAM NAME: mongofam.cpp */
1+
/************** CMGFAM C++ Program Source Code File (.CPP) *************/
2+
/* PROGRAM NAME: cmgfam.cpp */
33
/* ------------- */
4-
/* Version 1.3 */
4+
/* Version 1.4 */
55
/* */
66
/* COPYRIGHT: */
77
/* ---------- */
@@ -30,18 +30,18 @@
3030
#include "filamtxt.h"
3131
#include "tabdos.h"
3232
#include "tabjson.h"
33-
#include "mongofam.h"
33+
#include "cmgfam.h"
3434

3535
#if defined(UNIX) || defined(UNIV_LINUX)
3636
#include "osutil.h"
3737
#endif
3838

39-
/* --------------------------- Class MGOFAM -------------------------- */
39+
/* --------------------------- Class CMGFAM -------------------------- */
4040

4141
/***********************************************************************/
4242
/* Constructors. */
4343
/***********************************************************************/
44-
MGOFAM::MGOFAM(PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
44+
CMGFAM::CMGFAM(PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
4545
{
4646
Cmgp = NULL;
4747
Pcg.Tdbp = NULL;
@@ -66,20 +66,20 @@ MGOFAM::MGOFAM(PJDEF tdp) : DOSFAM((PDOSDEF)NULL)
6666
Mode = MODE_ANY;
6767
Done = false;
6868
Lrecl = tdp->Lrecl + tdp->Ending;
69-
} // end of MGOFAM standard constructor
69+
} // end of CMGFAM standard constructor
7070

71-
MGOFAM::MGOFAM(PMGOFAM tdfp) : DOSFAM(tdfp)
71+
CMGFAM::CMGFAM(PCMGFAM tdfp) : DOSFAM(tdfp)
7272
{
7373
Pcg = tdfp->Pcg;
7474
To_Fbt = tdfp->To_Fbt;
7575
Mode = tdfp->Mode;
7676
Done = tdfp->Done;
77-
} // end of MGOFAM copy constructor
77+
} // end of CMGFAM copy constructor
7878

7979
/***********************************************************************/
8080
/* Reset: reset position values at the beginning of file. */
8181
/***********************************************************************/
82-
void MGOFAM::Reset(void)
82+
void CMGFAM::Reset(void)
8383
{
8484
TXTFAM::Reset();
8585
Fpos = Tpos = Spos = 0;
@@ -88,7 +88,7 @@ void MGOFAM::Reset(void)
8888
/***********************************************************************/
8989
/* MGO GetFileLength: returns file size in number of bytes. */
9090
/***********************************************************************/
91-
int MGOFAM::GetFileLength(PGLOBAL g)
91+
int CMGFAM::GetFileLength(PGLOBAL g)
9292
{
9393
return 0;
9494
} // end of GetFileLength
@@ -98,7 +98,7 @@ int MGOFAM::GetFileLength(PGLOBAL g)
9898
/* This function can be called with a null argument to test the */
9999
/* availability of Cardinality implementation (1 yes, 0 no). */
100100
/***********************************************************************/
101-
int MGOFAM::Cardinality(PGLOBAL g)
101+
int CMGFAM::Cardinality(PGLOBAL g)
102102
{
103103
if (!g)
104104
return 1;
@@ -109,15 +109,15 @@ int MGOFAM::Cardinality(PGLOBAL g)
109109
/***********************************************************************/
110110
/* Note: This function is not really implemented yet. */
111111
/***********************************************************************/
112-
int MGOFAM::MaxBlkSize(PGLOBAL, int s)
112+
int CMGFAM::MaxBlkSize(PGLOBAL, int s)
113113
{
114114
return s;
115115
} // end of MaxBlkSize
116116

117117
/***********************************************************************/
118118
/* Init: initialize MongoDB processing. */
119119
/***********************************************************************/
120-
bool MGOFAM::Init(PGLOBAL g)
120+
bool CMGFAM::Init(PGLOBAL g)
121121
{
122122
if (Done)
123123
return false;
@@ -141,7 +141,7 @@ bool MGOFAM::Init(PGLOBAL g)
141141
/***********************************************************************/
142142
/* OpenTableFile: Open a MongoDB table. */
143143
/***********************************************************************/
144-
bool MGOFAM::OpenTableFile(PGLOBAL g)
144+
bool CMGFAM::OpenTableFile(PGLOBAL g)
145145
{
146146
Mode = Tdbp->GetMode();
147147

@@ -165,31 +165,31 @@ bool MGOFAM::OpenTableFile(PGLOBAL g)
165165
/***********************************************************************/
166166
/* GetRowID: return the RowID of last read record. */
167167
/***********************************************************************/
168-
int MGOFAM::GetRowID(void)
168+
int CMGFAM::GetRowID(void)
169169
{
170170
return Rows;
171171
} // end of GetRowID
172172

173173
/***********************************************************************/
174174
/* GetPos: return the position of last read record. */
175175
/***********************************************************************/
176-
int MGOFAM::GetPos(void)
176+
int CMGFAM::GetPos(void)
177177
{
178178
return Fpos;
179179
} // end of GetPos
180180

181181
/***********************************************************************/
182182
/* GetNextPos: return the position of next record. */
183183
/***********************************************************************/
184-
int MGOFAM::GetNextPos(void)
184+
int CMGFAM::GetNextPos(void)
185185
{
186186
return Fpos; // TODO
187187
} // end of GetNextPos
188188

189189
/***********************************************************************/
190190
/* SetPos: Replace the table at the specified position. */
191191
/***********************************************************************/
192-
bool MGOFAM::SetPos(PGLOBAL g, int pos)
192+
bool CMGFAM::SetPos(PGLOBAL g, int pos)
193193
{
194194
Fpos = pos;
195195
Placed = true;
@@ -199,33 +199,33 @@ bool MGOFAM::SetPos(PGLOBAL g, int pos)
199199
/***********************************************************************/
200200
/* Record file position in case of UPDATE or DELETE. */
201201
/***********************************************************************/
202-
bool MGOFAM::RecordPos(PGLOBAL g)
202+
bool CMGFAM::RecordPos(PGLOBAL g)
203203
{
204-
strcpy(g->Message, "MGOFAM::RecordPos NIY");
204+
strcpy(g->Message, "CMGFAM::RecordPos NIY");
205205
return true;
206206
} // end of RecordPos
207207

208208
/***********************************************************************/
209209
/* Initialize Fpos and the current position for indexed DELETE. */
210210
/***********************************************************************/
211-
int MGOFAM::InitDelete(PGLOBAL g, int fpos, int spos)
211+
int CMGFAM::InitDelete(PGLOBAL g, int fpos, int spos)
212212
{
213-
strcpy(g->Message, "MGOFAM::InitDelete NIY");
213+
strcpy(g->Message, "CMGFAM::InitDelete NIY");
214214
return RC_FX;
215215
} // end of InitDelete
216216

217217
/***********************************************************************/
218218
/* Skip one record in file. */
219219
/***********************************************************************/
220-
int MGOFAM::SkipRecord(PGLOBAL g, bool header)
220+
int CMGFAM::SkipRecord(PGLOBAL g, bool header)
221221
{
222222
return RC_OK; // Dummy
223223
} // end of SkipRecord
224224

225225
/***********************************************************************/
226226
/* ReadBuffer: Get next document from a collection. */
227227
/***********************************************************************/
228-
int MGOFAM::ReadBuffer(PGLOBAL g)
228+
int CMGFAM::ReadBuffer(PGLOBAL g)
229229
{
230230
int rc = Cmgp->ReadNext(g);
231231

@@ -239,23 +239,23 @@ int MGOFAM::ReadBuffer(PGLOBAL g)
239239
/***********************************************************************/
240240
/* WriteBuffer: File write routine for MGO access method. */
241241
/***********************************************************************/
242-
int MGOFAM::WriteBuffer(PGLOBAL g)
242+
int CMGFAM::WriteBuffer(PGLOBAL g)
243243
{
244244
return Cmgp->Write(g);
245245
} // end of WriteBuffer
246246

247247
/***********************************************************************/
248248
/* Data Base delete line routine for MGO and BLK access methods. */
249249
/***********************************************************************/
250-
int MGOFAM::DeleteRecords(PGLOBAL g, int irc)
250+
int CMGFAM::DeleteRecords(PGLOBAL g, int irc)
251251
{
252252
return (irc == RC_OK) ? WriteBuffer(g) : RC_OK;
253253
} // end of DeleteRecords
254254

255255
/***********************************************************************/
256256
/* Table file close routine for MGO access method. */
257257
/***********************************************************************/
258-
void MGOFAM::CloseTableFile(PGLOBAL g, bool)
258+
void CMGFAM::CloseTableFile(PGLOBAL g, bool)
259259
{
260260
Cmgp->Close();
261261
Done = false;
@@ -264,7 +264,7 @@ void MGOFAM::CloseTableFile(PGLOBAL g, bool)
264264
/***********************************************************************/
265265
/* Rewind routine for MGO access method. */
266266
/***********************************************************************/
267-
void MGOFAM::Rewind(void)
267+
void CMGFAM::Rewind(void)
268268
{
269269
Cmgp->Rewind();
270270
} // end of Rewind

storage/connect/mongofam.h renamed to storage/connect/cmgfam.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/************** MongoFam H Declares Source Code File (.H) **************/
2-
/* Name: mongofam.h Version 1.4 */
1+
/*************** CMGFam H Declares Source Code File (.H) ***************/
2+
/* Name: cmgfam.h Version 1.5 */
33
/* */
44
/* (C) Copyright to the author Olivier BERTRAND 2017 */
55
/* */
@@ -8,27 +8,27 @@
88
#include "cmgoconn.h"
99

1010
typedef class TXTFAM *PTXF;
11-
typedef class MGOFAM *PMGOFAM;
11+
typedef class CMGFAM *PCMGFAM;
1212
typedef class MGODEF *PMGODEF;
13-
typedef class TDBMGO *PTDBMGO;
13+
typedef class TDBCMG *PTDBCMG;
1414

1515
/***********************************************************************/
1616
/* This is the MongoDB Access Method class declaration. */
1717
/***********************************************************************/
18-
class DllExport MGOFAM : public DOSFAM {
18+
class DllExport CMGFAM : public DOSFAM {
1919
friend void mongo_init(bool);
2020
public:
2121
// Constructor
22-
MGOFAM(PJDEF tdp);
23-
MGOFAM(PMGOFAM txfp);
22+
CMGFAM(PJDEF tdp);
23+
CMGFAM(PCMGFAM txfp);
2424

2525
// Implementation
2626
virtual AMT GetAmType(void) { return TYPE_AM_MGO; }
2727
virtual bool GetUseTemp(void) { return false; }
2828
virtual int GetPos(void);
2929
virtual int GetNextPos(void);
3030
void SetTdbp(PTDBDOS tdbp) { Tdbp = tdbp; }
31-
virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) MGOFAM(this); }
31+
virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) CMGFAM(this); }
3232
void SetLrecl(int lrecl) { Lrecl = lrecl; }
3333

3434
// Methods
@@ -61,5 +61,5 @@ class DllExport MGOFAM : public DOSFAM {
6161
PFBLOCK To_Fbt; // Pointer to temp file block
6262
MODE Mode;
6363
bool Done; // Init done
64-
}; // end of class MGOFAM
64+
}; // end of class CMGFAM
6565

0 commit comments

Comments
 (0)