mariadb/storage/connect/mongo.h
Olivier Bertrand bcfb5b2de9 - Update version number
modified:   storage/connect/ha_connect.cc

- Include MONGO in all Java enabled distributions
  Mongo will be enabled only for 10.2 and 10.3
  modified:   storage/connect/CMakeLists.txt

- Change JDBC_SUPPORT to JAVA_SUPPORT which also replaces MONGO_SUPPORT
  MONGO_SUPPORT is now just used to enable the MONGO table type
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h
  modified:   storage/connect/mongo.cpp
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h

- Move MakeSelector function from FILTER to mongo.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/filter.h
  modified:   storage/connect/cmgoconn.cpp
  modified:   storage/connect/jmgoconn.cpp
  modified:   storage/connect/mongo.cpp

- Do mongo_init only on first use of the MongoDB C Driver
  This will permit to delay load the mongo lib on Windows
  modified:   storage/connect/cmgoconn.cpp
  modified:   storage/connect/cmgoconn.h
  modified:   storage/connect/ha_connect.cc

- Replace NEW_VAR by a test on MYSQL_VERSION_ID
  modified:   storage/connect/ha_connect.cc

- Suppress enable_mongo session variable
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc

- Make some function headers identical in .h and .cc file
  (replacing const char* by PCSZ)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h

- Change a parameter type from uchar* to const uchar*
  (for ScanRecord and CheckRecord)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h

- Changes on LIKE and NOT LIKE does not fix a bug yet
  modified:   storage/connect/ha_connect.cc

- Suppress PIVOT_SUPPORT (PIVOT type is unconditionnal)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc

- Change the strz function from inline to static
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/ha_connect.h

- export the JavaConn class and the MgoColumns and IsNum functions
  modified:   storage/connect/javaconn.h
  modified:   storage/connect/json.h
  modified:   storage/connect/mongo.h

- Fix MDEV-13924
  modified:   storage/connect/jdbconn.cpp

- Make a temporary fix for the compiler bug in CalculateArray
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/tabjson.cpp

- Typo
  modified:   storage/connect/jdbccat.h
  modified:   storage/connect/reldef.h
  modified:   storage/connect/tabext.h
  modified:   storage/connect/tabjmg.cpp
  modified:   storage/connect/tabxml.h
  modified:   storage/connect/valblk.h
  modified:   storage/connect/value.h
  modified:   storage/connect/xtable.h

- Fix a bug in MONGO tests by changing 'MONGO' to $TYPE
  modified:   storage/connect/mysql-test/connect/t/mongo_test.inc

- Record test results to reflect all changes
  modified:   storage/connect/mysql-test/connect/r/json_java_2.result
  modified:   storage/connect/mysql-test/connect/r/json_java_3.result
  modified:   storage/connect/mysql-test/connect/r/json_mongo_c.result
  modified:   storage/connect/mysql-test/connect/r/mongo_c.result
  modified:   storage/connect/mysql-test/connect/r/mongo_java_2.result
  modified:   storage/connect/mysql-test/connect/r/mongo_java_3.result
2017-10-15 16:13:23 +02:00

91 lines
2.9 KiB
C++

/**************** mongo H Declares Source Code File (.H) ***************/
/* Name: mongo.h Version 1.0 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2017 */
/* */
/* This file contains the common MongoDB classes declares. */
/***********************************************************************/
#ifndef __MONGO_H
#define __MONGO_H
#include "osutil.h"
#include "block.h"
#include "colblk.h"
typedef class MGODEF *PMGODEF;
typedef struct _bncol {
struct _bncol *Next;
char *Name;
char *Fmt;
int Type;
int Len;
int Scale;
bool Cbn;
bool Found;
} BCOL, *PBCOL;
/***********************************************************************/
/* Class used to get the columns of a mongo collection. */
/***********************************************************************/
class MGODISC : public BLOCK {
public:
// Constructor
MGODISC(PGLOBAL g, int *lg);
// Methods
virtual bool Init(PGLOBAL g) { return false; }
virtual void GetDoc(void) {}
virtual bool Find(PGLOBAL g) = 0;
// Functions
int GetColumns(PGLOBAL g, PCSZ db, PCSZ uri, PTOS topt);
void AddColumn(PGLOBAL g, PCSZ colname, PCSZ fmt, int k);
// Members
BCOL bcol;
PBCOL bcp, fbcp, pbcp;
PMGODEF tdp;
PTDB tmgp;
PCSZ drv;
int *length;
int i, ncol, lvl;
bool all;
}; // end of MGODISC
/***********************************************************************/
/* MongoDB table. */
/***********************************************************************/
class DllExport MGODEF : public EXTDEF { /* Table description */
friend class TDBCMG;
friend class TDBJMG;
friend class TDBGOL;
friend class TDBJGL;
friend class CMGFAM;
friend class MGODISC;
friend DllExport PQRYRES MGOColumns(PGLOBAL, PCSZ, PCSZ, PTOS, bool);
public:
// Constructor
MGODEF(void);
// Implementation
virtual const char *GetType(void) { return "MONGO"; }
// Methods
virtual bool DefineAM(PGLOBAL g, LPCSTR am, int poff);
virtual PTDB GetTable(PGLOBAL g, MODE m);
protected:
// Members
PCSZ Driver; /* MongoDB Driver (C or JAVA) */
PCSZ Uri; /* MongoDB connection URI */
PSZ Wrapname; /* Java wrapper name */
PCSZ Colist; /* Options list */
PCSZ Filter; /* Filtering query */
int Level; /* Used for catalog table */
int Base; /* The array index base */
int Version; /* The Java driver version */
bool Pipe; /* True is Colist is a pipeline */
}; // end of MGODEF
#endif // __MONGO_H