Skip to content

Commit

Permalink
- Use delayed load for the MongoDB C Drive on Windows
Browse files Browse the repository at this point in the history
  modified:   storage/connect/CMakeLists.txt
  modified:   storage/connect/cmgoconn.cpp
  modified:   storage/connect/ha_connect.cc

- Add FORCE to the connect_type_conv enum values
  This will translate binary values to TYPE_STRING
  modified:   storage/connect/checklvl.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/odbconn.cpp

- Change the connect_xtrace variable to from int to set
  modified:   storage/connect/array.cpp
  modified:   storage/connect/blkfil.cpp
  modified:   storage/connect/block.h
  modified:   storage/connect/cmgoconn.cpp
  modified:   storage/connect/colblk.cpp
  modified:   storage/connect/connect.cc
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamdbf.cpp
  modified:   storage/connect/filamfix.cpp
  modified:   storage/connect/filamgz.cpp
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/filamzip.cpp
  modified:   storage/connect/filter.cpp
  modified:   storage/connect/global.h
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/inihandl.cpp
  modified:   storage/connect/javaconn.cpp
  modified:   storage/connect/jdbconn.cpp
  modified:   storage/connect/jmgfam.cpp
  modified:   storage/connect/jmgoconn.cpp
  modified:   storage/connect/json.cpp
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/libdoc.cpp
  modified:   storage/connect/mongo.cpp
  modified:   storage/connect/mycat.cc
  modified:   storage/connect/myconn.cpp
  modified:   storage/connect/odbconn.cpp
  modified:   storage/connect/plgdbutl.cpp
  modified:   storage/connect/plugutil.cpp
  modified:   storage/connect/reldef.cpp
  modified:   storage/connect/tabcol.cpp
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/tabext.cpp
  modified:   storage/connect/tabfix.cpp
  modified:   storage/connect/tabfmt.cpp
  modified:   storage/connect/tabjdbc.cpp
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/table.cpp
  modified:   storage/connect/tabmul.cpp
  modified:   storage/connect/tabmysql.cpp
  modified:   storage/connect/tabodbc.cpp
  modified:   storage/connect/tabpivot.cpp
  modified:   storage/connect/tabsys.cpp
  modified:   storage/connect/tabtbl.cpp
  modified:   storage/connect/tabutil.cpp
  modified:   storage/connect/tabvct.cpp
  modified:   storage/connect/tabwmi.cpp
  modified:   storage/connect/tabxml.cpp
  modified:   storage/connect/user_connect.cc
  modified:   storage/connect/valblk.cpp
  modified:   storage/connect/value.cpp
  modified:   storage/connect/xindex.cpp

- Restore connect_enable_mongo variable (but undocumented)
  modified:   storage/connect/ha_connect.cc
  modified:   storage/connect/mycat.cc
  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
  modified:   storage/connect/mysql-test/connect/r/tbl_thread.result
  modified:   storage/connect/mysql-test/connect/t/mongo.inc
  modified:   storage/connect/mysql-test/connect/t/mongo_test.inc
  modified:   storage/connect/mysql-test/connect/t/tbl_thread.test
  • Loading branch information
Buggynours committed Jan 31, 2018
1 parent 8345597 commit 942d727
Show file tree
Hide file tree
Showing 55 changed files with 849 additions and 812 deletions.
9 changes: 8 additions & 1 deletion storage/connect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ ENDIF(CONNECT_WITH_ODBC)
#
# JDBC with MongoDB Java Driver included but disabled if without MONGO
#
# OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON)
#OPTION(CONNECT_WITH_MONGO "Compile CONNECT storage engine with MONGO support" ON)
OPTION(CONNECT_WITH_JDBC "Compile CONNECT storage engine with JDBC support" ON)

IF(CONNECT_WITH_JDBC)
Expand Down Expand Up @@ -343,6 +343,13 @@ IF(NOT TARGET connect)
RETURN()
ENDIF()

IF(WIN32)
IF (libmongoc-1.0_FOUND)
SET_TARGET_PROPERTIES(connect PROPERTIES LINK_FLAGS
"/DELAYLOAD:libbson-1.0.dll /DELAYLOAD:libmongoc-1.0.dll")
ENDIF(libmongoc-1.0_FOUND)
ENDIF(WIN32)

# Install some extra files that belong to connect engine
IF(WIN32)
# install ha_connect.lib
Expand Down
20 changes: 10 additions & 10 deletions storage/connect/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ PARRAY MakeValueArray(PGLOBAL g, PPARM pp)
if ((valtyp = pp->Type) != TYPE_STRING)
len = 1;

if (trace)
if (trace(1))
htrc("valtyp=%d len=%d\n", valtyp, len);

/*********************************************************************/
Expand Down Expand Up @@ -287,7 +287,7 @@ bool ARRAY::AddValue(PGLOBAL g, PSZ strp)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding string(%d): '%s'\n", Nval, strp);

//Value->SetValue_psz(strp);
Expand All @@ -306,7 +306,7 @@ bool ARRAY::AddValue(PGLOBAL g, void *p)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding pointer(%d): %p\n", Nval, p);

Vblp->SetValue((PSZ)p, Nval++);
Expand All @@ -323,7 +323,7 @@ bool ARRAY::AddValue(PGLOBAL g, short n)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding SHORT(%d): %hd\n", Nval, n);

//Value->SetValue(n);
Expand All @@ -342,7 +342,7 @@ bool ARRAY::AddValue(PGLOBAL g, int n)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding int(%d): %d\n", Nval, n);

//Value->SetValue(n);
Expand All @@ -361,7 +361,7 @@ bool ARRAY::AddValue(PGLOBAL g, double d)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding float(%d): %lf\n", Nval, d);

Value->SetValue(d);
Expand All @@ -380,7 +380,7 @@ bool ARRAY::AddValue(PGLOBAL g, PXOB xp)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding (%d) from xp=%p\n", Nval, xp);

//AddValue(xp->GetValue());
Expand All @@ -399,7 +399,7 @@ bool ARRAY::AddValue(PGLOBAL g, PVAL vp)
return true;
} // endif Type

if (trace)
if (trace(1))
htrc(" adding (%d) from vp=%p\n", Nval, vp);

Vblp->SetValue(vp, Nval++);
Expand Down Expand Up @@ -990,7 +990,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
len += strlen(tp);
} // enfor i

if (trace)
if (trace(1))
htrc("Arraylist: len=%d\n", len);

p = (char *)PlugSubAlloc(g, NULL, len);
Expand All @@ -1003,7 +1003,7 @@ PSZ ARRAY::MakeArrayList(PGLOBAL g)
strcat(p, (++i == Nval) ? ")" : ",");
} // enfor i

if (trace)
if (trace(1))
htrc("Arraylist: newlen=%d\n", strlen(p));

return p;
Expand Down
8 changes: 4 additions & 4 deletions storage/connect/blkfil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int BLKFILARI::BlockEval(PGLOBAL)
break;
} // endswitch Opc

if (trace)
if (trace(1))
htrc("BlockEval: op=%d n=%d rc=%d\n", Opc, n, Result);

return Result;
Expand Down Expand Up @@ -338,7 +338,7 @@ int BLKFILAR2::BlockEval(PGLOBAL)
break;
} // endswitch Opc

if (trace)
if (trace(1))
htrc("BlockEval2: op=%d n=%d rc=%d\n", Opc, n, Result);

return Result;
Expand Down Expand Up @@ -474,7 +474,7 @@ int BLKFILMR2::BlockEval(PGLOBAL)
break;
} // endswitch Opc

if (trace)
if (trace(1))
htrc("BlockEval2: op=%d n=%d rc=%d\n", Opc, n, Result);

return Result;
Expand Down Expand Up @@ -567,7 +567,7 @@ int BLKSPCARI::BlockEval(PGLOBAL)
break;
} // endswitch Opc

if (trace)
if (trace(1))
htrc("BlockEval: op=%d n=%d rc=%d\n", Opc, n, Result);

return Result;
Expand Down
4 changes: 2 additions & 2 deletions storage/connect/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ typedef class BLOCK *PBLOCK;
class DllExport BLOCK {
public:
void * operator new(size_t size, PGLOBAL g, void *p = NULL) {
// if (trace > 3)
// htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p);
if (trace(256))
htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p);

return (PlugSubAlloc(g, p, size));
} // end of new
Expand Down
3 changes: 2 additions & 1 deletion storage/connect/checklvl.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum USETEMP {TMP_NO = 0, /* Never */
/***********************************************************************/
enum TYPCONV {TPC_NO = 0, /* Never */
TPC_YES = 1, /* Always */
TPC_SKIP = 2}; /* Skip TEXT columns */
TPC_FORCE = 2, /* Also convert BLOBs */
TPC_SKIP = 3}; /* Skip TEXT columns */

#endif // _CHKLVL_DEFINED_
18 changes: 9 additions & 9 deletions storage/connect/cmgoconn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g)
all = true;

if (Pcg->Pipe) {
if (trace)
if (trace(1))
htrc("Pipeline: %s\n", options);

p = strrchr(options, ']');
Expand Down Expand Up @@ -330,7 +330,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g)
*(char*)p = ']'; // Restore Colist for discovery
p = s->GetStr();

if (trace)
if (trace(33))
htrc("New Pipeline: %s\n", p);

Query = bson_new_from_json((const uint8_t *)p, -1, &Error);
Expand All @@ -350,7 +350,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g)

} else {
if (Pcg->Filter || filp) {
if (trace) {
if (trace(1)) {
if (Pcg->Filter)
htrc("Filter: %s\n", Pcg->Filter);

Expand All @@ -377,7 +377,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g)
tp->SetFilter(NULL); // Not needed anymore
} // endif To_Filter

if (trace)
if (trace(33))
htrc("selector: %s\n", s->GetStr());

s->Resize(s->GetLength() + 1);
Expand All @@ -393,7 +393,7 @@ bool CMgoConn::MakeCursor(PGLOBAL g)

if (!all) {
if (options && *options) {
if (trace)
if (trace(1))
htrc("options=%s\n", options);

p = options;
Expand Down Expand Up @@ -450,10 +450,10 @@ int CMgoConn::ReadNext(PGLOBAL g)
if (!Cursor && MakeCursor(g)) {
rc = RC_FX;
} else if (mongoc_cursor_next(Cursor, &Document)) {
if (trace > 1) {
if (trace(512)) {
bson_iter_t iter;
ShowDocument(&iter, Document, "");
} else if (trace == 1)
} else if (trace(1))
htrc("%s\n", GetDocument(g));

} else if (mongoc_cursor_error(Cursor, &Error)) {
Expand Down Expand Up @@ -589,7 +589,7 @@ int CMgoConn::Write(PGLOBAL g)
if (DocWrite(g, Fpc))
return RC_FX;

if (trace) {
if (trace(2)) {
char *str = bson_as_json(Fpc->Child, NULL);
htrc("Inserting: %s\n", str);
bson_free(str);
Expand Down Expand Up @@ -623,7 +623,7 @@ int CMgoConn::Write(PGLOBAL g)
} // endif iter

if (b) {
if (trace) {
if (trace(2)) {
char *str = bson_as_json(query, NULL);
htrc("update query: %s\n", str);
bson_free(str);
Expand Down
8 changes: 4 additions & 4 deletions storage/connect/colblk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ COLBLK::COLBLK(PCOL col1, PTDB tdbp)
//To_Orig = col1;
To_Tdb = tdbp;

if (trace > 1)
if (trace(2))
htrc(" copying COLBLK %s from %p to %p\n", Name, col1, this);

if (tdbp)
Expand Down Expand Up @@ -115,7 +115,7 @@ bool COLBLK::SetFormat(PGLOBAL, FORMAT& fmt)
{
fmt = Format;

if (trace > 1)
if (trace(2))
htrc("COLBLK: %p format=%c(%d,%d)\n",
this, *fmt.Type, fmt.Length, fmt.Prec);

Expand All @@ -128,7 +128,7 @@ bool COLBLK::SetFormat(PGLOBAL, FORMAT& fmt)
/***********************************************************************/
bool COLBLK::Eval(PGLOBAL g)
{
if (trace > 1)
if (trace(2))
htrc("Col Eval: %s status=%.4X\n", Name, Status);

if (!GetStatus(BUF_READ)) {
Expand Down Expand Up @@ -165,7 +165,7 @@ bool COLBLK::InitValue(PGLOBAL g)
AddStatus(BUF_READY);
Value->SetNullable(Nullable);

if (trace > 1)
if (trace(2))
htrc(" colp=%p type=%d value=%p coluse=%.4X status=%.4X\n",
this, Buf_Type, Value, ColUse, Status);

Expand Down
Loading

0 comments on commit 942d727

Please sign in to comment.