Commit 34668e10 authored by Alexander Barkov's avatar Alexander Barkov

Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext

parents d1af417e bc75c57c
...@@ -131,6 +131,8 @@ scripts/wsrep_sst_xtrabackup ...@@ -131,6 +131,8 @@ scripts/wsrep_sst_xtrabackup
scripts/wsrep_sst_xtrabackup-v2 scripts/wsrep_sst_xtrabackup-v2
scripts/maria_add_gis_sp.sql scripts/maria_add_gis_sp.sql
scripts/maria_add_gis_sp_bootstrap.sql scripts/maria_add_gis_sp_bootstrap.sql
scripts/galera_new_cluster
scripts/galera_recovery
sql-bench/bench-count-distinct sql-bench/bench-count-distinct
sql-bench/bench-init.pl sql-bench/bench-init.pl
sql-bench/compare-results sql-bench/compare-results
...@@ -224,6 +226,7 @@ support-files/config.medium.ini ...@@ -224,6 +226,7 @@ support-files/config.medium.ini
support-files/config.small.ini support-files/config.small.ini
support-files/mariadb.pc support-files/mariadb.pc
support-files/mariadb@.service support-files/mariadb@.service
support-files/mariadb.service
support-files/my-huge.cnf support-files/my-huge.cnf
support-files/my-innodb-heavy-4G.cnf support-files/my-innodb-heavy-4G.cnf
support-files/my-large.cnf support-files/my-large.cnf
...@@ -237,6 +240,7 @@ support-files/mysqld_multi.server ...@@ -237,6 +240,7 @@ support-files/mysqld_multi.server
support-files/wsrep.cnf support-files/wsrep.cnf
support-files/wsrep_notify support-files/wsrep_notify
support-files/policy/selinux/mysqld-safe.pp support-files/policy/selinux/mysqld-safe.pp
support-files/mariadb.pp
tags tags
tests/async_queries tests/async_queries
tests/bug25714 tests/bug25714
......
...@@ -21,7 +21,7 @@ Build-Depends: bison, ...@@ -21,7 +21,7 @@ Build-Depends: bison,
libpam0g-dev, libpam0g-dev,
libpcre3-dev (>= 2:8.35-3.2~), libpcre3-dev (>= 2:8.35-3.2~),
libreadline-gplv2-dev, libreadline-gplv2-dev,
libssl-dev, libssl-dev | libssl1.0-dev,
libsnappy-dev, libsnappy-dev,
libsystemd-dev, libsystemd-dev,
libxml2-dev, libxml2-dev,
......
...@@ -724,7 +724,7 @@ have_queries_to_wait_for(MYSQL *connection, uint threshold) ...@@ -724,7 +724,7 @@ have_queries_to_wait_for(MYSQL *connection, uint threshold)
all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL); all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) { while ((row = mysql_fetch_row(result)) != NULL) {
const char *info = row[7]; const char *info = row[7];
int duration = atoi(row[5]); int duration = row[5] ? atoi(row[5]) : 0;
char *id = row[0]; char *id = row[0];
if (info != NULL if (info != NULL
...@@ -754,7 +754,7 @@ kill_long_queries(MYSQL *connection, time_t timeout) ...@@ -754,7 +754,7 @@ kill_long_queries(MYSQL *connection, time_t timeout)
all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL); all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) { while ((row = mysql_fetch_row(result)) != NULL) {
const char *info = row[7]; const char *info = row[7];
long long duration = atoll(row[5]); long long duration = row[5]? atoll(row[5]) : 0;
char *id = row[0]; char *id = row[0];
if (info != NULL && if (info != NULL &&
......
...@@ -14,7 +14,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir ...@@ -14,7 +14,7 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir
--enable_result_log --enable_result_log
INSERT INTO t VALUES(2); INSERT INTO t VALUES(2);
SELECT * FROM t; SELECT * FROM t;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir; exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
--disable_result_log --disable_result_log
echo # Prepare full backup, apply incremental one; echo # Prepare full backup, apply incremental one;
......
...@@ -34,7 +34,8 @@ int check_openssl_compatibility() ...@@ -34,7 +34,8 @@ int check_openssl_compatibility()
static uint testing, alloc_size, alloc_count; static uint testing, alloc_size, alloc_count;
static void *coc_malloc(size_t size, const char *, int) static void *coc_malloc(size_t size, const char *f __attribute__((unused)),
int l __attribute__((unused)))
{ {
if (unlikely(testing)) if (unlikely(testing))
{ {
......
...@@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h) ...@@ -38,7 +38,7 @@ user_connect.h valblk.h value.h xindex.h xobject.h xtable.h)
# Definitions that are shared for all OSes # Definitions that are shared for all OSes
# #
add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS) add_definitions( -DMARIADB -DFORCE_INIT_OF_VARS -Dconnect_EXPORTS)
add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT -DUSE_TRY ) add_definitions( -DHUGE_SUPPORT -DGZ_SUPPORT -DPIVOT_SUPPORT )
# #
...@@ -245,7 +245,7 @@ int main() { ...@@ -245,7 +245,7 @@ int main() {
ENDIF(CONNECT_WITH_ODBC) ENDIF(CONNECT_WITH_ODBC)
# #
# JDBC # JDBC and MongoDB Java Driver
# #
IF(APPLE) IF(APPLE)
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine without JDBC support" OFF) OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine without JDBC support" OFF)
...@@ -262,9 +262,13 @@ IF(CONNECT_WITH_JDBC) ...@@ -262,9 +262,13 @@ IF(CONNECT_WITH_JDBC)
INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2}) INCLUDE_DIRECTORIES(${JAVA_INCLUDE_PATH2})
# SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked # SET(JDBC_LIBRARY ${JAVA_JVM_LIBRARY}) will be dynamically linked
SET(CONNECT_SOURCES ${CONNECT_SOURCES} SET(CONNECT_SOURCES ${CONNECT_SOURCES}
jdbconn.cpp tabjdbc.cpp jdbconn.h tabjdbc.h jdbccat.h javaconn.cpp jdbconn.cpp tabjdbc.cpp
jmgoconn.cpp jmgfam.cpp mongo.cpp tabjmg.cpp
jdbccat.h javaconn.h jdbconn.h tabjdbc.h
jmgoconn.h jmgfam.h mongo.h tabjmg.h
JdbcInterface.java ApacheInterface.java MariadbInterface.java JdbcInterface.java ApacheInterface.java MariadbInterface.java
MysqlInterface.java OracleInterface.java PostgresqlInterface.java MysqlInterface.java OracleInterface.java PostgresqlInterface.java
Mongo2Interface.java Mongo3Interface.java
JavaWrappers.jar) JavaWrappers.jar)
# TODO: Find how to compile and install the java wrapper classes # TODO: Find how to compile and install the java wrapper classes
# Find required libraries and include directories # Find required libraries and include directories
...@@ -291,6 +295,36 @@ IF(CONNECT_WITH_ZIP) ...@@ -291,6 +295,36 @@ IF(CONNECT_WITH_ZIP)
add_definitions(-DZIP_SUPPORT -DNOCRYPT) add_definitions(-DZIP_SUPPORT -DNOCRYPT)
ENDIF(CONNECT_WITH_ZIP) ENDIF(CONNECT_WITH_ZIP)
#
# MONGO C Driver (CMAKE NOT YET WORKING)
#
#OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON)
#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)
# IF (MONGO_FOUND)
# INCLUDE_DIRECTORIES(${MONGO_INCLUDE_DIR})
# SET(MONGO_LIBRARY ${MONGO_LIBRARIES})
# SET(CONNECT_SOURCES ${CONNECT_SOURCES}
# cmgoconn.cpp mongofam.cpp tabmgo.cpp
# cmgoconn.h mongofam.h tabmgo.h)
# IF (NOT JAVA_FOUND AND JNI_FOUND)
# SET(CONNECT_SOURCES ${CONNECT_SOURCES} mongo.cpp mongo.h)
# ENDIF (NOT JAVA_FOUND AND JNI_FOUND)
# add_definitions(-DMONGO_SUPPORT)
# ENDIF(MONGO_FOUND)
#ENDIF(CONNECT_WITH_MONGO)
# #
# XMAP # XMAP
...@@ -310,6 +344,8 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES} ...@@ -310,6 +344,8 @@ MYSQL_ADD_PLUGIN(connect ${CONNECT_SOURCES}
STORAGE_ENGINE STORAGE_ENGINE
COMPONENT connect-engine COMPONENT connect-engine
RECOMPILE_FOR_EMBEDDED RECOMPILE_FOR_EMBEDDED
# LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} $(MONGO_LIBRARY)
LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY} LINK_LIBRARIES ${ZLIB_LIBRARY} ${XML_LIBRARY} ${ICONV_LIBRARY}
${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY}) ${ODBC_LIBRARY} ${JDBC_LIBRARY} ${IPHLPAPI_LIBRARY})
This diff was suppressed by a .gitattributes entry.
package wrappers;
import java.util.Date;
import java.util.List;
import java.util.Set;
import com.mongodb.AggregationOptions;
import com.mongodb.BasicDBList;
import com.mongodb.BasicDBObject;
import com.mongodb.Cursor;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientURI;
import com.mongodb.MongoException;
import com.mongodb.WriteConcernException;
import com.mongodb.WriteResult;
import com.mongodb.util.JSON;
public class Mongo2Interface {
boolean DEBUG = false;
String Errmsg = "No error";
Set<String> Colnames = null;
Cursor cursor = null;
MongoClient client = null;
DB db = null;
DBCollection coll = null;
BasicDBObject doc = null;
BasicDBObject dbq = null;
BasicDBObject dbf = null;
List<DBObject> pip = null;
AggregationOptions aop = null;
// === Constructors/finalize =========================================
public Mongo2Interface() {
this(false);
} // end of default constructor
public Mongo2Interface(boolean b) {
DEBUG = b;
} // end of constructor
protected void SetErrmsg(String str) {
if (DEBUG)
System.out.println(str);
Errmsg = str;
} // end of SetErrmsg
protected void SetErrmsg(Exception e) {
if (DEBUG)
System.out.println(e.getMessage());
Errmsg = e.toString();
} // end of SetErrmsg
public String GetErrmsg() {
String err = Errmsg;
Errmsg = "No error";
return err;
} // end of GetErrmsg
public int MongoConnect(String[] parms) {
int rc = 0;
if (DEBUG)
System.out.println("Mongo2: URI=" + parms[0] + " DB=" + parms[1]);
try {
MongoClientURI uri = new MongoClientURI(parms[0]);
client = new MongoClient(uri);
if (DEBUG)
System.out.println("Connection " + client.toString() + " established");
// Now connect to your databases
db = client.getDB(parms[1]);
if (parms[2] != null && !parms[2].isEmpty()) {
if (DEBUG)
System.out.println("user=" + parms[2] + " pwd=" + parms[3]);
@SuppressWarnings("deprecation")
boolean auth = db.authenticate(parms[2], parms[3].toCharArray());
if (DEBUG)
System.out.println("Authentication: " + auth);
} // endif user
} catch (MongoException me) {
SetErrmsg(me);
rc = -1;
} catch (Exception e) {
SetErrmsg(e);
rc = -3;
} // end try/catch
return rc;
} // end of MongoConnect
public int MongoDisconnect() {
int rc = 0;
try {
if (cursor != null) {
if (DEBUG)
System.out.println("Closing cursor");
cursor.close();
cursor = null;
} // endif client
if (client != null) {
if (DEBUG)
System.out.println("Closing connection");
client.close();
client = null;
} // endif client
} catch (MongoException se) {
SetErrmsg(se);
rc += 8;
} // end try/catch
return rc;
} // end of MongoDisconnect
public boolean GetCollection(String name) {
if (DEBUG)
System.out.println("GetCollection: name=" + name);
try {
coll = db.getCollection(name);
} catch (Exception e) {
SetErrmsg(e);
return true;
} // end try/catch
return false;
} // end of GetCollection
public long GetCollSize() {
return (coll != null) ? coll.count() : 0;
} // end of GetCollSize
public boolean FindColl(String query, String fields) {
if (DEBUG)
System.out.println("FindColl: query=" + query + " fields=" + fields);
try {
if (query != null || fields != null) {
dbq = (BasicDBObject) JSON.parse((query != null) ? query : "{}");
if (fields != null) {
dbf = (BasicDBObject) JSON.parse(fields);
cursor = coll.find(dbq, dbf);
} else
cursor = coll.find(dbq);
} else
cursor = coll.find();
} catch (Exception e) {
SetErrmsg(e);
return true;
} // end try/catch
return false;
} // end of FindColl
@SuppressWarnings("unchecked")
public boolean AggregateColl(String pipeline) {
if (DEBUG)
System.out.println("AggregateColl: pipeline=" + pipeline);
try {
DBObject pipe = (DBObject) JSON.parse(pipeline);
pip = (List<DBObject>) pipe.get("pipeline");
aop = AggregationOptions.builder().batchSize(0).allowDiskUse(true)
.outputMode(AggregationOptions.OutputMode.CURSOR).build();
cursor = coll.aggregate(pip, aop);
} catch (MongoException me) {
SetErrmsg(me);
return true;
} // end try/catch
return false;
} // end of AggregateColl
public boolean Rewind() {
if (cursor != null)
cursor.close();
if (pip == null) {
if (dbf != null)
cursor = coll.find(dbq, dbf);
else if (dbq != null)
cursor = coll.find(dbq);
else
cursor = coll.find();
} else
cursor = coll.aggregate(pip, aop);
return (cursor == null);
} // end of Rewind
public int ReadNext() {
try {
if (cursor.hasNext()) {
doc = (BasicDBObject) cursor.next();
if (DEBUG)
System.out.println("Class doc = " + doc.getClass());
Colnames = doc.keySet();
return 1;
} else
return 0;
} catch (MongoException me) {
SetErrmsg(me);
return -1;
} // end try/catch
} // end of ReadNext
public boolean Fetch(int row) {
if (cursor.hasNext()) {
doc = (BasicDBObject) cursor.next();
Colnames = doc.keySet();
return true;
} else
return false;
} // end of Fetch
public String GetDoc() {
return (doc != null) ? doc.toString() : null;
} // end of GetDoc
public Set<String> GetColumns() {
if (doc != null)
return doc.keySet();
else
return null;
} // end of GetColumns
public String ColumnDesc(int n, int[] val) {
// if (rsmd == null) {
// System.out.println("No result metadata");
// return null;
// } else try {
// val[0] = rsmd.getColumnType(n);
// val[1] = rsmd.getPrecision(n);
// val[2] = rsmd.getScale(n);
// val[3] = rsmd.isNullable(n);
// return rsmd.getColumnLabel(n);
// } catch (SQLException se) {
// SetErrmsg(se);
// } //end try/catch
return null;
} // end of ColumnDesc
protected Object GetFieldObject(String path) {
Object o = null;
BasicDBObject dob = null;
BasicDBList lst = null;
String[] names = null;
if (path == null || path.equals("*"))
return doc;
else if (doc instanceof BasicDBObject)
dob = doc;
// else if (o instanceof BasicDBList)
// lst = (BasicDBList) doc;
else
return doc;
try {
names = path.split("\\.");
for (String name : names) {
if (lst != null) {
o = lst.get(Integer.parseInt(name));
} else
o = dob.get(name);
if (o == null)
break;
if (DEBUG)
System.out.println("Class o = " + o.getClass());
if (o instanceof BasicDBObject) {
dob = (BasicDBObject) o;
lst = null;
} else if (o instanceof BasicDBList) {
lst = (BasicDBList) o;
} else
break;
} // endfor name
} catch (IndexOutOfBoundsException x) {
o = null;
} catch (MongoException se) {
SetErrmsg(se);
o = null;
} // end try/catch
return o;
} // end of GetFieldObject
public String GetField(String path) {
Object o = GetFieldObject(path);
if (o != null) {
if (o instanceof Date) {
Integer TS = (int) (((Date) o).getTime() / 1000);
return TS.toString();
} // endif Date
return o.toString();
} else
return null;
} // end of GetField
public Object MakeDocument() {
return new BasicDBObject();
} // end of MakeDocument
public boolean DocAdd(Object bdc, String key, Object val) {
try {
((BasicDBObject) bdc).append(key, val);
} catch (MongoException me) {
SetErrmsg(me);
return true;
} // end try/catch
return false;
} // end of DocAdd
public Object MakeArray() {
return new BasicDBList();
} // end of MakeArray
public boolean ArrayAdd(Object bar, int n, Object val) {
try {
((BasicDBList) bar).put(n, val);
} catch (MongoException me) {
SetErrmsg(me);
return true;
} catch (Exception ex) {
SetErrmsg(ex);
return true;
} // end try/catch
return false;
} // end of ArrayAdd
public boolean CollInsert(Object dob) {
try {
coll.insert((BasicDBObject) dob);
} catch (MongoException me) {
SetErrmsg(me);
return true;
} catch (Exception ex) {
SetErrmsg(ex);
return true;
} // end try/catch
return false;
} // end of CollInsert
public long CollUpdate(Object upd) {
long n = -1;
if (DEBUG)
System.out.println("upd: " + upd.toString());
try {
DBObject qry = new BasicDBObject("_id", doc.get("_id"));
WriteResult res = coll.update(qry, (DBObject) upd);
if (DEBUG)
System.out.println("CollUpdate: " + res.toString());
n = res.getN();
} catch (MongoException me) {
SetErrmsg(me);
} catch (Exception ex) {
SetErrmsg(ex);
} // end try/catch
return n;
} // end of CollUpdate
public long CollDelete(boolean all) {
long n = -1;
try {
WriteResult res;
BasicDBObject qry = new BasicDBObject();
if (!all)
qry.append("_id", doc.get("_id"));
res = coll.remove(qry);
if (DEBUG)
System.out.println("CollDelete: " + res.toString());
n = res.getN();
} catch (WriteConcernException wx) {
SetErrmsg(wx);
} catch (MongoException me) {
SetErrmsg(me);
} catch (UnsupportedOperationException ux) {
SetErrmsg(ux);
n = 0;
} // end try/catch
return n;
} // end of CollDelete
} // end of class MongoInterface
This diff is collapsed.
...@@ -520,7 +520,7 @@ bool ARRAY::FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm) ...@@ -520,7 +520,7 @@ bool ARRAY::FilTest(PGLOBAL g, PVAL valp, OPVAL opc, int opm)
} else if (opc != OP_EXIST) { } else if (opc != OP_EXIST) {
sprintf(g->Message, MSG(MISSING_ARG), opc); sprintf(g->Message, MSG(MISSING_ARG), opc);
throw TYPE_ARRAY; throw (int)TYPE_ARRAY;
} else // OP_EXIST } else // OP_EXIST
return Nval > 0; return Nval > 0;
...@@ -683,14 +683,14 @@ void ARRAY::SetPrecision(PGLOBAL g, int p) ...@@ -683,14 +683,14 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
{ {
if (Vblp == NULL) { if (Vblp == NULL) {
strcpy(g->Message, MSG(PREC_VBLP_NULL)); strcpy(g->Message, MSG(PREC_VBLP_NULL));
throw TYPE_ARRAY; throw (int)TYPE_ARRAY;
} // endif Vblp } // endif Vblp
bool was = Vblp->IsCi(); bool was = Vblp->IsCi();
if (was && !p) { if (was && !p) {
strcpy(g->Message, MSG(BAD_SET_CASE)); strcpy(g->Message, MSG(BAD_SET_CASE));
throw TYPE_ARRAY; throw (int)TYPE_ARRAY;
} // endif Vblp } // endif Vblp
if (was || !p) if (was || !p)
...@@ -701,7 +701,7 @@ void ARRAY::SetPrecision(PGLOBAL g, int p) ...@@ -701,7 +701,7 @@ void ARRAY::SetPrecision(PGLOBAL g, int p)
if (!was && Type == TYPE_STRING) if (!was && Type == TYPE_STRING)
// Must be resorted to eliminate duplicate strings // Must be resorted to eliminate duplicate strings
if (Sort(g)) if (Sort(g))
throw TYPE_ARRAY; throw (int)TYPE_ARRAY;
} // end of SetPrecision } // end of SetPrecision
...@@ -975,7 +975,7 @@ int ARRAY::BlockTest(PGLOBAL, int opc, int opm, ...@@ -975,7 +975,7 @@ int ARRAY::BlockTest(PGLOBAL, int opc, int opm,
PSZ ARRAY::MakeArrayList(PGLOBAL g) PSZ ARRAY::MakeArrayList(PGLOBAL g)
{ {
char *p, *tp; char *p, *tp;
int i; int i;
size_t z, len = 2; size_t z, len = 2;
if (Type == TYPE_LIST) if (Type == TYPE_LIST)
...@@ -1035,7 +1035,7 @@ void ARRAY::Printf(PGLOBAL g, FILE *f, uint n) ...@@ -1035,7 +1035,7 @@ void ARRAY::Printf(PGLOBAL g, FILE *f, uint n)
} else } else
fprintf(f, "%sVALLST: numval=%d\n", m, Nval); fprintf(f, "%sVALLST: numval=%d\n", m, Nval);
} // end of Print } // end of Printf
/***********************************************************************/ /***********************************************************************/
/* Make string output of ARRAY contents. */ /* Make string output of ARRAY contents. */
...@@ -1047,7 +1047,7 @@ void ARRAY::Prints(PGLOBAL, char *ps, uint z) ...@@ -1047,7 +1047,7 @@ void ARRAY::Prints(PGLOBAL, char *ps, uint z)
sprintf(ps, "ARRAY: type=%d\n", Type); sprintf(ps, "ARRAY: type=%d\n", Type);
// More to be implemented later // More to be implemented later
} // end of Print } // end of Prints
/* -------------------------- Class MULAR ---------------------------- */ /* -------------------------- Class MULAR ---------------------------- */
......
...@@ -65,7 +65,7 @@ void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n) ...@@ -65,7 +65,7 @@ void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n)
fprintf(f, "%sBLOCKFILTER: at %p opc=%d opm=%d result=%d\n", fprintf(f, "%sBLOCKFILTER: at %p opc=%d opm=%d result=%d\n",
m, this, Opc, Opm, Result); m, this, Opc, Opm, Result);
} // end of Print } // end of Printf
/***********************************************************************/ /***********************************************************************/
/* Make string output of BLOCKFILTER contents. */ /* Make string output of BLOCKFILTER contents. */
...@@ -73,7 +73,7 @@ void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n) ...@@ -73,7 +73,7 @@ void BLOCKFILTER::Printf(PGLOBAL, FILE *f, uint n)
void BLOCKFILTER::Prints(PGLOBAL, char *ps, uint z) void BLOCKFILTER::Prints(PGLOBAL, char *ps, uint z)
{ {
strncat(ps, "BlockFilter(s)", z); strncat(ps, "BlockFilter(s)", z);
} // end of Print } // end of Prints
/* ---------------------- Class BLKFILLOG ---------------------------- */ /* ---------------------- Class BLKFILLOG ---------------------------- */
...@@ -412,7 +412,7 @@ void BLKFILMR2::MakeValueBitmap(void) ...@@ -412,7 +412,7 @@ void BLKFILMR2::MakeValueBitmap(void)
Void = !Bmp[N]; // There are no good values in the file Void = !Bmp[N]; // There are no good values in the file
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
Bxp[i] = ~0U; Bxp[i] = ~0;
if (noteq) if (noteq)
Bmp[i] = Bxp[i]; Bmp[i] = Bxp[i];
...@@ -708,7 +708,7 @@ void BLKFILIN2::MakeValueBitmap(void) ...@@ -708,7 +708,7 @@ void BLKFILIN2::MakeValueBitmap(void)
Void = !Bmp[N]; // There are no good values in the file Void = !Bmp[N]; // There are no good values in the file
for (i = 0; i < N; i++) { for (i = 0; i < N; i++) {
Bxp[i] = ~0U; Bxp[i] = ~0;
if (noteq) { if (noteq) {
Bmp[i] = Bxp[i]; Bmp[i] = Bxp[i];
...@@ -828,7 +828,7 @@ BLKFILIN2::BLKFILIN2(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp) ...@@ -828,7 +828,7 @@ BLKFILIN2::BLKFILIN2(PGLOBAL g, PTDBDOS tdbp, int op, int opm, PXOB *xp)
Bxp[i] |= btp; Bxp[i] |= btp;
for (N = i--; i >= 0; i--) for (N = i--; i >= 0; i--)
Bxp[i] = ~0U; Bxp[i] = ~0;
break; break;
} // endif Bmp } // endif Bmp
...@@ -1006,9 +1006,9 @@ void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n) ...@@ -1006,9 +1006,9 @@ void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n)
m, this, Next, (Colp) ? Colp->GetName() : "Rowid", Kxp, Result); m, this, Next, (Colp) ? Colp->GetName() : "Rowid", Kxp, Result);
if (Next) if (Next)
Next->Print(g, f, n); Next->Printf(g, f, n);
} // end of Print } // end of Printf
/***********************************************************************/ /***********************************************************************/
/* Make string output of BLOCKINDEX contents. */ /* Make string output of BLOCKINDEX contents. */
...@@ -1016,7 +1016,7 @@ void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n) ...@@ -1016,7 +1016,7 @@ void BLOCKINDEX::Printf(PGLOBAL g, FILE *f, UINT n)
void BLOCKINDEX::Prints(PGLOBAL g, char *ps, UINT z) void BLOCKINDEX::Prints(PGLOBAL g, char *ps, UINT z)
{ {
strncat(ps, "BlockIndex(es)", z); strncat(ps, "BlockIndex(es)", z);
} // end of Print } // end of Prints
/* ------------------------------------------------------------------- */ /* ------------------------------------------------------------------- */
......
This diff is collapsed.
/***********************************************************************/
/* CMgoConn.h : header file for the MongoDB connection classes. */
/***********************************************************************/
/***********************************************************************/
/* Include MongoDB library header files. */
/***********************************************************************/
#include <bson.h>
#include <bcon.h>
#include <mongoc.h>
// C connection to a MongoDB data source
class TDBMGO;
class MGOCOL;
/***********************************************************************/
/* Include MongoDB library header files. */
/***********************************************************************/
typedef class INCOL *PINCOL;
typedef class MGODEF *PMGODEF;
typedef class TDBMGO *PTDBMGO;
typedef class MGOCOL *PMGOCOL;
typedef struct mongo_parms {
PTDB Tdbp;
PCSZ Uristr; // Driver URI
PCSZ Db_name;
PCSZ Coll_name;
PCSZ Options;
PCSZ Filter;
bool Pipe;
//PCSZ User; // User connect info
//PCSZ Pwd; // Password connect info
//int Fsize; // Fetch size
//bool Scrollable; // Scrollable cursor
} CMGOPARM, *PCPARM;
typedef struct KEYCOL {
KEYCOL *Next;
PINCOL Incolp;
PCOL Colp;
char *Key;
} *PKC;
/***********************************************************************/
/* Used when inserting values in a MongoDB collection. */
/***********************************************************************/
class INCOL : public BLOCK {
public:
// Constructor
INCOL(bool ar) { Klist = NULL; Array = ar; }
// Methods
void AddCol(PGLOBAL g, PCOL colp, char *jp);
//Members
bson_t Child;
PKC Klist;
bool Array;
}; // end of INCOL;
/***********************************************************************/
/* CMgoConn class. */
/***********************************************************************/
class CMgoConn : public BLOCK {
friend class TDBMGO;
friend class MGODISC;
public:
// Constructor
CMgoConn(PGLOBAL g, PCPARM pcg);
//static void *mgo_alloc(size_t n);
//static void *mgo_calloc(size_t n, size_t sz);
//static void *mgo_realloc(void *m, size_t n);
//static void mgo_free(void *) {}
// Implementation
bool IsConnected(void) { return m_Connected; }
bool Connect(PGLOBAL g);
int CollSize(PGLOBAL g);
bool MakeCursor(PGLOBAL g);
int ReadNext(PGLOBAL g);
PSZ GetDocument(PGLOBAL g);
void ShowDocument(bson_iter_t *iter, const bson_t *doc, const char *k);
void MakeColumnGroups(PGLOBAL g);
bool DocWrite(PGLOBAL g, PINCOL icp);
int Write(PGLOBAL g);
bool DocDelete(PGLOBAL g);
void Rewind(void);
void Close(void);
PSZ Mini(PGLOBAL g, PCOL colp, const bson_t *bson, bool b);
void GetColumnValue(PGLOBAL g, PCOL colp);
bool AddValue(PGLOBAL g, PCOL colp, bson_t *doc, char *key, bool upd);
protected:
// Members
PCPARM Pcg;
mongoc_uri_t *Uri;
mongoc_client_pool_t *Pool; // Thread safe client pool
mongoc_client_t *Client; // The MongoDB client
mongoc_database_t *Database; // The MongoDB database
mongoc_collection_t *Collection; // The MongoDB collection
mongoc_cursor_t *Cursor;
const bson_t *Document;
bson_t *Query; // MongoDB cursor filter
bson_t *Opts; // MongoDB cursor options
bson_error_t Error;
bson_iter_t Iter; // Used to retrieve column value
bson_iter_t Desc; // Descendant iter
PINCOL Fpc; // To insert INCOL classes
bool m_Connected;
}; // end of class CMgoConn
...@@ -197,7 +197,7 @@ int COLBLK::GetLengthEx(void) ...@@ -197,7 +197,7 @@ int COLBLK::GetLengthEx(void)
void COLBLK::ReadColumn(PGLOBAL g) void COLBLK::ReadColumn(PGLOBAL g)
{ {
sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn"); sprintf(g->Message, MSG(UNDEFINED_AM), "ReadColumn");
throw TYPE_COLBLK; throw (int)TYPE_COLBLK;
} // end of ReadColumn } // end of ReadColumn
/***********************************************************************/ /***********************************************************************/
...@@ -208,7 +208,7 @@ void COLBLK::ReadColumn(PGLOBAL g) ...@@ -208,7 +208,7 @@ void COLBLK::ReadColumn(PGLOBAL g)
void COLBLK::WriteColumn(PGLOBAL g) void COLBLK::WriteColumn(PGLOBAL g)
{ {
sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn"); sprintf(g->Message, MSG(UNDEFINED_AM), "WriteColumn");
throw TYPE_COLBLK; throw (int)TYPE_COLBLK;
} // end of WriteColumn } // end of WriteColumn
/***********************************************************************/ /***********************************************************************/
...@@ -232,7 +232,7 @@ void COLBLK::Printf(PGLOBAL, FILE *f, uint n) ...@@ -232,7 +232,7 @@ void COLBLK::Printf(PGLOBAL, FILE *f, uint n)
fprintf(f, fprintf(f,
" coluse=%04X status=%04X buftyp=%d value=%p name=%s\n", " coluse=%04X status=%04X buftyp=%d value=%p name=%s\n",
ColUse, Status, Buf_Type, Value, Name); ColUse, Status, Buf_Type, Value, Name);
} // end of Print } // end of Printf
/***********************************************************************/ /***********************************************************************/
/* Make string output of a column descriptor block. */ /* Make string output of a column descriptor block. */
...@@ -240,7 +240,7 @@ void COLBLK::Printf(PGLOBAL, FILE *f, uint n) ...@@ -240,7 +240,7 @@ void COLBLK::Printf(PGLOBAL, FILE *f, uint n)
void COLBLK::Prints(PGLOBAL, char *ps, uint) void COLBLK::Prints(PGLOBAL, char *ps, uint)
{ {
sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name); sprintf(ps, "R%d.%s", To_Tdb->GetTdb_No(), Name);
} // end of Print } // end of Prints
/***********************************************************************/ /***********************************************************************/
...@@ -262,7 +262,7 @@ SPCBLK::SPCBLK(PCOLUMN cp) ...@@ -262,7 +262,7 @@ SPCBLK::SPCBLK(PCOLUMN cp)
void SPCBLK::WriteColumn(PGLOBAL g) void SPCBLK::WriteColumn(PGLOBAL g)
{ {
sprintf(g->Message, MSG(SPCOL_READONLY), Name); sprintf(g->Message, MSG(SPCOL_READONLY), Name);
throw TYPE_COLBLK; throw (int)TYPE_COLBLK;
} // end of WriteColumn } // end of WriteColumn
/***********************************************************************/ /***********************************************************************/
...@@ -412,4 +412,3 @@ void SIDBLK::ReadColumn(PGLOBAL) ...@@ -412,4 +412,3 @@ void SIDBLK::ReadColumn(PGLOBAL)
// } // endif Sname // } // endif Sname
} // end of ReadColumn } // end of ReadColumn
...@@ -38,7 +38,8 @@ class DllExport COLBLK : public XOBJECT { ...@@ -38,7 +38,8 @@ class DllExport COLBLK : public XOBJECT {
virtual PTDB GetTo_Tdb(void) {return To_Tdb;} virtual PTDB GetTo_Tdb(void) {return To_Tdb;}
virtual int GetClustered(void) {return 0;} virtual int GetClustered(void) {return 0;}
virtual int IsClustered(void) {return FALSE;} virtual int IsClustered(void) {return FALSE;}
PCOL GetNext(void) {return Next;} virtual PSZ GetJpath(PGLOBAL g, bool proj) {return NULL;}
PCOL GetNext(void) {return Next;}
PSZ GetName(void) {return Name;} PSZ GetName(void) {return Name;}
int GetIndex(void) {return Index;} int GetIndex(void) {return Index;}
ushort GetColUse(void) {return ColUse;} ushort GetColUse(void) {return ColUse;}
......
/* Copyright (C) Olivier Bertrand 2004 - 2017 /* Copyright (C) MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -185,10 +185,10 @@ bool CntInfo(PGLOBAL g, PTDB tp, PXF info) ...@@ -185,10 +185,10 @@ bool CntInfo(PGLOBAL g, PTDB tp, PXF info)
/***********************************************************************/ /***********************************************************************/
PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h) PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h)
{ {
PTDB tdbp; PTDB tdbp = NULL;
PTABLE tabp; PTABLE tabp;
PDBUSER dup = PlgGetUser(g); PDBUSER dup = PlgGetUser(g);
volatile PCATLG cat = (dup) ? dup->Catalog : NULL; // Safe over longjmp volatile PCATLG cat = (dup) ? dup->Catalog : NULL; // Safe over throw
if (trace) if (trace)
printf("CntGetTDB: name=%s mode=%d cat=%p\n", name, mode, cat); printf("CntGetTDB: name=%s mode=%d cat=%p\n", name, mode, cat);
......
/* Copyright (C) Olivier Bertrand 2004 - 2011 /* Copyright (C) MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
/**************** Cnt H Declares Source Code File (.H) *****************/ /**************** Cnt H Declares Source Code File (.H) *****************/
/* Name: CONNECT.H Version 2.4 */ /* Name: CONNECT.H Version 2.4 */
/* Author Olivier BERTRAND bertrandop@gmail.com */
/* This file contains the some based classes declares. */ /* This file contains the some based classes declares. */
/***********************************************************************/ /***********************************************************************/
#include "filamtxt.h" #include "filamtxt.h"
......
/* Copyright (C) MariaDB Corporation Ab */
#define MSG_ACCESS_VIOLATN "Access violation" #define MSG_ACCESS_VIOLATN "Access violation"
#define MSG_ADD_BAD_TYPE "Array add value type mismatch (%s -> %s)" #define MSG_ADD_BAD_TYPE "Array add value type mismatch (%s -> %s)"
#define MSG_ALLOC_ERROR "Error allocating %s" #define MSG_ALLOC_ERROR "Error allocating %s"
......
...@@ -696,7 +696,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g) ...@@ -696,7 +696,7 @@ bool DBFFAM::AllocateBuffer(PGLOBAL g)
} // endif Headlen } // endif Headlen
/**************************************************************************/ /**************************************************************************/
/* Position the file at the beginning of the data. */ /* Position the file at the begining of the data. */
/**************************************************************************/ /**************************************************************************/
if (Tdbp->GetMode() == MODE_INSERT) if (Tdbp->GetMode() == MODE_INSERT)
rc = fseek(Stream, 0, SEEK_END); rc = fseek(Stream, 0, SEEK_END);
...@@ -1036,7 +1036,7 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g) ...@@ -1036,7 +1036,7 @@ bool DBMFAM::AllocateBuffer(PGLOBAL g)
} // endif Headlen } // endif Headlen
/**************************************************************************/ /**************************************************************************/
/* Position the file at the beginning of the data. */ /* Position the file at the begining of the data. */
/**************************************************************************/ /**************************************************************************/
Fpos = Mempos = Memory + Headlen; Fpos = Mempos = Memory + Headlen;
Top--; // Because of EOF marker Top--; // Because of EOF marker
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2015 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2017 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
......
...@@ -455,7 +455,7 @@ bool UNZIPUTL::WildMatch(PCSZ pat, PCSZ str) { ...@@ -455,7 +455,7 @@ bool UNZIPUTL::WildMatch(PCSZ pat, PCSZ str) {
if (!*++pat) return TRUE; if (!*++pat) return TRUE;
goto loopStart; goto loopStart;
default: default:
if (mapCaseTable[(uchar)*s] != mapCaseTable[(uchar)*p]) if (mapCaseTable[(uint)*s] != mapCaseTable[(uint)*p])
goto starCheck; goto starCheck;
break; break;
} /* endswitch */ } /* endswitch */
......
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
#include "tabcol.h" #include "tabcol.h"
#include "xtable.h" #include "xtable.h"
#include "array.h" #include "array.h"
//#include "subquery.h"
#include "filter.h" #include "filter.h"
//#include "token.h"
//#include "select.h"
#include "xindex.h" #include "xindex.h"
#if defined(MONGO_SUPPORT) || defined(JDBC_SUPPORT)
#include "tabext.h"
#endif // MONGO_SUPPORT || JDBC_SUPPORT
/***********************************************************************/ /***********************************************************************/
/* Utility routines. */ /* Utility routines. */
...@@ -87,7 +87,7 @@ BYTE OpBmp(PGLOBAL g, OPVAL opc) ...@@ -87,7 +87,7 @@ BYTE OpBmp(PGLOBAL g, OPVAL opc)
case OP_EXIST: bt = 0x00; break; case OP_EXIST: bt = 0x00; break;
default: default:
sprintf(g->Message, MSG(BAD_FILTER_OP), opc); sprintf(g->Message, MSG(BAD_FILTER_OP), opc);
throw TYPE_ARRAY; throw (int)TYPE_ARRAY;
} // endswitch opc } // endswitch opc
return bt; return bt;
...@@ -1406,6 +1406,86 @@ PFIL FILTER::Copy(PTABS t) ...@@ -1406,6 +1406,86 @@ PFIL FILTER::Copy(PTABS t)
} // end of Copy } // end of Copy
#endif // 0 #endif // 0
#if defined(MONGO_SUPPORT) || defined(JDBC_SUPPORT)
/***********************************************************************/
/* Make selector json representation for Mongo tables. */
/***********************************************************************/
bool FILTER::MakeSelector(PGLOBAL g, PSTRG s)
{
s->Append('{');
if (Opc == OP_AND || Opc == OP_OR) {
if (GetArgType(0) != TYPE_FILTER || GetArgType(1) != TYPE_FILTER)
return true;
s->Append("\"$");
s->Append(Opc == OP_AND ? "and" : "or");
s->Append("\":[");
if (((PFIL)Arg(0))->MakeSelector(g, s))
return true;
s->Append(',');
if (((PFIL)Arg(1))->MakeSelector(g, s))
return true;
s->Append(']');
} else {
if (GetArgType(0) != TYPE_COLBLK)
return true;
s->Append('"');
s->Append(((PCOL)Arg(0))->GetJpath(g, false));
s->Append("\":{\"$");
switch (Opc) {
case OP_EQ:
s->Append("eq");
break;
case OP_NE:
s->Append("ne");
break;
case OP_GT:
s->Append("gt");
break;
case OP_GE:
s->Append("gte");
break;
case OP_LT:
s->Append("lt");
break;
case OP_LE:
s->Append("lte");
break;
case OP_NULL:
case OP_LIKE:
case OP_EXIST:
default:
return true;
} // endswitch Opc
s->Append("\":");
if (GetArgType(1) == TYPE_COLBLK) {
s->Append("\"$");
s->Append(((PEXTCOL)Arg(1))->GetJpath(g, false));
s->Append('"');
} else {
char buf[501];
Arg(1)->Prints(g, buf, 500);
s->Append(buf);
} // endif Type
s->Append('}');
} // endif Opc
s->Append('}');
return false;
} // end of MakeSelector
#endif // MONGO_SUPPORT || JDBC_SUPPORT
/*********************************************************************/ /*********************************************************************/
/* Make file output of FILTER contents. */ /* Make file output of FILTER contents. */
/*********************************************************************/ /*********************************************************************/
...@@ -1437,7 +1517,7 @@ void FILTER::Printf(PGLOBAL g, FILE *f, uint n) ...@@ -1437,7 +1517,7 @@ void FILTER::Printf(PGLOBAL g, FILE *f, uint n)
} // endfor fp } // endfor fp
} // end of Print } // end of Printf
/***********************************************************************/ /***********************************************************************/
/* Make string output of TABLE contents (z should be checked). */ /* Make string output of TABLE contents (z should be checked). */
...@@ -1579,7 +1659,7 @@ void FILTER::Prints(PGLOBAL g, char *ps, uint z) ...@@ -1579,7 +1659,7 @@ void FILTER::Prints(PGLOBAL g, char *ps, uint z)
bcp = bxp; bcp = bxp;
} while (bcp); // enddo } while (bcp); // enddo
} // end of Print } // end of Prints
/* -------------------- Derived Classes Functions -------------------- */ /* -------------------- Derived Classes Functions -------------------- */
...@@ -1697,8 +1777,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having) ...@@ -1697,8 +1777,6 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having)
if (trace) if (trace)
htrc("PrepareFilter: fp=%p having=%d\n", fp, having); htrc("PrepareFilter: fp=%p having=%d\n", fp, having);
//if (fp)
// fp->Print(g, debug, 0);
while (fp) { while (fp) {
if (fp->Opc == OP_SEP) if (fp->Opc == OP_SEP)
...@@ -1712,7 +1790,7 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having) ...@@ -1712,7 +1790,7 @@ PFIL PrepareFilter(PGLOBAL g, PFIL fp, bool having)
break; // Remove eventual ending separator(s) break; // Remove eventual ending separator(s)
// if (fp->Convert(g, having)) // if (fp->Convert(g, having))
// throw TYPE_ARRAY; // (int)throw TYPE_ARRAY;
filp = fp; filp = fp;
fp = fp->Next; fp = fp->Next;
...@@ -1745,7 +1823,7 @@ DllExport bool ApplyFilter(PGLOBAL g, PFIL filp) ...@@ -1745,7 +1823,7 @@ DllExport bool ApplyFilter(PGLOBAL g, PFIL filp)
// return TRUE; // return TRUE;
if (filp->Eval(g)) if (filp->Eval(g))
throw TYPE_FILTER; throw (int)TYPE_FILTER;
if (trace > 1) if (trace > 1)
htrc("PlugFilter filp=%p result=%d\n", htrc("PlugFilter filp=%p result=%d\n",
......
/*************** Filter H Declares Source Code File (.H) ***************/ /*************** Filter H Declares Source Code File (.H) ***************/
/* Name: FILTER.H Version 1.2 */ /* Name: FILTER.H Version 1.3 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2010-2015 */ /* (C) Copyright to the author Olivier BERTRAND 2010-2017 */
/* */ /* */
/* This file contains the FILTER and derived classes declares. */ /* This file contains the FILTER and derived classes declares. */
/***********************************************************************/ /***********************************************************************/
...@@ -61,6 +61,9 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */ ...@@ -61,6 +61,9 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */
//virtual PXOB CheckSubQuery(PGLOBAL, PSQL); //virtual PXOB CheckSubQuery(PGLOBAL, PSQL);
//virtual bool CheckLocal(PTDB); //virtual bool CheckLocal(PTDB);
//virtual int CheckSpcCol(PTDB tdbp, int n); //virtual int CheckSpcCol(PTDB tdbp, int n);
#if defined(MONGO_SUPPORT) || defined(JDBC_SUPPORT)
bool MakeSelector(PGLOBAL g, PSTRG s);
#endif // MONGO_SUPPORT || JDBC_SUPPORT
virtual void Printf(PGLOBAL g, FILE *f, uint n); virtual void Printf(PGLOBAL g, FILE *f, uint n);
virtual void Prints(PGLOBAL g, char *ps, uint z); virtual void Prints(PGLOBAL g, char *ps, uint z);
// PFIL Linearize(bool nosep); // PFIL Linearize(bool nosep);
......
/***********************************************************************/ /***********************************************************************/
/* GLOBAL.H: Declaration file used by all CONNECT implementations. */ /* GLOBAL.H: Declaration file used by all CONNECT implementations. */
/* (C) Copyright Olivier Bertrand 1993-2017 */ /* (C) Copyright MariaDB Corporation Ab */
/* Author Olivier Bertrand 1993-2017 */
/***********************************************************************/ /***********************************************************************/
/***********************************************************************/ /***********************************************************************/
...@@ -90,6 +91,7 @@ ...@@ -90,6 +91,7 @@
#define TYPE_BIGINT 5 #define TYPE_BIGINT 5
#define TYPE_LIST 6 #define TYPE_LIST 6
#define TYPE_INT 7 #define TYPE_INT 7
#define TYPE_DATE 8
#define TYPE_DECIM 9 #define TYPE_DECIM 9
#define TYPE_BIN 10 #define TYPE_BIN 10
#define TYPE_PCHAR 11 #define TYPE_PCHAR 11
......
This diff is collapsed.
/* Copyright (C) Olivier Bertrand 2004 - 2015 /* Copyright (C) MariaDB Corporation Ab
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
/** @file ha_connect.h /** @file ha_connect.h
Author Olivier Bertrand
@brief @brief
The ha_connect engine is a prototype storage engine to access external data. The ha_connect engine is a prototype storage engine to access external data.
......
...@@ -193,7 +193,7 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section ) ...@@ -193,7 +193,7 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section )
} }
for (key = section->key; key; key = key->next) for (key = section->key; key; key = key->next)
if (key->name[0]) { if (key->name && key->name[0]) {
fprintf(file, "%s", SVP(key->name)); fprintf(file, "%s", SVP(key->name));
if (key->value) if (key->value)
......
This diff is collapsed.
/***********************************************************************/
/* JavaConn.h : header file for the Java connection classes. */
/***********************************************************************/
/***********************************************************************/
/* Included C-definition files required by the interface. */
/***********************************************************************/
#include "block.h"
#include "jdbccat.h"
/***********************************************************************/
/* Java native interface. */
/***********************************************************************/
#include <jni.h>
/***********************************************************************/
/* Constants and defines. */
/***********************************************************************/
// Miscellaneous sizing info
#define MAX_NUM_OF_MSG 10 // Max number of error messages
//efine MAX_CURRENCY 30 // Max size of Currency($) string
#define MAX_TNAME_LEN 32 // Max size of table names
//efine MAX_FNAME_LEN 256 // Max size of field names
//efine MAX_STRING_INFO 256 // Max size of string from SQLGetInfo
//efine MAX_DNAME_LEN 256 // Max size of Recordset names
//efine MAX_CONNECT_LEN 512 // Max size of Connect string
//efine MAX_CURSOR_NAME 18 // Max size of a cursor name
#define DEFAULT_FIELD_TYPE 0 // TYPE_NULL
#if !defined(__WIN__)
typedef unsigned char *PUCHAR;
#endif // !__WIN__
enum JCATINFO {
CAT_TAB = 1, // JDBC Tables
CAT_COL = 2, // JDBC Columns
CAT_KEY = 3, // JDBC PrimaryKeys
//CAT_STAT = 4, // SQLStatistics
//CAT_SPC = 5 // SQLSpecialColumns
};
/***********************************************************************/
/* This structure is used to control the catalog functions. */
/***********************************************************************/
typedef struct tagJCATPARM {
JCATINFO Id; // Id to indicate function
PQRYRES Qrp; // Result set pointer
PCSZ DB; // Database (Schema)
PCSZ Tab; // Table name or pattern
PCSZ Pat; // Table type or column pattern
} JCATPARM;
typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *);
typedef jint(JNICALL *GETJVM) (JavaVM **, jsize, jsize *);
#if defined(_DEBUG)
typedef jint(JNICALL *GETDEF) (void *);
#endif // _DEBUG
class JAVAConn;
/***********************************************************************/
/* JAVAConn class. */
/***********************************************************************/
class JAVAConn : public BLOCK {
friend class TDBJMG;
private:
JAVAConn(); // Standard (unused) constructor
public:
// Constructor
JAVAConn(PGLOBAL g, PCSZ wrapper);
// Set static variables
static void SetJVM(void) {
LibJvm = NULL;
CreateJavaVM = NULL;
GetCreatedJavaVMs = NULL;
#if defined(_DEBUG)
GetDefaultJavaVMInitArgs = NULL;
#endif // _DEBUG
} // end of SetJVM
static void ResetJVM(void);
static bool GetJVM(PGLOBAL g);
// Implementation
public:
//virtual ~JAVAConn();
bool IsOpen(void) { return m_Opened; }
bool IsConnected(void) { return m_Connected; }
// Java operations
protected:
bool gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig);
bool Check(jint rc = 0);
public:
virtual void AddJars(PSTRG jpop, char sep) = 0;
virtual bool Connect(PJPARM sop) = 0;
virtual bool Open(PGLOBAL g);
virtual bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options,
PCSZ filter, bool pipe) = 0;
virtual void Close(void);
protected:
// Members
#if defined(__WIN__)
static HANDLE LibJvm; // Handle to the jvm DLL
#else // !__WIN__
static void *LibJvm; // Handle for the jvm shared library
#endif // !__WIN__
static CRTJVM CreateJavaVM;
static GETJVM GetCreatedJavaVMs;
#if defined(_DEBUG)
static GETDEF GetDefaultJavaVMInitArgs;
#endif // _DEBUG
PGLOBAL m_G;
JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine)
JNIEnv *env; // Pointer to native interface
jclass jdi; // Pointer to the java wrapper class
jobject job; // The java wrapper class object
jmethodID errid; // The GetErrmsg method ID
bool m_Opened;
bool m_Connected;
PCSZ DiscFunc;
PCSZ Msg;
PCSZ m_Wrap;
int m_Rows;
}; // end of JAVAConn class definition
#ifndef __JDBCCAT_H
#define __JDBCCAT_H
// Timeout and net wait defaults // Timeout and net wait defaults
#define DEFAULT_LOGIN_TIMEOUT -1 // means do not set #define DEFAULT_LOGIN_TIMEOUT -1 // means do not set
#define DEFAULT_QUERY_TIMEOUT -1 // means do not set #define DEFAULT_QUERY_TIMEOUT -1 // means do not set
...@@ -8,9 +11,9 @@ typedef struct jdbc_parms { ...@@ -8,9 +11,9 @@ typedef struct jdbc_parms {
PCSZ Url; // Driver URL PCSZ Url; // Driver URL
PCSZ User; // User connect info PCSZ User; // User connect info
PCSZ Pwd; // Password connect info PCSZ Pwd; // Password connect info
//char *Properties; // Connection property list
//int Cto; // Connect timeout //int Cto; // Connect timeout
//int Qto; // Query timeout //int Qto; // Query timeout
int Version; // Driver version
int Fsize; // Fetch size int Fsize; // Fetch size
bool Scrollable; // Scrollable cursor bool Scrollable; // Scrollable cursor
} JDBCPARM, *PJPARM; } JDBCPARM, *PJPARM;
...@@ -28,3 +31,5 @@ PQRYRES JDBCSrcCols(PGLOBAL g, PCSZ src, PJPARM sop); ...@@ -28,3 +31,5 @@ PQRYRES JDBCSrcCols(PGLOBAL g, PCSZ src, PJPARM sop);
PQRYRES JDBCTables(PGLOBAL g, PCSZ db, PCSZ tabpat, PQRYRES JDBCTables(PGLOBAL g, PCSZ db, PCSZ tabpat,
PCSZ tabtyp, int maxres, bool info, PJPARM sop); PCSZ tabtyp, int maxres, bool info, PJPARM sop);
PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info); PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info);
#endif // __JDBCCAT_H
This diff is collapsed.
/***********************************************************************/ /***********************************************************************/
/* JDBConn.h : header file for the JDBC connection classes. */ /* JDBConn.h : header file for the JDBC connection classes. */
/***********************************************************************/ /***********************************************************************/
//nclude <windows.h> /* Windows include file */ #include "javaconn.h"
//nclude <windowsx.h> /* Message crackers */
/***********************************************************************/
/* Included C-definition files required by the interface. */
/***********************************************************************/
#include "block.h"
/***********************************************************************/
/* JDBC interface. */
/***********************************************************************/
#include <jni.h>
/***********************************************************************/
/* Constants and defines. */
/***********************************************************************/
// Miscellaneous sizing info
#define MAX_NUM_OF_MSG 10 // Max number of error messages
//efine MAX_CURRENCY 30 // Max size of Currency($) string
#define MAX_TNAME_LEN 32 // Max size of table names
//efine MAX_FNAME_LEN 256 // Max size of field names
//efine MAX_STRING_INFO 256 // Max size of string from SQLGetInfo
//efine MAX_DNAME_LEN 256 // Max size of Recordset names
//efine MAX_CONNECT_LEN 512 // Max size of Connect string
//efine MAX_CURSOR_NAME 18 // Max size of a cursor name
#define DEFAULT_FIELD_TYPE 0 // TYPE_NULL
#if !defined(__WIN__)
typedef unsigned char *PUCHAR;
#endif // !__WIN__
enum JCATINFO {
CAT_TAB = 1, // JDBC Tables
CAT_COL = 2, // JDBC Columns
CAT_KEY = 3, // JDBC PrimaryKeys
//CAT_STAT = 4, // SQLStatistics
//CAT_SPC = 5 // SQLSpecialColumns
};
/***********************************************************************/
/* This structure is used to control the catalog functions. */
/***********************************************************************/
typedef struct tagJCATPARM {
JCATINFO Id; // Id to indicate function
PQRYRES Qrp; // Result set pointer
PCSZ DB; // Database (Schema)
PCSZ Tab; // Table name or pattern
PCSZ Pat; // Table type or column pattern
} JCATPARM;
typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *);
typedef jint(JNICALL *GETJVM) (JavaVM **, jsize, jsize *);
#if defined(_DEBUG)
typedef jint(JNICALL *GETDEF) (void *);
#endif // _DEBUG
// JDBC connection to a data source // JDBC connection to a data source
class TDBJDBC; class TDBJDBC;
...@@ -66,7 +12,7 @@ class TDBXJDC; ...@@ -66,7 +12,7 @@ class TDBXJDC;
/***********************************************************************/ /***********************************************************************/
/* JDBConn class. */ /* JDBConn class. */
/***********************************************************************/ /***********************************************************************/
class JDBConn : public BLOCK { class JDBConn : public JAVAConn {
friend class TDBJDBC; friend class TDBJDBC;
friend class TDBXJDC; friend class TDBXJDC;
//friend PQRYRES GetColumnInfo(PGLOBAL, char*&, char *, int, PVBLK&); //friend PQRYRES GetColumnInfo(PGLOBAL, char*&, char *, int, PVBLK&);
...@@ -74,118 +20,80 @@ class JDBConn : public BLOCK { ...@@ -74,118 +20,80 @@ class JDBConn : public BLOCK {
JDBConn(); // Standard (unused) constructor JDBConn(); // Standard (unused) constructor
public: public:
JDBConn(PGLOBAL g, TDBJDBC *tdbp); // Constructor
JDBConn(PGLOBAL g, PCSZ wrapper);
int Open(PJPARM sop); virtual void AddJars(PSTRG jpop, char sep);
int Rewind(PCSZ sql); PQRYRES AllocateResult(PGLOBAL g, PTDB tdbp);
void Close(void);
PQRYRES AllocateResult(PGLOBAL g);
// Attributes // Attributes
public: public:
char *GetQuoteChar(void) { return m_IDQuoteChar; } char *GetQuoteChar(void) { return m_IDQuoteChar; }
// Database successfully opened? virtual int GetMaxValue(int infotype);
bool IsOpen(void) { return m_Opened; }
//PSZ GetStringInfo(ushort infotype);
int GetMaxValue(int infotype);
//PSZ GetConnect(void) { return m_Connect; }
public: public:
// Operations // Operations
//void SetLoginTimeout(DWORD sec) {m_LoginTimeout = sec;} virtual bool Connect(PJPARM sop);
//void SetQueryTimeout(DWORD sec) {m_QueryTimeout = sec;} virtual bool MakeCursor(PGLOBAL g, PTDB tdbp, PCSZ options,
//void SetUserName(PSZ user) {m_User = user;} PCSZ filter, bool pipe) {return true;}
//void SetUserPwd(PSZ pwd) {m_Pwd = pwd;} virtual int GetResultSize(PCSZ sql, PCOL colp);
int GetResultSize(PCSZ sql, JDBCCOL *colp); virtual int ExecuteCommand(PCSZ sql);
int ExecuteQuery(PCSZ sql); virtual int ExecuteQuery(PCSZ sql);
int ExecuteUpdate(PCSZ sql); virtual int ExecuteUpdate(PCSZ sql);
int Fetch(int pos = 0); virtual int Fetch(int pos = 0);
virtual void SetColumnValue(int rank, PSZ name, PVAL val);
// Jdbc operations
bool PrepareSQL(PCSZ sql); bool PrepareSQL(PCSZ sql);
int ExecuteSQL(void); int ExecuteSQL(void); // Prepared statement
bool SetParam(JDBCCOL *colp); bool SetParam(JDBCCOL *colp);
int ExecSQLcommand(PCSZ sql);
void SetColumnValue(int rank, PSZ name, PVAL val);
int GetCatInfo(JCATPARM *cap); int GetCatInfo(JCATPARM *cap);
//bool GetDataSources(PQRYRES qrp);
bool GetDrivers(PQRYRES qrp); bool GetDrivers(PQRYRES qrp);
PQRYRES GetMetaData(PGLOBAL g, PCSZ src); PQRYRES GetMetaData(PGLOBAL g, PCSZ src);
int Rewind(PCSZ sql);
public:
// Set static variables
static void SetJVM(void) {
LibJvm = NULL;
CreateJavaVM = NULL;
GetCreatedJavaVMs = NULL;
#if defined(_DEBUG)
GetDefaultJavaVMInitArgs = NULL;
#endif // _DEBUG
} // end of SetJVM
static void ResetJVM(void);
static bool GetJVM(PGLOBAL g);
// Implementation // Implementation
public: public:
//virtual ~JDBConn(); //virtual ~JDBConn();
// JDBC operations
protected:
bool gmID(PGLOBAL g, jmethodID& mid, const char *name, const char *sig);
bool Check(jint rc = 0);
//void ThrowDJX(int rc, PSZ msg/*, HSTMT hstmt = SQL_NULL_HSTMT*/);
//void ThrowDJX(PSZ msg);
//void Free(void);
protected: protected:
// Members // Members
#if defined(__WIN__) #if 0
static HANDLE LibJvm; // Handle to the jvm DLL JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine)
#else // !__WIN__ JNIEnv *env; // Pointer to native interface
static void *LibJvm; // Handle for the jvm shared library jclass jdi; // Pointer to the java wrapper class
#endif // !__WIN__ jobject job; // The java wrapper class object
static CRTJVM CreateJavaVM; jmethodID errid; // The GetErrmsg method ID
static GETJVM GetCreatedJavaVMs; #endif // 0
#if defined(_DEBUG) jmethodID xqid; // The ExecuteQuery method ID
static GETDEF GetDefaultJavaVMInitArgs; jmethodID xuid; // The ExecuteUpdate method ID
#endif // _DEBUG jmethodID xid; // The Execute method ID
PGLOBAL m_G; jmethodID grs; // The GetResult method ID
TDBJDBC *m_Tdb; jmethodID readid; // The ReadNext method ID
JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine) jmethodID fetchid; // The Fetch method ID
JNIEnv *env; // Pointer to native interface jmethodID typid; // The ColumnType method ID
jclass jdi; // Pointer to the java wrapper class jmethodID prepid; // The CreatePrepStmt method ID
jobject job; // The java wrapper class object jmethodID xpid; // The ExecutePrep method ID
jmethodID xqid; // The ExecuteQuery method ID jmethodID pcid; // The ClosePrepStmt method ID
jmethodID xuid; // The ExecuteUpdate method ID jmethodID objfldid; // The ObjectField method ID
jmethodID xid; // The Execute method ID jmethodID chrfldid; // The StringField method ID
jmethodID grs; // The GetResult method ID jmethodID intfldid; // The IntField method ID
jmethodID readid; // The ReadNext method ID jmethodID dblfldid; // The DoubleField method ID
jmethodID fetchid; // The Fetch method ID jmethodID fltfldid; // The FloatField method ID
jmethodID typid; // The ColumnType method ID jmethodID datfldid; // The DateField method ID
jmethodID prepid; // The CreatePrepStmt method ID jmethodID timfldid; // The TimeField method ID
jmethodID xpid; // The ExecutePrep method ID jmethodID tspfldid; // The TimestampField method ID
jmethodID pcid; // The ClosePrepStmt method ID jmethodID bigfldid; // The BigintField method ID
jmethodID errid; // The GetErrmsg method ID // PCSZ Msg;
jmethodID objfldid; // The ObjectField method ID // PCSZ m_Wrap;
jmethodID chrfldid; // The StringField method ID
jmethodID intfldid; // The IntField method ID
jmethodID dblfldid; // The DoubleField method ID
jmethodID fltfldid; // The FloatField method ID
jmethodID datfldid; // The DateField method ID
jmethodID timfldid; // The TimeField method ID
jmethodID tspfldid; // The TimestampField method ID
jmethodID bigfldid; // The BigintField method ID
PCSZ Msg;
char *m_Wrap;
char m_IDQuoteChar[2]; char m_IDQuoteChar[2];
PCSZ m_Pwd; PCSZ m_Pwd;
int m_Ncol; int m_Ncol;
int m_Aff; int m_Aff;
int m_Rows;
int m_Fetch; int m_Fetch;
int m_RowsetSize; int m_RowsetSize;
jboolean m_Updatable; jboolean m_Updatable;
jboolean m_Transact; jboolean m_Transact;
jboolean m_Scrollable; jboolean m_Scrollable;
bool m_Opened;
bool m_Full; bool m_Full;
}; // end of JDBConn class definition }; // end of JDBConn class definition
This diff is collapsed.
/************** MongoFam H Declares Source Code File (.H) **************/
/* Name: jmgfam.h Version 1.0 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2017 */
/* */
/* This file contains the JAVA MongoDB access method classes declares */
/***********************************************************************/
#pragma once
/***********************************************************************/
/* Include MongoDB library header files. */
/***********************************************************************/
#include "block.h"
//#include "mongo.h"
#include "jmgoconn.h"
typedef class JMGFAM *PJMGFAM;
typedef class MGODEF *PMGODEF;
/***********************************************************************/
/* This is the Java MongoDB Access Method class declaration. */
/***********************************************************************/
class DllExport JMGFAM : public DOSFAM {
friend void mongo_init(bool);
public:
// Constructor
JMGFAM(PJDEF tdp);
JMGFAM(PJMGFAM txfp);
// Implementation
virtual AMT GetAmType(void) { return TYPE_AM_MGO; }
virtual bool GetUseTemp(void) { return false; }
virtual int GetPos(void);
virtual int GetNextPos(void);
virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) JMGFAM(this); }
void SetLrecl(int lrecl) { Lrecl = lrecl; }
// Methods
virtual void Reset(void);
virtual int GetFileLength(PGLOBAL g);
virtual int Cardinality(PGLOBAL g);
virtual int MaxBlkSize(PGLOBAL g, int s);
virtual bool AllocateBuffer(PGLOBAL g) { return false; }
virtual int GetRowID(void);
virtual bool RecordPos(PGLOBAL g);
virtual bool SetPos(PGLOBAL g, int recpos);
virtual int SkipRecord(PGLOBAL g, bool header);
virtual bool OpenTableFile(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g);
virtual int WriteBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc);
virtual void CloseTableFile(PGLOBAL g, bool abort);
virtual void Rewind(void);
protected:
virtual bool OpenTempFile(PGLOBAL g) { return false; }
virtual bool MoveIntermediateLines(PGLOBAL g, bool *b) { return false; }
virtual int RenameTempFile(PGLOBAL g) { return RC_OK; }
virtual int InitDelete(PGLOBAL g, int fpos, int spos);
bool Init(PGLOBAL g);
//bool MakeCursor(PGLOBAL g);
// Members
JMgoConn *Jcp; // Points to a Mongo connection class
JDBCPARM Ops; // Additional parameters
PFBLOCK To_Fbt; // Pointer to temp file block
MODE Mode;
PCSZ Uristr;
PCSZ Db_name;
PCSZ Coll_name;
PCSZ Options;
PCSZ Filter;
PSZ Wrapname;
bool Done; // Init done
bool Pipe;
int Version;
int Curpos; // Cursor position of last fetch
}; // end of class JMGFAM
This diff is collapsed.
This diff is collapsed.
...@@ -53,6 +53,36 @@ void trans_func(unsigned int u, _EXCEPTION_POINTERS* pExp) ...@@ -53,6 +53,36 @@ void trans_func(unsigned int u, _EXCEPTION_POINTERS* pExp)
char *GetExceptionDesc(PGLOBAL g, unsigned int e); char *GetExceptionDesc(PGLOBAL g, unsigned int e);
#endif // SE_CATCH #endif // SE_CATCH
/***********************************************************************/
/* IsNum: check whether this string is all digits. */
/***********************************************************************/
bool IsNum(PSZ s)
{
for (char *p = s; *p; p++)
if (*p == ']')
break;
else if (!isdigit(*p) || *p == '-')
return false;
return true;
} // end of IsNum
/***********************************************************************/
/* NextChr: return the first found '[' or Sep pointer. */
/***********************************************************************/
char *NextChr(PSZ s, char sep)
{
char *p1 = strchr(s, '[');
char *p2 = strchr(s, sep);
if (!p2)
return p1;
else if (p1)
return MY_MIN(p1, p2);
return p2;
} // end of NextChr
/***********************************************************************/ /***********************************************************************/
/* Parse a json string. */ /* Parse a json string. */
...@@ -992,7 +1022,24 @@ PSZ JOBJECT::GetText(PGLOBAL g, PSZ text) ...@@ -992,7 +1022,24 @@ PSZ JOBJECT::GetText(PGLOBAL g, PSZ text)
if (!First && n) if (!First && n)
return NULL; return NULL;
else for (PJPR jp = First; jp; jp = jp->Next) else if (n == 1 && Size == 1 && !strcmp(First->GetKey(), "$date")) {
int i;
First->Val->GetText(g, text);
i = (text[1] == '-' ? 2 : 1);
if (IsNum(text + i)) {
// Date is in milliseconds
int j = (int)strlen(text);
if (j >= 4 + i)
text[j - 3] = 0; // Change it to seconds
else
strcpy(text, " 0");
} // endif text
} else for (PJPR jp = First; jp; jp = jp->Next)
jp->Val->GetText(g, text); jp->Val->GetText(g, text);
if (n) if (n)
...@@ -1312,7 +1359,7 @@ PSZ JVALUE::GetText(PGLOBAL g, PSZ text) ...@@ -1312,7 +1359,7 @@ PSZ JVALUE::GetText(PGLOBAL g, PSZ text)
if (s) if (s)
strcat(strcat(text, " "), s); strcat(strcat(text, " "), s);
else else
strcat(text, " ???"); strcat(text, " <null>");
return text; return text;
} // end of GetText } // end of GetText
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) MariaDB Corporation Ab */
#define MSG_ACCESS_VIOLATN 200 #define MSG_ACCESS_VIOLATN 200
#define MSG_ADD_BAD_TYPE 201 #define MSG_ADD_BAD_TYPE 201
#define MSG_ALLOC_ERROR 202 #define MSG_ALLOC_ERROR 202
......
This diff is collapsed.
This diff is collapsed.
...@@ -13,6 +13,5 @@ jdbc : Variable settings depend on machine configuration ...@@ -13,6 +13,5 @@ jdbc : Variable settings depend on machine configuration
jdbc_new : Variable settings depend on machine configuration jdbc_new : Variable settings depend on machine configuration
jdbc_oracle : Variable settings depend on machine configuration jdbc_oracle : Variable settings depend on machine configuration
jdbc_postgresql : Variable settings depend on machine configuration jdbc_postgresql : Variable settings depend on machine configuration
json : TABLE_TYPE = JSON conflicts with the SQL syntax json_mgo : Need MongoDB running and its C Driver installed
json_udf : conflicts with the server JSON functions mongo : Need MongoDB running and its C Driver installed
json_udf_bin : conflicts with the server JSON functions
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment