Commit 28af4212 authored by Olivier Bertrand's avatar Olivier Bertrand

- Implementation of the Json BJSON representation.

  VAL structures replace VALUE classes in binary trees.
  These parsed binary trees are swapped and saved on file
  Swapping is to replace pointers by offsets to make it portable.
  In restoring, class pointers to functions are realloced on place.
  Making BJSON files is done by the new UDF function jfile_bjson.
  modified:   storage/connect/block.h
  modified:   storage/connect/filamtxt.cpp
  modified:   storage/connect/filamtxt.h
  modified:   storage/connect/global.h
  modified:   storage/connect/json.cpp
  modified:   storage/connect/json.h
  modified:   storage/connect/jsonudf.cpp
  modified:   storage/connect/jsonudf.h
  modified:   storage/connect/tabjson.cpp
  modified:   storage/connect/tabjson.h
  modified:   storage/connect/value.h

- Make file (record) length and map memory possibly larger than MAX_INT
  modified:   storage/connect/filamap.cpp
  modified:   storage/connect/filamvct.cpp
  modified:   storage/connect/maputil.cpp
  modified:   storage/connect/maputil.h
  modified:   storage/connect/tabdos.cpp
  modified:   storage/connect/xindex.cpp

- Make column length as bytes (not characters)
  This when making column definitions
  modified:   storage/connect/ha_connect.cc

- Change the message when making index fails
  modified:   storage/connect/ha_connect.cc

- Update tests and results to reflect recent changes
  modified:   storage/connect/mysql-test/connect/r/alter_xml.result
  modified:   storage/connect/mysql-test/connect/r/alter_xml2.result
  modified:   storage/connect/mysql-test/connect/r/jdbc_oracle.result
  modified:   storage/connect/mysql-test/connect/r/json.result
  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/odbc_oracle.result
  modified:   storage/connect/mysql-test/connect/r/xml.result
  modified:   storage/connect/mysql-test/connect/r/xml2.result
  modified:   storage/connect/mysql-test/connect/r/xml2_html.result
  modified:   storage/connect/mysql-test/connect/r/xml2_mult.result
  modified:   storage/connect/mysql-test/connect/r/xml2_zip.result
  modified:   storage/connect/mysql-test/connect/r/xml_html.result
  modified:   storage/connect/mysql-test/connect/r/xml_mult.result
  modified:   storage/connect/mysql-test/connect/r/xml_zip.result
  modified:   storage/connect/mysql-test/connect/t/alter_xml.test
  modified:   storage/connect/mysql-test/connect/t/alter_xml2.test
  modified:   storage/connect/mysql-test/connect/t/jdbc_oracle.test
  modified:   storage/connect/mysql-test/connect/t/json.test
  modified:   storage/connect/mysql-test/connect/t/mongo_test.inc
  modified:   storage/connect/mysql-test/connect/t/odbc_oracle.test
  modified:   storage/connect/mysql-test/connect/t/xml.test
  modified:   storage/connect/mysql-test/connect/t/xml2.test
  modified:   storage/connect/mysql-test/connect/t/xml2_html.test
  modified:   storage/connect/mysql-test/connect/t/xml2_mult.test
  modified:   storage/connect/mysql-test/connect/t/xml2_zip.test
  modified:   storage/connect/mysql-test/connect/t/xml_html.test
  modified:   storage/connect/mysql-test/connect/t/xml_mult.test
  modified:   storage/connect/mysql-test/connect/t/xml_zip.test

- Typo
  modified:   storage/connect/value.cpp
parent dc3a693b
/**************** Block H Declares Source Code File (.H) ***************/ /**************** Block H Declares Source Code File (.H) ***************/
/* Name: BLOCK.H Version 2.0 */ /* Name: BLOCK.H Version 2.1 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998 */ /* (C) Copyright to the author Olivier BERTRAND 1998 - 2020 */
/* */ /* */
/* This file contains the BLOCK pure virtual class definition. */ /* This file contains the BLOCK pure virtual class definition. */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* Note: one of the main purpose of this base class is to take care */ /* Note: one of the main purpose of this base class is to take care */
/* of the very specific way Plug handles memory allocation. */ /* of the very specific way Connect handles memory allocation. */
/* Instead of allocating small chunks of storage via new or malloc */ /* Instead of allocating small chunks of storage via new or malloc */
/* Plug works in its private memory pool in which it does the sub- */ /* Connect works in its private memory pool in which it does the sub- */
/* allocation using the function PlugSubAlloc. These are never freed */ /* allocation using the function PlugSubAlloc. These are never freed */
/* separately but when a transaction is terminated, the entire pool */ /* separately but when a transaction is terminated, the entire pool */
/* is set to empty, resulting in a very fast and efficient allocate */ /* is set to empty, resulting in a very fast and efficient allocate */
/* process, no garbage collection problem, and an automatic recovery */ /* process, no garbage collection problem, and an automatic recovery */
/* procedure (via LongJump) when the memory is exhausted. */ /* procedure (via throw) when the memory is exhausted. */
/* For this to work new must be given two parameters, first the */ /* For this to work new must be given two parameters, first the */
/* global pointer of the Plug application, and an optional pointer to */ /* global pointer of the Plug application, and an optional pointer to */
/* the memory pool to use, defaulting to NULL meaning using the Plug */ /* the memory pool to use, defaulting to NULL meaning using the Plug */
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#define DllExport #define DllExport
#endif // !__WIN__ #endif // !__WIN__
typedef class JSON *PJSON;
/***********************************************************************/ /***********************************************************************/
/* Definition of class BLOCK with its method function new. */ /* Definition of class BLOCK with its method function new. */
/***********************************************************************/ /***********************************************************************/
...@@ -37,9 +39,14 @@ typedef class BLOCK *PBLOCK; ...@@ -37,9 +39,14 @@ typedef class BLOCK *PBLOCK;
class DllExport BLOCK { class DllExport BLOCK {
public: public:
void * operator new(size_t size, PGLOBAL g, void *p = NULL) { void *operator new(size_t size, PGLOBAL g, void *mp = NULL) {
xtrc(256, "New BLOCK: size=%d g=%p p=%p\n", size, g, p); xtrc(256, "New BLOCK: size=%d g=%p p=%p\n", size, g, mp);
return (PlugSubAlloc(g, p, size)); return PlugSubAlloc(g, mp, size);
} // end of new
void* operator new(size_t size, size_t mp) {
xtrc(256, "Realloc at: mp=%zd\n", mp);
return (void*)mp;
} // end of new } // end of new
virtual void Printf(PGLOBAL, FILE *, uint) {} // Produce file desc virtual void Printf(PGLOBAL, FILE *, uint) {} // Produce file desc
...@@ -47,11 +54,11 @@ class DllExport BLOCK { ...@@ -47,11 +54,11 @@ class DllExport BLOCK {
#if !defined(__BORLANDC__) #if !defined(__BORLANDC__)
// Avoid warning C4291 by defining a matching dummy delete operator // Avoid warning C4291 by defining a matching dummy delete operator
void operator delete(void *, PGLOBAL, void *) {} void operator delete(void*, PGLOBAL, void *) {}
void operator delete(void *, size_t) {} //void operator delete(void*, size_t) {}
#endif #endif
virtual ~BLOCK() {} virtual ~BLOCK() {}
}; // end of class BLOCK }; // end of class BLOCK
#endif // !BLOCK_DEFINED #endif // !BLOCK_DEFINED
...@@ -102,7 +102,7 @@ int MAPFAM::GetFileLength(PGLOBAL g) ...@@ -102,7 +102,7 @@ int MAPFAM::GetFileLength(PGLOBAL g)
bool MAPFAM::OpenTableFile(PGLOBAL g) bool MAPFAM::OpenTableFile(PGLOBAL g)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int len; size_t len;
MODE mode = Tdbp->GetMode(); MODE mode = Tdbp->GetMode();
PFBLOCK fp; PFBLOCK fp;
PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr; PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr;
...@@ -174,9 +174,9 @@ bool MAPFAM::OpenTableFile(PGLOBAL g) ...@@ -174,9 +174,9 @@ bool MAPFAM::OpenTableFile(PGLOBAL g)
} // endif hFile } // endif hFile
/*******************************************************************/ /*******************************************************************/
/* Get the file size (assuming file is smaller than 4 GB) */ /* Get the file size. */
/*******************************************************************/ /*******************************************************************/
len = mm.lenL; len = (size_t)mm.sz.QuadPart;
Memory = (char *)mm.memory; Memory = (char *)mm.memory;
if (!len) { // Empty or deleted file if (!len) { // Empty or deleted file
......
/*********** File AM Txt C++ Program Source Code File (.CPP) ***********/ /*********** File AM Txt C++ Program Source Code File (.CPP) ***********/
/* PROGRAM NAME: FILAMTXT */ /* PROGRAM NAME: FILAMTXT */
/* ------------- */ /* ------------- */
/* Version 1.7 */ /* Version 1.8 */
/* */ /* */
/* COPYRIGHT: */ /* COPYRIGHT: */
/* ---------- */ /* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2005-2017 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2020 */
/* */ /* */
/* WHAT THIS PROGRAM DOES: */ /* WHAT THIS PROGRAM DOES: */
/* ----------------------- */ /* ----------------------- */
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "plgdbsem.h" #include "plgdbsem.h"
#include "filamtxt.h" #include "filamtxt.h"
#include "tabdos.h" #include "tabdos.h"
#include "tabjson.h"
#if defined(UNIX) || defined(UNIV_LINUX) #if defined(UNIX) || defined(UNIV_LINUX)
#include "osutil.h" #include "osutil.h"
...@@ -1662,3 +1663,252 @@ void BLKFAM::Rewind(void) ...@@ -1662,3 +1663,252 @@ void BLKFAM::Rewind(void)
//Rbuf = 0; commented out in case we reuse last read block //Rbuf = 0; commented out in case we reuse last read block
} // end of Rewind } // end of Rewind
/* --------------------------- Class BINFAM -------------------------- */
/***********************************************************************/
/* BIN GetFileLength: returns file size in number of bytes. */
/***********************************************************************/
int BINFAM::GetFileLength(PGLOBAL g) {
int len;
if (!BStream)
len = TXTFAM::GetFileLength(g);
else
if ((len = _filelength(_fileno(BStream))) < 0)
sprintf(g->Message, MSG(FILELEN_ERROR), "_filelength", To_File);
xtrc(1, "File length=%d\n", len);
return len;
} // end of GetFileLength
/***********************************************************************/
/* Cardinality: returns table cardinality in number of rows. */
/* This function can be called with a null argument to test the */
/* availability of Cardinality implementation (1 yes, 0 no). */
/***********************************************************************/
int BINFAM::Cardinality(PGLOBAL g) {
return (g) ? -1 : 0;
} // end of Cardinality
/***********************************************************************/
/* OpenTableFile: Open a DOS/UNIX table file using C standard I/Os. */
/***********************************************************************/
bool BINFAM::OpenTableFile(PGLOBAL g) {
char opmode[4], filename[_MAX_PATH];
MODE mode = Tdbp->GetMode();
PDBUSER dbuserp = PlgGetUser(g);
switch (mode) {
case MODE_READ:
strcpy(opmode, "rb");
break;
case MODE_WRITE:
strcpy(opmode, "wb");
break;
default:
sprintf(g->Message, MSG(BAD_OPEN_MODE), mode);
return true;
} // endswitch Mode
// Now open the file stream
PlugSetPath(filename, To_File, Tdbp->GetPath());
if (!(BStream = PlugOpenFile(g, filename, opmode))) {
if (trace(1))
htrc("%s\n", g->Message);
return (mode == MODE_READ && errno == ENOENT)
? PushWarning(g, Tdbp) : true;
} // endif BStream
if (trace(1))
htrc("File %s open BStream=%p mode=%s\n", filename, BStream, opmode);
To_Fb = dbuserp->Openlist; // Keep track of File block
/*********************************************************************/
/* Allocate the line buffer. */
/*********************************************************************/
return AllocateBuffer(g);
} // end of OpenTableFile
/***********************************************************************/
/* Allocate the line buffer. For mode Delete a bigger buffer has to */
/* be allocated because is it also used to move lines into the file. */
/***********************************************************************/
bool BINFAM::AllocateBuffer(PGLOBAL g) {
MODE mode = Tdbp->GetMode();
// Lrecl is Ok
Buflen = Lrecl;
if (trace(1))
htrc("SubAllocating a buffer of %d bytes\n", Buflen);
To_Buf = (char*)PlugSubAlloc(g, NULL, Buflen);
return false;
} // end of AllocateBuffer
/***********************************************************************/
/* GetRowID: return the RowID of last read record. */
/***********************************************************************/
int BINFAM::GetRowID(void) {
return Rows;
} // end of GetRowID
/***********************************************************************/
/* GetPos: return the position of last read record. */
/***********************************************************************/
int BINFAM::GetPos(void) {
return Fpos;
} // end of GetPos
/***********************************************************************/
/* GetNextPos: return the position of next record. */
/***********************************************************************/
int BINFAM::GetNextPos(void) {
return ftell(BStream);
} // end of GetNextPos
/***********************************************************************/
/* SetPos: Replace the table at the specified position. */
/***********************************************************************/
bool BINFAM::SetPos(PGLOBAL g, int pos) {
Fpos = pos;
if (fseek(BStream, Fpos, SEEK_SET)) {
sprintf(g->Message, MSG(FSETPOS_ERROR), Fpos);
return true;
} // endif
Placed = true;
return false;
} // end of SetPos
/***********************************************************************/
/* Record file position in case of UPDATE or DELETE. */
/***********************************************************************/
bool BINFAM::RecordPos(PGLOBAL g) {
if ((Fpos = ftell(BStream)) < 0) {
sprintf(g->Message, MSG(FTELL_ERROR), 0, strerror(errno));
// strcat(g->Message, " (possible wrong ENDING option value)");
return true;
} // endif Fpos
return false;
} // end of RecordPos
/***********************************************************************/
/* ReadBuffer: Read one line for a text file. */
/***********************************************************************/
int BINFAM::ReadBuffer(PGLOBAL g) {
int rc;
if (!BStream)
return RC_EF;
xtrc(2, "ReadBuffer: Tdbp=%p To_Line=%p Placed=%d\n",
Tdbp, Tdbp->GetLine(), Placed);
if (!Placed) {
/*******************************************************************/
/* Record file position in case of UPDATE or DELETE. */
/*******************************************************************/
if (RecordPos(g))
return RC_FX;
CurBlk = (int)Rows++;
xtrc(2, "ReadBuffer: CurBlk=%d\n", CurBlk);
} else
Placed = false;
xtrc(2, " About to read: bstream=%p To_Buf=%p Buflen=%d\n",
BStream, To_Buf, Buflen);
// Read the prefix giving the row length
if (!fread(&Recsize, sizeof(size_t), 1, BStream)) {
if (!feof(BStream)) {
strcpy(g->Message, "Error reading line prefix\n");
return RC_FX;
} else
return RC_EF;
} else if (Recsize > Buflen) {
sprintf(g->Message, "Record too big (Recsize=%zd Buflen=%d)\n", Recsize, Buflen);
return RC_FX;
} // endif Recsize
if (fread(To_Buf, Recsize, 1, BStream)) {
xtrc(2, " Read: To_Buf=%p Recsize=%zd\n", To_Buf, Recsize);
// memcpy(Tdbp->GetLine(), To_Buf, Recsize);
num_read++;
rc = RC_OK;
} else if (feof(BStream)) {
rc = RC_EF;
} else {
#if defined(__WIN__)
sprintf(g->Message, MSG(READ_ERROR), To_File, _strerror(NULL));
#else
sprintf(g->Message, MSG(READ_ERROR), To_File, strerror(0));
#endif
xtrc(2, "%s\n", g->Message);
rc = RC_FX;
} // endif's fread
xtrc(2, "ReadBuffer: rc=%d\n", rc);
IsRead = true;
return rc;
} // end of ReadBuffer
/***********************************************************************/
/* WriteBuffer: File write routine for BIN access method. */
/***********************************************************************/
int BINFAM::WriteBuffer(PGLOBAL g) {
int curpos = 0;
bool moved = true;
/*********************************************************************/
/* Prepare writing the line. */
/*********************************************************************/
memcpy(To_Buf, Tdbp->GetLine(), Recsize);
/*********************************************************************/
/* Now start the writing process. */
/*********************************************************************/
if (fwrite(&Recsize, sizeof(size_t), 1, BStream) != 1) {
sprintf(g->Message, "Error %d writing prefix to %s",
errno, To_File);
return RC_FX;
} else if (fwrite(To_Buf, Recsize, 1, BStream) != 1) {
sprintf(g->Message, "Error %d writing %zd bytes to %s",
errno, Recsize, To_File);
return RC_FX;
} // endif fwrite
xtrc(1, "write done\n");
return RC_OK;
} // end of WriteBuffer
/***********************************************************************/
/* Table file close routine for DOS access method. */
/***********************************************************************/
void BINFAM::CloseTableFile(PGLOBAL g, bool abort) {
int rc;
Abort = abort;
rc = PlugCloseFile(g, To_Fb);
xtrc(1, "BIN Close: closing %s rc=%d\n", To_File, rc);
BStream = NULL; // So we can know whether table is open
} // end of CloseTableFile
/***********************************************************************/
/* Rewind routine for BIN access method. */
/***********************************************************************/
void BINFAM::Rewind(void) {
if (BStream) // Can be NULL when making index on void table
rewind(BStream);
Rows = 0;
OldBlk = CurBlk = -1;
} // end of Rewind
/************** FilAMTxt H Declares Source Code File (.H) **************/ /************** FilAMTxt H Declares Source Code File (.H) **************/
/* Name: FILAMTXT.H Version 1.3 */ /* Name: FILAMTXT.H Version 1.4 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2005-2014 */ /* (C) Copyright to the author Olivier BERTRAND 2005-2020 */
/* */ /* */
/* This file contains the file access method classes declares. */ /* This file contains the file access method classes declares. */
/***********************************************************************/ /***********************************************************************/
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
typedef class TXTFAM *PTXF; typedef class TXTFAM *PTXF;
typedef class DOSFAM *PDOSFAM; typedef class DOSFAM *PDOSFAM;
typedef class BLKFAM *PBLKFAM; typedef class BLKFAM *PBLKFAM;
typedef class BINFAM *PBINFAM;
typedef class DOSDEF *PDOSDEF; typedef class DOSDEF *PDOSDEF;
typedef class TDBDOS *PTDBDOS; typedef class TDBDOS *PTDBDOS;
...@@ -210,4 +211,45 @@ class DllExport BLKFAM : public DOSFAM { ...@@ -210,4 +211,45 @@ class DllExport BLKFAM : public DOSFAM {
bool Closing; // True when closing on Update bool Closing; // True when closing on Update
}; // end of class BLKFAM }; // end of class BLKFAM
/***********************************************************************/
/* This is the DOS/UNIX Access Method class declaration for binary */
/* files with variable record format (BJSON) */
/***********************************************************************/
class DllExport BINFAM : public TXTFAM {
public:
// Constructor
BINFAM(PDOSDEF tdp) : TXTFAM(tdp) {BStream = NULL; Recsize = 0;}
BINFAM(PBINFAM txfp) : TXTFAM(txfp) {BStream = txfp->BStream;}
// Implementation
virtual AMT GetAmType(void) {return TYPE_AM_BIN;}
virtual int GetPos(void);
virtual int GetNextPos(void);
virtual PTXF Duplicate(PGLOBAL g) { return (PTXF)new(g) BINFAM(this); }
// Methods
//virtual void Reset(void) {TXTFAM::Reset();}
virtual int GetFileLength(PGLOBAL g);
virtual int Cardinality(PGLOBAL g);
virtual int MaxBlkSize(PGLOBAL g, int s) {return s;}
virtual bool AllocateBuffer(PGLOBAL g);
virtual int GetRowID(void);
virtual bool RecordPos(PGLOBAL g);
virtual bool SetPos(PGLOBAL g, int recpos);
virtual int SkipRecord(PGLOBAL g, bool header) {return 0;}
virtual bool OpenTableFile(PGLOBAL g);
virtual int ReadBuffer(PGLOBAL g);
virtual int WriteBuffer(PGLOBAL g);
virtual int DeleteRecords(PGLOBAL g, int irc) {return RC_FX;}
virtual void CloseTableFile(PGLOBAL g, bool abort);
virtual void Rewind(void);
protected:
//virtual int InitDelete(PGLOBAL g, int fpos, int spos);
// Members
FILE *BStream; // Points to Bin file structure
size_t Recsize; // Length of last read record
}; // end of class BINFAM
#endif // __FILAMTXT_H #endif // __FILAMTXT_H
...@@ -1327,7 +1327,7 @@ VCMFAM::VCMFAM(PVCMFAM txfp) : VCTFAM(txfp) ...@@ -1327,7 +1327,7 @@ VCMFAM::VCMFAM(PVCMFAM txfp) : VCTFAM(txfp)
bool VCMFAM::OpenTableFile(PGLOBAL g) bool VCMFAM::OpenTableFile(PGLOBAL g)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int len; size_t len;
MODE mode = Tdbp->GetMode(); MODE mode = Tdbp->GetMode();
PFBLOCK fp = NULL; PFBLOCK fp = NULL;
PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr; PDBUSER dbuserp = (PDBUSER)g->Activityp->Aptr;
...@@ -1421,9 +1421,9 @@ bool VCMFAM::OpenTableFile(PGLOBAL g) ...@@ -1421,9 +1421,9 @@ bool VCMFAM::OpenTableFile(PGLOBAL g)
} // endif hFile } // endif hFile
/*******************************************************************/ /*******************************************************************/
/* Get the file size (assuming file is smaller than 4 GB) */ /* Get the file size. */
/*******************************************************************/ /*******************************************************************/
len = mm.lenL; len = (size_t)mm.sz.QuadPart;
Memory = (char *)mm.memory; Memory = (char *)mm.memory;
if (!len) { // Empty or deleted file if (!len) { // Empty or deleted file
...@@ -2762,7 +2762,7 @@ bool VMPFAM::OpenTableFile(PGLOBAL g) ...@@ -2762,7 +2762,7 @@ bool VMPFAM::OpenTableFile(PGLOBAL g)
bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i) bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i)
{ {
char filename[_MAX_PATH]; char filename[_MAX_PATH];
int len; size_t len;
HANDLE hFile; HANDLE hFile;
MEMMAP mm; MEMMAP mm;
PFBLOCK fp; PFBLOCK fp;
...@@ -2816,7 +2816,7 @@ bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i) ...@@ -2816,7 +2816,7 @@ bool VMPFAM::MapColumnFile(PGLOBAL g, MODE mode, int i)
/*****************************************************************/ /*****************************************************************/
/* Get the file size (assuming file is smaller than 4 GB) */ /* Get the file size (assuming file is smaller than 4 GB) */
/*****************************************************************/ /*****************************************************************/
len = mm.lenL; len = (size_t)mm.sz.QuadPart;
Memcol[i] = (char *)mm.memory; Memcol[i] = (char *)mm.memory;
if (!len) { // Empty or deleted file if (!len) { // Empty or deleted file
......
...@@ -240,10 +240,14 @@ inline void* MakePtr(void* memp, size_t offset) { ...@@ -240,10 +240,14 @@ inline void* MakePtr(void* memp, size_t offset) {
/* This routine makes an offset from a pointer new format. */ /* This routine makes an offset from a pointer new format. */
/***********************************************************************/ /***********************************************************************/
inline size_t MakeOff(void* memp, void* ptr) { inline size_t MakeOff(void* memp, void* ptr) {
if (ptr) {
#if defined(_DEBUG) #if defined(_DEBUG)
assert(ptr > memp); assert(ptr > memp);
#endif // _DEBUG #endif // _DEBUG
return ((!ptr) ? 0 : (size_t)((char*)ptr - (size_t)memp)); return (size_t)((char*)ptr - (size_t)memp);
} else
return 0;
} /* end of MakeOff */ } /* end of MakeOff */
/*-------------------------- End of Global.H --------------------------*/ /*-------------------------- End of Global.H --------------------------*/
...@@ -1574,6 +1574,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) ...@@ -1574,6 +1574,7 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
// Now get column information // Now get column information
pcf->Name= (char*)fp->field_name; pcf->Name= (char*)fp->field_name;
chset = (char*)fp->charset()->name;
if (fop && fop->special) { if (fop && fop->special) {
pcf->Fieldfmt= (char*)fop->special; pcf->Fieldfmt= (char*)fop->special;
...@@ -1584,7 +1585,14 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) ...@@ -1584,7 +1585,14 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
pcf->Scale= 0; pcf->Scale= 0;
pcf->Opt= (fop) ? (int)fop->opt : 0; pcf->Opt= (fop) ? (int)fop->opt : 0;
if ((pcf->Length= fp->field_length) < 0) if (fp->field_length >= 0) {
pcf->Length = fp->field_length;
// length is bytes for Connect, not characters
if (!strnicmp(chset, "utf8", 4))
pcf->Length /= 3;
} else
pcf->Length= 256; // BLOB? pcf->Length= 256; // BLOB?
pcf->Precision= pcf->Length; pcf->Precision= pcf->Length;
...@@ -1602,8 +1610,6 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf) ...@@ -1602,8 +1610,6 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
pcf->Fieldfmt= NULL; pcf->Fieldfmt= NULL;
} // endif fop } // endif fop
chset= (char *)fp->charset()->name;
if (!strcmp(chset, "binary")) if (!strcmp(chset, "binary"))
v = 'B'; // Binary string v = 'B'; // Binary string
...@@ -4940,11 +4946,11 @@ int ha_connect::external_lock(THD *thd, int lock_type) ...@@ -4940,11 +4946,11 @@ int ha_connect::external_lock(THD *thd, int lock_type)
// Here we do make the new indexes // Here we do make the new indexes
if (tdp->MakeIndex(g, adp, true) == RC_FX) { if (tdp->MakeIndex(g, adp, true) == RC_FX) {
// Make it a warning to avoid crash // Make it a warning to avoid crash
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, //push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
0, g->Message); // 0, g->Message);
rc= 0; //rc= 0;
//my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0)); my_message(ER_TOO_MANY_KEYS, g->Message, MYF(0));
//rc= HA_ERR_INTERNAL_ERROR; rc= HA_ERR_INDEX_CORRUPT;
} // endif MakeIndex } // endif MakeIndex
} else if (tdbp->GetDef()->Indexable() == 3) { } else if (tdbp->GetDef()->Indexable() == 3) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -239,6 +239,10 @@ extern "C" { ...@@ -239,6 +239,10 @@ extern "C" {
DllExport char* jfile_convert(UDF_EXEC_ARGS); DllExport char* jfile_convert(UDF_EXEC_ARGS);
DllExport void jfile_convert_deinit(UDF_INIT*); DllExport void jfile_convert_deinit(UDF_INIT*);
DllExport my_bool jfile_bjson_init(UDF_INIT*, UDF_ARGS*, char*);
DllExport char* jfile_bjson(UDF_EXEC_ARGS);
DllExport void jfile_bjson_deinit(UDF_INIT*);
DllExport my_bool envar_init(UDF_INIT*, UDF_ARGS*, char*); DllExport my_bool envar_init(UDF_INIT*, UDF_ARGS*, char*);
DllExport char *envar(UDF_EXEC_ARGS); DllExport char *envar(UDF_EXEC_ARGS);
...@@ -292,13 +296,14 @@ class JSNX : public BLOCK { ...@@ -292,13 +296,14 @@ class JSNX : public BLOCK {
PVAL MakeJson(PGLOBAL g, PJSON jsp); PVAL MakeJson(PGLOBAL g, PJSON jsp);
void SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n); void SetJsonValue(PGLOBAL g, PVAL vp, PJVAL val, int n);
PJSON GetRow(PGLOBAL g); PJSON GetRow(PGLOBAL g);
my_bool LocateArray(PJAR jarp); my_bool CompareValues(PVL v1, PVL v2);
my_bool LocateObject(PJOB jobp); my_bool LocateArray(PGLOBAL g, PJAR jarp);
my_bool LocateValue(PJVAL jvp); my_bool LocateObject(PGLOBAL g, PJOB jobp);
my_bool LocateArrayAll(PJAR jarp); my_bool LocateValue(PGLOBAL g, PJVAL jvp);
my_bool LocateObjectAll(PJOB jobp); my_bool LocateArrayAll(PGLOBAL g, PJAR jarp);
my_bool LocateValueAll(PJVAL jvp); my_bool LocateObjectAll(PGLOBAL g, PJOB jobp);
my_bool CompareTree(PJSON jp1, PJSON jp2); my_bool LocateValueAll(PGLOBAL g, PJVAL jvp);
my_bool CompareTree(PGLOBAL g, PJSON jp1, PJSON jp2);
my_bool AddPath(void); my_bool AddPath(void);
// Default constructor not to be used // Default constructor not to be used
...@@ -355,10 +360,10 @@ class JUP : public BLOCK { ...@@ -355,10 +360,10 @@ class JUP : public BLOCK {
void CopyNumeric(PGLOBAL g); void CopyNumeric(PGLOBAL g);
// Members // Members
FILE* fs; FILE *fs;
char* s; char *s;
char* buff; char *buff;
int len; size_t len;
int recl; int recl;
int i, k; int i, k;
}; // end of class JUP }; // end of class JUP
......
...@@ -90,8 +90,8 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR filename, ...@@ -90,8 +90,8 @@ HANDLE CreateFileMap(PGLOBAL g, LPCSTR filename,
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;
} // endif memory } // endif memory
// lenH is the high-order word of the file size // HighPart is the high-order word of the file size
mm->lenL = GetFileSize(hFile, &mm->lenH); mm->sz.LowPart = GetFileSize(hFile, (LPDWORD)&mm->sz.HighPart);
CloseHandle(hFileMap); // Not used anymore CloseHandle(hFileMap); // Not used anymore
} else // MODE_INSERT } else // MODE_INSERT
/*****************************************************************/ /*****************************************************************/
......
...@@ -7,8 +7,7 @@ extern "C" { ...@@ -7,8 +7,7 @@ extern "C" {
typedef struct { typedef struct {
void *memory; void *memory;
DWORD lenL; LARGE_INTEGER sz;
DWORD lenH;
} MEMMAP; } MEMMAP;
DllExport HANDLE CreateFileMap(PGLOBAL, LPCSTR, MEMMAP *, MODE, bool); DllExport HANDLE CreateFileMap(PGLOBAL, LPCSTR, MEMMAP *, MODE, bool);
......
...@@ -54,7 +54,7 @@ line ...@@ -54,7 +54,7 @@ line
</t1> </t1>
# NOTE: The first (ignored) row is due to the remaining HEADER=1 option. # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
# Testing field option modification # Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0; ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL XPATH='@', HEADER=0;
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
...@@ -64,7 +64,7 @@ SHOW CREATE TABLE t1; ...@@ -64,7 +64,7 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` char(10) NOT NULL `FIELD_FORMAT`='@' `d` char(10) NOT NULL `XPATH`='@'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=domdoc,rownode=row' `HEADER`=0 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=domdoc,rownode=row' `HEADER`=0
SELECT * FROM t2; SELECT * FROM t2;
line line
......
...@@ -56,7 +56,7 @@ line ...@@ -56,7 +56,7 @@ line
</t1> </t1>
# NOTE: The first (ignored) row is due to the remaining HEADER=1 option. # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
# Testing field option modification # Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0; ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL XPATH='@', HEADER=0;
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
...@@ -66,7 +66,7 @@ SHOW CREATE TABLE t1; ...@@ -66,7 +66,7 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` char(10) NOT NULL `FIELD_FORMAT`='@' `d` char(10) NOT NULL `XPATH`='@'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row' `HEADER`=0 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row' `HEADER`=0
SELECT * FROM t2; SELECT * FROM t2;
line line
......
...@@ -3,7 +3,7 @@ command varchar(128) not null, ...@@ -3,7 +3,7 @@ command varchar(128) not null,
number int(5) not null flag=1, number int(5) not null flag=1,
message varchar(255) flag=2) message varchar(255) flag=2)
ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager,Execsrc=1'; OPTION_LIST='User=system,Password=Choupy01,Execsrc=1';
SELECT * FROM t2 WHERE command = 'drop table employee'; SELECT * FROM t2 WHERE command = 'drop table employee';
command number message command number message
drop table employee 0 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist drop table employee 0 Execute: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
...@@ -23,14 +23,14 @@ Warnings: ...@@ -23,14 +23,14 @@ Warnings:
Warning 1105 Affected rows Warning 1105 Affected rows
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager'; OPTION_LIST='User=system,Password=Choupy01';
SELECT * FROM t1 WHERE table_name='employee'; SELECT * FROM t1 WHERE table_name='employee';
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
NULL SYSTEM EMPLOYEE TABLE NULL NULL SYSTEM EMPLOYEE TABLE NULL
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager'; OPTION_LIST='User=system,Password=Choupy01';
SELECT * FROM t1; SELECT * FROM t1;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
NULL SYSTEM EMPLOYEE ID 3 NUMBER 38 0 0 10 0 NULL NULL SYSTEM EMPLOYEE ID 3 NUMBER 38 0 0 10 0 NULL
...@@ -42,7 +42,7 @@ CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OP ...@@ -42,7 +42,7 @@ CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OP
HOST 'jdbc:oracle:thin:@localhost:1521:xe', HOST 'jdbc:oracle:thin:@localhost:1521:xe',
DATABASE 'SYSTEM', DATABASE 'SYSTEM',
USER 'system', USER 'system',
PASSWORD 'manager', PASSWORD 'Choupy01',
PORT 0, PORT 0,
SOCKET '', SOCKET '',
OWNER 'SYSTEM'); OWNER 'SYSTEM');
......
...@@ -24,15 +24,15 @@ DROP TABLE t1; ...@@ -24,15 +24,15 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
Authors INT(2) FIELD_FORMAT='$.AUTHOR[#]', Authors INT(2) JPATH='$.AUTHOR[#]',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -46,16 +46,16 @@ DROP TABLE t1; ...@@ -46,16 +46,16 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[" and "].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[" and "].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[" and "].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[" and "].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -69,16 +69,16 @@ DROP TABLE t1; ...@@ -69,16 +69,16 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[*].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[*].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -176,17 +176,17 @@ DROP TABLE t1; ...@@ -176,17 +176,17 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15) NOT NULL, ISBN CHAR(15) NOT NULL,
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[*].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[*].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATED.PREFIX', Translation CHAR(32) JPATH='$.TRANSLATED.PREFIX',
TranslatorFN CHAR(80) FIELD_FORMAT='$.TRANSLATED.TRANSLATOR.FIRSTNAME', TranslatorFN CHAR(80) JPATH='$.TRANSLATED.TRANSLATOR.FIRSTNAME',
TranslatorLN CHAR(80) FIELD_FORMAT='$.TRANSLATED.TRANSLATOR.LASTNAME', TranslatorLN CHAR(80) JPATH='$.TRANSLATED.TRANSLATOR.LASTNAME',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB', Year int(4) JPATH='$.DATEPUB',
INDEX IX(ISBN) INDEX IX(ISBN)
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='bib0.json' LRECL=320 OPTION_LIST='Pretty=0'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='bib0.json' LRECL=320 OPTION_LIST='Pretty=0';
...@@ -209,9 +209,9 @@ DROP TABLE t1; ...@@ -209,9 +209,9 @@ DROP TABLE t1;
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[*].NUMBER', WEEK INT(2) JPATH='$.WEEK[*].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[].EXPENSE["+"].WHAT', WHAT CHAR(32) JPATH='$.WEEK[].EXPENSE["+"].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[].EXPENSE[+].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[].EXPENSE[+].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t1; SELECT * FROM t1;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -230,9 +230,9 @@ DROP TABLE t1; ...@@ -230,9 +230,9 @@ DROP TABLE t1;
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[*].NUMBER', WEEK INT(2) JPATH='$.WEEK[*].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[*].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[*].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[*].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[*].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t1; SELECT * FROM t1;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -266,14 +266,14 @@ DROP TABLE t1; ...@@ -266,14 +266,14 @@ DROP TABLE t1;
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12) NOT NULL, WHO CHAR(12) NOT NULL,
WEEKS CHAR(12) NOT NULL FIELD_FORMAT='$.WEEK[", "].NUMBER', WEEKS CHAR(12) NOT NULL JPATH='$.WEEK[", "].NUMBER',
SUMS CHAR(64) NOT NULL FIELD_FORMAT='$.WEEK["+"].EXPENSE[+].AMOUNT', SUMS CHAR(64) NOT NULL JPATH='$.WEEK["+"].EXPENSE[+].AMOUNT',
SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[+].EXPENSE[+].AMOUNT', SUM DOUBLE(8,2) NOT NULL JPATH='$.WEEK[+].EXPENSE[+].AMOUNT',
AVGS CHAR(64) NOT NULL FIELD_FORMAT='$.WEEK["+"].EXPENSE[!].AMOUNT', AVGS CHAR(64) NOT NULL JPATH='$.WEEK["+"].EXPENSE[!].AMOUNT',
SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[+].EXPENSE[!].AMOUNT', SUMAVG DOUBLE(8,2) NOT NULL JPATH='$.WEEK[+].EXPENSE[!].AMOUNT',
AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[+].AMOUNT', AVGSUM DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[+].AMOUNT',
AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[!].AMOUNT', AVGAVG DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[!].AMOUNT',
AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[*].AMOUNT') AVERAGE DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t1; SELECT * FROM t1;
WHO WEEKS SUMS SUM AVGS SUMAVG AVGSUM AVGAVG AVERAGE WHO WEEKS SUMS SUM AVGS SUMAVG AVGSUM AVGAVG AVERAGE
...@@ -286,9 +286,9 @@ DROP TABLE t1; ...@@ -286,9 +286,9 @@ DROP TABLE t1;
# #
CREATE TABLE t2 ( CREATE TABLE t2 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[0].NUMBER', WEEK INT(2) JPATH='$.WEEK[0].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[0].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[0].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[0].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[0].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t2; SELECT * FROM t2;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -302,9 +302,9 @@ Janet 3 Food 18.00 ...@@ -302,9 +302,9 @@ Janet 3 Food 18.00
Janet 3 Beer 18.00 Janet 3 Beer 18.00
CREATE TABLE t3 ( CREATE TABLE t3 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[1].NUMBER', WEEK INT(2) JPATH='$.WEEK[1].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[1].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[1].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[1].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[1].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t3; SELECT * FROM t3;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -318,9 +318,9 @@ Beth 4 Beer 15.00 ...@@ -318,9 +318,9 @@ Beth 4 Beer 15.00
Janet 4 Car 17.00 Janet 4 Car 17.00
CREATE TABLE t4 ( CREATE TABLE t4 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[2].NUMBER', WEEK INT(2) JPATH='$.WEEK[2].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[2].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[2].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[2].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[2].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t4; SELECT * FROM t4;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -374,8 +374,8 @@ DROP TABLE t1, t2, t3, t4; ...@@ -374,8 +374,8 @@ DROP TABLE t1, t2, t3, t4;
CREATE TABLE t2 ( CREATE TABLE t2 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json';
SELECT * FROM t2; SELECT * FROM t2;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -390,8 +390,8 @@ Janet 3 Beer 18.00 ...@@ -390,8 +390,8 @@ Janet 3 Beer 18.00
CREATE TABLE t3 ( CREATE TABLE t3 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json';
SELECT * FROM t3; SELECT * FROM t3;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -406,8 +406,8 @@ Janet 4 Car 17.00 ...@@ -406,8 +406,8 @@ Janet 4 Car 17.00
CREATE TABLE t4 ( CREATE TABLE t4 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json';
SELECT * FROM t4; SELECT * FROM t4;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -425,8 +425,8 @@ Janet 5 Food 12.00 ...@@ -425,8 +425,8 @@ Janet 5 Food 12.00
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1;
SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT;
WHO WEEK WHAT AMOUNT WHO WEEK WHAT AMOUNT
...@@ -461,8 +461,8 @@ DROP TABLE t1; ...@@ -461,8 +461,8 @@ DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json';
ALTER TABLE t1 ALTER TABLE t1
PARTITION BY LIST COLUMNS(WEEK) ( PARTITION BY LIST COLUMNS(WEEK) (
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=4096 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=4096
OPTION_LIST='Driver=Java,Version=2' DATA_CHARSET=utf8; OPTION_LIST='Driver=Java,Version=2' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=Java,Version=2' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Depth=1,Driver=Java,Version=2' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=4096;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath
_id 1 CHAR 24 24 0 0 _id _id 1 CHAR 24 24 0 0 _id
...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0 ...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0
cuisine 1 CHAR 64 64 0 0 cuisine 1 CHAR 64 64 0 0
grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_date 1 CHAR 1024 1024 0 1 grades.0.date
grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_grade 1 CHAR 14 14 0 1 grades.0.grade
grades_score 5 BIGINT 2 2 0 1 grades.0.score grades_score 7 INTEGER 2 2 0 1 grades.0.score
name 1 CHAR 98 98 0 0 name 1 CHAR 98 98 0 0
restaurant_id 1 CHAR 8 8 0 0 restaurant_id 1 CHAR 8 8 0 0
DROP TABLE t1; DROP TABLE t1;
...@@ -60,7 +60,7 @@ DROP TABLE t1; ...@@ -60,7 +60,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants
OPTION_LIST='Level=1,Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096 DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096 DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` ( ...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` (
`cuisine` char(64) NOT NULL, `cuisine` char(64) NOT NULL,
`grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8' `LRECL`=4096 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8' `LRECL`=4096
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 2014-03-03T00:00:00.000Z A 2 Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 2014-03-03T00:00:00.000Z A 2 Morris Park Bake Shop 30075445
...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096;
...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` ( ...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` (
`borough` char(13) NOT NULL, `borough` char(13) NOT NULL,
`grades_date` char(24) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` char(24) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=2' `LRECL`=4096 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=2' `LRECL`=4096
...@@ -305,8 +305,8 @@ false ...@@ -305,8 +305,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities'
...@@ -344,11 +344,11 @@ true ...@@ -344,11 +344,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Driver=Java,Version=2' CONNECTION='mongodb://localhost:27017' LRECL=4096;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=4096 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=4096
OPTION_LIST='Driver=Java,Version=3' DATA_CHARSET=utf8; OPTION_LIST='Driver=Java,Version=3' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=Java,Version=3' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Depth=1,Driver=Java,Version=3' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=4096;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath
_id 1 CHAR 24 24 0 0 _id _id 1 CHAR 24 24 0 0 _id
...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0 ...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0
cuisine 1 CHAR 64 64 0 0 cuisine 1 CHAR 64 64 0 0
grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_date 1 CHAR 1024 1024 0 1 grades.0.date
grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_grade 1 CHAR 14 14 0 1 grades.0.grade
grades_score 5 BIGINT 2 2 0 1 grades.0.score grades_score 7 INTEGER 2 2 0 1 grades.0.score
name 1 CHAR 98 98 0 0 name 1 CHAR 98 98 0 0
restaurant_id 1 CHAR 8 8 0 0 restaurant_id 1 CHAR 8 8 0 0
DROP TABLE t1; DROP TABLE t1;
...@@ -60,7 +60,7 @@ DROP TABLE t1; ...@@ -60,7 +60,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants
OPTION_LIST='Level=1,Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096 DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096 DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` ( ...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` (
`cuisine` char(64) NOT NULL, `cuisine` char(64) NOT NULL,
`grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8' `LRECL`=4096 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8' `LRECL`=4096
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 -73.856077 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445
...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096;
...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` ( ...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` (
`borough` char(13) NOT NULL, `borough` char(13) NOT NULL,
`grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=3' `LRECL`=4096 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"cuisine":0}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=Java,level=2,version=3' `LRECL`=4096
...@@ -305,8 +305,8 @@ false ...@@ -305,8 +305,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities'
...@@ -344,11 +344,11 @@ true ...@@ -344,11 +344,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096; OPTION_LIST='Driver=Java,Version=3' CONNECTION='mongodb://localhost:27017' LRECL=4096;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=1024 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CONNECTION='mongodb://localhost:27017' LRECL=1024
OPTION_LIST='Driver=C,Version=0' DATA_CHARSET=utf8; OPTION_LIST='Driver=C,Version=0' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=C,Version=0' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=1024; OPTION_LIST='Depth=1,Driver=C,Version=0' DATA_CHARSET=utf8 CONNECTION='mongodb://localhost:27017' LRECL=1024;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Jpath
_id 1 CHAR 24 24 0 0 _id _id 1 CHAR 24 24 0 0 _id
...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0 ...@@ -27,7 +27,7 @@ borough 1 CHAR 13 13 0 0
cuisine 1 CHAR 64 64 0 0 cuisine 1 CHAR 64 64 0 0
grades_date 1 CHAR 1024 1024 0 1 grades.0.date grades_date 1 CHAR 1024 1024 0 1 grades.0.date
grades_grade 1 CHAR 14 14 0 1 grades.0.grade grades_grade 1 CHAR 14 14 0 1 grades.0.grade
grades_score 5 BIGINT 2 2 0 1 grades.0.score grades_score 7 INTEGER 2 2 0 1 grades.0.score
name 1 CHAR 98 98 0 0 name 1 CHAR 98 98 0 0
restaurant_id 1 CHAR 8 8 0 0 restaurant_id 1 CHAR 8 8 0 0
DROP TABLE t1; DROP TABLE t1;
...@@ -60,7 +60,7 @@ DROP TABLE t1; ...@@ -60,7 +60,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME=restaurants
OPTION_LIST='Level=1,Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024 DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024 DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` ( ...@@ -73,10 +73,10 @@ t1 CREATE TABLE `t1` (
`cuisine` char(64) NOT NULL, `cuisine` char(64) NOT NULL,
`grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` varchar(1024) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=C,Version=0' `DATA_CHARSET`='utf8' `LRECL`=1024 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=C,Version=0' `DATA_CHARSET`='utf8' `LRECL`=1024
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_date grades_grade grades_score name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 -73.856076999999999089 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 -73.856076999999999089 Morris Park Ave 10462 Bronx Bakery 1393804800 A 2 Morris Park Bake Shop 30075445
...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -111,12 +111,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024; OPTION_LIST='Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024;
...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` ( ...@@ -259,7 +259,7 @@ t1 CREATE TABLE `t1` (
`borough` char(13) NOT NULL, `borough` char(13) NOT NULL,
`grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date', `grades_date` bigint(13) DEFAULT NULL `JPATH`='grades.0.date',
`grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade', `grades_grade` char(14) DEFAULT NULL `JPATH`='grades.0.grade',
`grades_score` bigint(2) DEFAULT NULL `JPATH`='grades.0.score', `grades_score` int(2) DEFAULT NULL `JPATH`='grades.0.score',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"projection":{"cuisine":0}}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=C,level=2,version=0' `LRECL`=1024 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mongodb://localhost:27017' `TABLE_TYPE`='JSON' `TABNAME`='restaurants' `COLIST`='{"projection":{"cuisine":0}}' `FILTER`='{"cuisine":"French","borough":{"$ne":"Manhattan"}}' `OPTION_LIST`='Driver=C,level=2,version=0' `LRECL`=1024
...@@ -305,8 +305,8 @@ false ...@@ -305,8 +305,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=JSON TABNAME='cities'
...@@ -344,11 +344,11 @@ true ...@@ -344,11 +344,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=JSON TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024; OPTION_LIST='Driver=C,Version=0' CONNECTION='mongodb://localhost:27017' LRECL=1024;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Driver=C,Version=0' DATA_CHARSET=utf8; OPTION_LIST='Driver=C,Version=0' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=C,Version=0' DATA_CHARSET=utf8 ; OPTION_LIST='Depth=1,Driver=C,Version=0' DATA_CHARSET=utf8 ;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath
_id 1 CHAR 24 24 0 0 _id 1 CHAR 24 24 0 0
...@@ -58,7 +58,7 @@ DROP TABLE t1; ...@@ -58,7 +58,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Level=1,Driver=C,Version=0' DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=C,Version=0' DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` ( ...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` (
`grades_0` varchar(512) DEFAULT NULL `FIELD_FORMAT`='grades.0', `grades_0` varchar(512) DEFAULT NULL `FIELD_FORMAT`='grades.0',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=C,Version=0' `DATA_CHARSET`='utf8' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=C,Version=0' `DATA_CHARSET`='utf8'
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 Morris Park Ave 10462 Bronx Bakery {"date":{"$date":1393804800000},"grade":"A","score":2} Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 Morris Park Ave 10462 Bronx Bakery {"date":{"$date":1393804800000},"grade":"A","score":2} Morris Park Bake Shop 30075445
...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=C,Version=0' ; OPTION_LIST='Driver=C,Version=0' ;
...@@ -301,8 +301,8 @@ false ...@@ -301,8 +301,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities'
...@@ -340,11 +340,11 @@ true ...@@ -340,11 +340,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=C,Version=0' ; OPTION_LIST='Driver=C,Version=0' ;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Driver=Java,Version=2' DATA_CHARSET=utf8; OPTION_LIST='Driver=Java,Version=2' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=Java,Version=2' DATA_CHARSET=utf8 ; OPTION_LIST='Depth=1,Driver=Java,Version=2' DATA_CHARSET=utf8 ;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath
_id 1 CHAR 24 24 0 0 _id 1 CHAR 24 24 0 0
...@@ -58,7 +58,7 @@ DROP TABLE t1; ...@@ -58,7 +58,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Level=1,Driver=Java,Version=2' DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=Java,Version=2' DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` ( ...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` (
`grades_0` char(99) DEFAULT NULL `FIELD_FORMAT`='grades.0', `grades_0` char(99) DEFAULT NULL `FIELD_FORMAT`='grades.0',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=Java,Version=2' `DATA_CHARSET`='utf8'
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 [ -73.856077 , 40.848447] Morris Park Ave 10462 Bronx Bakery { "date" : { "$date" : "2014-03-03T00:00:00.000Z"} , "grade" : "A" , "score" : 2} Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 [ -73.856077 , 40.848447] Morris Park Ave 10462 Bronx Bakery { "date" : { "$date" : "2014-03-03T00:00:00.000Z"} , "grade" : "A" , "score" : 2} Morris Park Bake Shop 30075445
...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=2' ; OPTION_LIST='Driver=Java,Version=2' ;
...@@ -301,8 +301,8 @@ false ...@@ -301,8 +301,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities'
...@@ -340,11 +340,11 @@ true ...@@ -340,11 +340,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=2' ; OPTION_LIST='Driver=Java,Version=2' ;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -2,7 +2,7 @@ set connect_enable_mongo=1; ...@@ -2,7 +2,7 @@ set connect_enable_mongo=1;
# #
# Test the MONGO table type # Test the MONGO table type
# #
CREATE TABLE t1 (Document varchar(1024) field_format='*') CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Driver=Java,Version=3' DATA_CHARSET=utf8; OPTION_LIST='Driver=Java,Version=3' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# Test catfunc # Test catfunc
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=Java,Version=3' DATA_CHARSET=utf8 ; OPTION_LIST='Depth=1,Driver=Java,Version=3' DATA_CHARSET=utf8 ;
SELECT * from t1; SELECT * from t1;
Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Nullable Bpath
_id 1 CHAR 24 24 0 0 _id 1 CHAR 24 24 0 0
...@@ -58,7 +58,7 @@ DROP TABLE t1; ...@@ -58,7 +58,7 @@ DROP TABLE t1;
# Test discovery # Test discovery
# #
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME=restaurants
OPTION_LIST='Level=1,Driver=Java,Version=3' DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=Java,Version=3' DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` ( ...@@ -72,7 +72,7 @@ t1 CREATE TABLE `t1` (
`grades_0` char(84) DEFAULT NULL `FIELD_FORMAT`='grades.0', `grades_0` char(84) DEFAULT NULL `FIELD_FORMAT`='grades.0',
`name` char(98) NOT NULL, `name` char(98) NOT NULL,
`restaurant_id` char(8) NOT NULL `restaurant_id` char(8) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Level=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`='MONGO' `TABNAME`='restaurants' `OPTION_LIST`='Depth=1,Driver=Java,Version=3' `DATA_CHARSET`='utf8'
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
_id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id _id address_building address_coord address_street address_zipcode borough cuisine grades_0 name restaurant_id
58ada47de5a51ddfcd5ed51c 1007 [-73.856077, 40.848447] Morris Park Ave 10462 Bronx Bakery { "date" : { "$date" : 1393804800000 }, "grade" : "A", "score" : 2 } Morris Park Bake Shop 30075445 58ada47de5a51ddfcd5ed51c 1007 [-73.856077, 40.848447] Morris Park Ave 10462 Bronx Bakery { "date" : { "$date" : 1393804800000 }, "grade" : "A", "score" : 2 } Morris Park Bake Shop 30075445
...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -107,12 +107,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=3' ; OPTION_LIST='Driver=Java,Version=3' ;
...@@ -301,8 +301,8 @@ false ...@@ -301,8 +301,8 @@ false
CREATE TABLE t1 ( CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=MONGO TABNAME='cities'
...@@ -340,11 +340,11 @@ true ...@@ -340,11 +340,11 @@ true
CREATE TABLE t1 ( CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=MONGO TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=Java,Version=3' ; OPTION_LIST='Driver=Java,Version=3' ;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -10,7 +10,7 @@ SET NAMES utf8; ...@@ -10,7 +10,7 @@ SET NAMES utf8;
# All tables in all schemas (filtered with WHERE) # All tables in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables; CATFUNC=Tables;
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -20,7 +20,7 @@ NULL MTR V1 VIEW NULL ...@@ -20,7 +20,7 @@ NULL MTR V1 VIEW NULL
DROP TABLE t1; DROP TABLE t1;
# All tables in all schemas (filtered with WHERE) # All tables in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='%.%'; CATFUNC=Tables TABNAME='%.%';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -30,7 +30,7 @@ NULL MTR V1 VIEW NULL ...@@ -30,7 +30,7 @@ NULL MTR V1 VIEW NULL
DROP TABLE t1; DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE) # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='%.T1'; CATFUNC=Tables TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -38,7 +38,7 @@ NULL MTR T1 TABLE NULL ...@@ -38,7 +38,7 @@ NULL MTR T1 TABLE NULL
DROP TABLE t1; DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE) # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='T1'; CATFUNC=Tables TABNAME='T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -46,7 +46,7 @@ NULL MTR T1 TABLE NULL ...@@ -46,7 +46,7 @@ NULL MTR T1 TABLE NULL
DROP TABLE t1; DROP TABLE t1;
# Table "T1" in the schema "MTR" # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='MTR.T1'; CATFUNC=Tables TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -54,7 +54,7 @@ NULL MTR T1 TABLE NULL ...@@ -54,7 +54,7 @@ NULL MTR T1 TABLE NULL
DROP TABLE t1; DROP TABLE t1;
# All tables in the schema "MTR" # All tables in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='MTR.%'; CATFUNC=Tables TABNAME='MTR.%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Table_Type Remark Table_Cat Table_Schema Table_Name Table_Type Remark
...@@ -68,7 +68,7 @@ DROP TABLE t1; ...@@ -68,7 +68,7 @@ DROP TABLE t1;
# All columns in all schemas (limited with WHERE) # All columns in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns; CATFUNC=Columns;
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
...@@ -80,7 +80,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -80,7 +80,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
DROP TABLE t1; DROP TABLE t1;
# All columns in all schemas (limited with WHERE) # All columns in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='%.%'; CATFUNC=Columns TABNAME='%.%';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
...@@ -91,7 +91,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -91,7 +91,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
MTR V1 B 6 NUMBER 38 40 NULL NULL 1 MTR V1 B 6 NUMBER 38 40 NULL NULL 1
DROP TABLE t1; DROP TABLE t1;
# All tables "T1" in all schemas (limited with WHERE) # All tables "T1" in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.T1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
MTR T1 A 3 DECIMAL 38 40 0 10 1 MTR T1 A 3 DECIMAL 38 40 0 10 1
...@@ -99,7 +99,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -99,7 +99,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
DROP TABLE t1; DROP TABLE t1;
# Table "T1" in the schema "MTR" # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='MTR.T1'; CATFUNC=Columns TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
...@@ -108,7 +108,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu ...@@ -108,7 +108,7 @@ Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Bu
DROP TABLE t1; DROP TABLE t1;
# All tables "T1" in all schemas (filtered with WHERE) # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='%.T1'; CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
...@@ -121,14 +121,14 @@ DROP TABLE t1; ...@@ -121,14 +121,14 @@ DROP TABLE t1;
# Table "T1" in the default schema ("MTR") # Table "T1" in the default schema ("MTR")
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='T1'; TABNAME='T1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL, `A` decimal(40,0) DEFAULT NULL,
`B` double DEFAULT NULL `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='T1' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' `TABLE_TYPE`='ODBC' `TABNAME`='T1'
SELECT * FROM t1 ORDER BY A; SELECT * FROM t1 ORDER BY A;
A B A B
10 1000000000 10 1000000000
...@@ -157,14 +157,14 @@ DROP VIEW v1; ...@@ -157,14 +157,14 @@ DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
# Table "T1" in the schema "MTR" # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.T1'; TABNAME='MTR.T1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL, `A` decimal(40,0) DEFAULT NULL,
`B` double DEFAULT NULL `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.T1' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.T1'
SELECT * FROM t1; SELECT * FROM t1;
A B A B
10 1000000000 10 1000000000
...@@ -173,14 +173,14 @@ A B ...@@ -173,14 +173,14 @@ A B
DROP TABLE t1; DROP TABLE t1;
# View "V1" in the schema "MTR" # View "V1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.V1'; TABNAME='MTR.V1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`A` decimal(40,0) DEFAULT NULL, `A` decimal(40,0) DEFAULT NULL,
`B` double DEFAULT NULL `B` double DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.V1' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.V1'
SELECT * FROM t1; SELECT * FROM t1;
A B A B
10 1000000000 10 1000000000
...@@ -209,13 +209,13 @@ DROP VIEW v1; ...@@ -209,13 +209,13 @@ DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
# Table "T2" in the schema "MTR" # Table "T2" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.T2'; TABNAME='MTR.T2';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`A` varchar(64) DEFAULT NULL `A` varchar(64) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.T2' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' `TABLE_TYPE`='ODBC' `TABNAME`='MTR.T2'
SELECT * FROM t1; SELECT * FROM t1;
A A
test test
......
...@@ -85,9 +85,9 @@ DROP TABLE t1; ...@@ -85,9 +85,9 @@ DROP TABLE t1;
# Testing mixed tag and attribute values # Testing mixed tag and attribute values
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -118,9 +118,9 @@ DROP TABLE t1; ...@@ -118,9 +118,9 @@ DROP TABLE t1;
# Testing INSERT on mixed tag and attribute values # Testing INSERT on mixed tag and attribute values
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -205,18 +205,18 @@ DROP TABLE t1; ...@@ -205,18 +205,18 @@ DROP TABLE t1;
# Testing XPath # Testing XPath
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
isbn CHAR(15) FIELD_FORMAT='@ISBN', isbn CHAR(15) XPATH='@ISBN',
language CHAR(2) FIELD_FORMAT='@LANG', language CHAR(2) XPATH='@LANG',
subject CHAR(32) FIELD_FORMAT='@SUBJECT', subject CHAR(32) XPATH='@SUBJECT',
authorfn CHAR(20) FIELD_FORMAT='AUTHOR/FIRSTNAME', authorfn CHAR(20) XPATH='AUTHOR/FIRSTNAME',
authorln CHAR(20) FIELD_FORMAT='AUTHOR/LASTNAME', authorln CHAR(20) XPATH='AUTHOR/LASTNAME',
title CHAR(32) FIELD_FORMAT='TITLE', title CHAR(32) XPATH='TITLE',
translated CHAR(32) FIELD_FORMAT='TRANSLATOR/@PREFIX', translated CHAR(32) XPATH='TRANSLATOR/@PREFIX',
tranfn CHAR(20) FIELD_FORMAT='TRANSLATOR/FIRSTNAME', tranfn CHAR(20) XPATH='TRANSLATOR/FIRSTNAME',
tranln CHAR(20) FIELD_FORMAT='TRANSLATOR/LASTNAME', tranln CHAR(20) XPATH='TRANSLATOR/LASTNAME',
publisher CHAR(20) FIELD_FORMAT='PUBLISHER/NAME', publisher CHAR(20) XPATH='PUBLISHER/NAME',
location CHAR(20) FIELD_FORMAT='PUBLISHER/PLACE', location CHAR(20) XPATH='PUBLISHER/PLACE',
year INT(4) FIELD_FORMAT='DATEPUB' year INT(4) XPATH='DATEPUB'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -258,7 +258,7 @@ DROP TABLE t1; ...@@ -258,7 +258,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
isbn CHAR(15) FIELD_FORMAT='@isbn' isbn CHAR(15) XPATH='@isbn'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -374,7 +374,7 @@ INSERT INTO t1 VALUES (_cp1251 0xC0C1C2C3); ...@@ -374,7 +374,7 @@ INSERT INTO t1 VALUES (_cp1251 0xC0C1C2C3);
Warnings: Warnings:
Level Warning Level Warning
Code 1105 Code 1105
Message Com error: Unable to save character to 'iso-8859-1' encoding. Message Com error: Impossible d'enregistrer le caractre dans le codage iso-8859-1.
INSERT INTO t1 VALUES ('&<>"\''); INSERT INTO t1 VALUES ('&<>"\'');
SELECT node, hex(node) FROM t1; SELECT node, hex(node) FROM t1;
......
...@@ -87,9 +87,9 @@ DROP TABLE t1; ...@@ -87,9 +87,9 @@ DROP TABLE t1;
# Testing mixed tag and attribute values # Testing mixed tag and attribute values
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -120,9 +120,9 @@ DROP TABLE t1; ...@@ -120,9 +120,9 @@ DROP TABLE t1;
# Testing INSERT on mixed tag and attribute values # Testing INSERT on mixed tag and attribute values
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -207,18 +207,18 @@ DROP TABLE t1; ...@@ -207,18 +207,18 @@ DROP TABLE t1;
# Testing XPath # Testing XPath
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
isbn CHAR(15) FIELD_FORMAT='@ISBN', isbn CHAR(15) XPATH='@ISBN',
language CHAR(2) FIELD_FORMAT='@LANG', language CHAR(2) XPATH='@LANG',
subject CHAR(32) FIELD_FORMAT='@SUBJECT', subject CHAR(32) XPATH='@SUBJECT',
authorfn CHAR(20) FIELD_FORMAT='AUTHOR/FIRSTNAME', authorfn CHAR(20) XPATH='AUTHOR/FIRSTNAME',
authorln CHAR(20) FIELD_FORMAT='AUTHOR/LASTNAME', authorln CHAR(20) XPATH='AUTHOR/LASTNAME',
title CHAR(32) FIELD_FORMAT='TITLE', title CHAR(32) XPATH='TITLE',
translated CHAR(32) FIELD_FORMAT='TRANSLATOR/@PREFIX', translated CHAR(32) XPATH='TRANSLATOR/@PREFIX',
tranfn CHAR(20) FIELD_FORMAT='TRANSLATOR/FIRSTNAME', tranfn CHAR(20) XPATH='TRANSLATOR/FIRSTNAME',
tranln CHAR(20) FIELD_FORMAT='TRANSLATOR/LASTNAME', tranln CHAR(20) XPATH='TRANSLATOR/LASTNAME',
publisher CHAR(20) FIELD_FORMAT='PUBLISHER/NAME', publisher CHAR(20) XPATH='PUBLISHER/NAME',
location CHAR(20) FIELD_FORMAT='PUBLISHER/PLACE', location CHAR(20) XPATH='PUBLISHER/PLACE',
year INT(4) FIELD_FORMAT='DATEPUB' year INT(4) XPATH='DATEPUB'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=libxml2'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=libxml2';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -260,7 +260,7 @@ DROP TABLE t1; ...@@ -260,7 +260,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
isbn CHAR(15) FIELD_FORMAT='@isbn' isbn CHAR(15) XPATH='@isbn'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=libxml2'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=libxml2';
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -5,9 +5,9 @@ SET NAMES utf8; ...@@ -5,9 +5,9 @@ SET NAMES utf8;
# Testing HTML like XML file # Testing HTML like XML file
# #
CREATE TABLE beers ( CREATE TABLE beers (
`Name` CHAR(16) FIELD_FORMAT='brandName', `Name` CHAR(16) XPATH='brandName',
`Origin` CHAR(16) FIELD_FORMAT='origin', `Origin` CHAR(16) XPATH='origin',
`Description` CHAR(32) FIELD_FORMAT='details') `Description` CHAR(32) XPATH='details')
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml'
TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td';
SELECT * FROM beers; SELECT * FROM beers;
......
...@@ -5,9 +5,9 @@ SET NAMES utf8; ...@@ -5,9 +5,9 @@ SET NAMES utf8;
# Testing expanded values # Testing expanded values
# #
CREATE TABLE `bookstore` ( CREATE TABLE `bookstore` (
`category` CHAR(16) NOT NULL FIELD_FORMAT='@', `category` CHAR(16) NOT NULL XPATH='@',
`title` VARCHAR(50) NOT NULL, `title` VARCHAR(50) NOT NULL,
`lang` char(2) NOT NULL FIELD_FORMAT='title/@', `lang` char(2) NOT NULL XPATH='title/@',
`author` VARCHAR(24) NOT NULL, `author` VARCHAR(24) NOT NULL,
`year` INT(4) NOT NULL, `year` INT(4) NOT NULL,
`price` DOUBLE(8,2) NOT NULL) `price` DOUBLE(8,2) NOT NULL)
......
...@@ -4,17 +4,17 @@ Warning 1105 No file name. Table will use t1.xml ...@@ -4,17 +4,17 @@ Warning 1105 No file name. Table will use t1.xml
# Testing zipped XML tables # Testing zipped XML tables
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(13) NOT NULL FIELD_FORMAT='@', ISBN CHAR(13) NOT NULL XPATH='@',
LANG CHAR(2) NOT NULL FIELD_FORMAT='@', LANG CHAR(2) NOT NULL XPATH='@',
SUBJECT CHAR(12) NOT NULL FIELD_FORMAT='@', SUBJECT CHAR(12) NOT NULL XPATH='@',
AUTHOR_FIRSTNAME CHAR(15) NOT NULL FIELD_FORMAT='AUTHOR/FIRSTNAME', AUTHOR_FIRSTNAME CHAR(15) NOT NULL XPATH='AUTHOR/FIRSTNAME',
AUTHOR_LASTNAME CHAR(8) NOT NULL FIELD_FORMAT='AUTHOR/LASTNAME', AUTHOR_LASTNAME CHAR(8) NOT NULL XPATH='AUTHOR/LASTNAME',
TRANSLATOR_PREFIX CHAR(24) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/@PREFIX', TRANSLATOR_PREFIX CHAR(24) DEFAULT NULL XPATH='TRANSLATOR/@PREFIX',
TRANSLATOR_FIRSTNAME CHAR(6) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/FIRSTNAME', TRANSLATOR_FIRSTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/FIRSTNAME',
TRANSLATOR_LASTNAME CHAR(6) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/LASTNAME', TRANSLATOR_LASTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/LASTNAME',
TITLE CHAR(30) NOT NULL, TITLE CHAR(30) NOT NULL,
PUBLISHER_NAME CHAR(15) NOT NULL FIELD_FORMAT='PUBLISHER/NAME', PUBLISHER_NAME CHAR(15) NOT NULL XPATH='PUBLISHER/NAME',
PUBLISHER_PLACE CHAR(5) NOT NULL FIELD_FORMAT='PUBLISHER/PLACE', PUBLISHER_PLACE CHAR(5) NOT NULL XPATH='PUBLISHER/PLACE',
DATEPUB CHAR(4) NOT NULL DATEPUB CHAR(4) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES
OPTION_LIST='entry=xsample2.xml,load=xsample2.xml,rownode=BOOK,xmlsup=libxml2,expand=1,mulnode=AUTHOR'; OPTION_LIST='entry=xsample2.xml,load=xsample2.xml,rownode=BOOK,xmlsup=libxml2,expand=1,mulnode=AUTHOR';
......
...@@ -3,9 +3,9 @@ SET NAMES utf8; ...@@ -3,9 +3,9 @@ SET NAMES utf8;
# Testing HTML like XML file # Testing HTML like XML file
# #
CREATE TABLE beers ( CREATE TABLE beers (
`Name` CHAR(16) FIELD_FORMAT='brandName', `Name` CHAR(16) XPATH='brandName',
`Origin` CHAR(16) FIELD_FORMAT='origin', `Origin` CHAR(16) XPATH='origin',
`Description` CHAR(32) FIELD_FORMAT='details') `Description` CHAR(32) XPATH='details')
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml'
TABNAME='table' OPTION_LIST='xmlsup=domdoc,rownode=tr,colnode=td'; TABNAME='table' OPTION_LIST='xmlsup=domdoc,rownode=tr,colnode=td';
SELECT * FROM beers; SELECT * FROM beers;
......
...@@ -3,9 +3,9 @@ SET NAMES utf8; ...@@ -3,9 +3,9 @@ SET NAMES utf8;
# Testing expanded values # Testing expanded values
# #
CREATE TABLE `bookstore` ( CREATE TABLE `bookstore` (
`category` CHAR(16) NOT NULL FIELD_FORMAT='@', `category` CHAR(16) NOT NULL XPATH='@',
`title` VARCHAR(50) NOT NULL, `title` VARCHAR(50) NOT NULL,
`lang` char(2) NOT NULL FIELD_FORMAT='title/@', `lang` char(2) NOT NULL XPATH='title/@',
`author` VARCHAR(24) NOT NULL, `author` VARCHAR(24) NOT NULL,
`year` INT(4) NOT NULL, `year` INT(4) NOT NULL,
`price` DOUBLE(8,2) NOT NULL) `price` DOUBLE(8,2) NOT NULL)
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
# Testing zipped XML tables # Testing zipped XML tables
# #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(13) NOT NULL FIELD_FORMAT='@', ISBN CHAR(13) NOT NULL XPATH='@',
LANG CHAR(2) NOT NULL FIELD_FORMAT='@', LANG CHAR(2) NOT NULL XPATH='@',
SUBJECT CHAR(12) NOT NULL FIELD_FORMAT='@', SUBJECT CHAR(12) NOT NULL XPATH='@',
AUTHOR_FIRSTNAME CHAR(15) NOT NULL FIELD_FORMAT='AUTHOR/FIRSTNAME', AUTHOR_FIRSTNAME CHAR(15) NOT NULL XPATH='AUTHOR/FIRSTNAME',
AUTHOR_LASTNAME CHAR(8) NOT NULL FIELD_FORMAT='AUTHOR/LASTNAME', AUTHOR_LASTNAME CHAR(8) NOT NULL XPATH='AUTHOR/LASTNAME',
TRANSLATOR_PREFIX CHAR(24) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/@PREFIX', TRANSLATOR_PREFIX CHAR(24) DEFAULT NULL XPATH='TRANSLATOR/@PREFIX',
TRANSLATOR_FIRSTNAME CHAR(6) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/FIRSTNAME', TRANSLATOR_FIRSTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/FIRSTNAME',
TRANSLATOR_LASTNAME CHAR(6) DEFAULT NULL FIELD_FORMAT='TRANSLATOR/LASTNAME', TRANSLATOR_LASTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/LASTNAME',
TITLE CHAR(30) NOT NULL, TITLE CHAR(30) NOT NULL,
PUBLISHER_NAME CHAR(15) NOT NULL FIELD_FORMAT='PUBLISHER/NAME', PUBLISHER_NAME CHAR(15) NOT NULL XPATH='PUBLISHER/NAME',
PUBLISHER_PLACE CHAR(5) NOT NULL FIELD_FORMAT='PUBLISHER/PLACE', PUBLISHER_PLACE CHAR(5) NOT NULL XPATH='PUBLISHER/PLACE',
DATEPUB CHAR(4) NOT NULL DATEPUB CHAR(4) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES
OPTION_LIST='entry=xsample2.xml,load=xsample2.xml,rownode=BOOK,xmlsup=domdoc,expand=1,mulnode=AUTHOR'; OPTION_LIST='entry=xsample2.xml,load=xsample2.xml,rownode=BOOK,xmlsup=domdoc,expand=1,mulnode=AUTHOR';
......
...@@ -21,7 +21,7 @@ SELECT * FROM t2; ...@@ -21,7 +21,7 @@ SELECT * FROM t2;
--echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option. --echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
--echo # Testing field option modification --echo # Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0; ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL XPATH='@', HEADER=0;
SELECT * FROM t1; SELECT * FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t2; SELECT * FROM t2;
......
...@@ -21,7 +21,7 @@ SELECT * FROM t2; ...@@ -21,7 +21,7 @@ SELECT * FROM t2;
--echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option. --echo # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
--echo # Testing field option modification --echo # Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0; ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL XPATH='@', HEADER=0;
SELECT * FROM t1; SELECT * FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t2; SELECT * FROM t2;
......
...@@ -8,20 +8,20 @@ CREATE TABLE t2 ( ...@@ -8,20 +8,20 @@ CREATE TABLE t2 (
number int(5) not null flag=1, number int(5) not null flag=1,
message varchar(255) flag=2) message varchar(255) flag=2)
ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager,Execsrc=1'; OPTION_LIST='User=system,Password=Choupy01,Execsrc=1';
SELECT * FROM t2 WHERE command = 'drop table employee'; SELECT * FROM t2 WHERE command = 'drop table employee';
SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))'; SELECT * FROM t2 WHERE command = 'create table employee (id int not null, name varchar(32), title char(16), salary number(8,2))';
SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"; SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'Engineer', 12560.50)";
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager'; OPTION_LIST='User=system,Password=Choupy01';
SELECT * FROM t1 WHERE table_name='employee'; SELECT * FROM t1 WHERE table_name='employee';
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC TABNAME='EMPLOYEE' CATFUNC=columns
CONNECTION='jdbc:oracle:thin:@localhost:1521:xe' CONNECTION='jdbc:oracle:thin:@localhost:1521:xe'
OPTION_LIST='User=system,Password=manager'; OPTION_LIST='User=system,Password=Choupy01';
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -32,7 +32,7 @@ CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OP ...@@ -32,7 +32,7 @@ CREATE SERVER 'oracle' FOREIGN DATA WRAPPER 'oracle.jdbc.driver.OracleDriver' OP
HOST 'jdbc:oracle:thin:@localhost:1521:xe', HOST 'jdbc:oracle:thin:@localhost:1521:xe',
DATABASE 'SYSTEM', DATABASE 'SYSTEM',
USER 'system', USER 'system',
PASSWORD 'manager', PASSWORD 'Choupy01',
PORT 0, PORT 0,
SOCKET '', SOCKET '',
OWNER 'SYSTEM'); OWNER 'SYSTEM');
......
...@@ -35,15 +35,15 @@ DROP TABLE t1; ...@@ -35,15 +35,15 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
Authors INT(2) FIELD_FORMAT='$.AUTHOR[#]', Authors INT(2) JPATH='$.AUTHOR[#]',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -55,16 +55,16 @@ DROP TABLE t1; ...@@ -55,16 +55,16 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[" and "].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[" and "].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[" and "].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[" and "].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -76,16 +76,16 @@ DROP TABLE t1; ...@@ -76,16 +76,16 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15), ISBN CHAR(15),
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[*].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[*].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATION', Translation CHAR(32) JPATH='$.TRANSLATION',
Translator CHAR(80) FIELD_FORMAT='$.TRANSLATOR', Translator CHAR(80) JPATH='$.TRANSLATOR',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB' Year int(4) JPATH='$.DATEPUB'
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='biblio.json';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -122,17 +122,17 @@ DROP TABLE t1; ...@@ -122,17 +122,17 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ISBN CHAR(15) NOT NULL, ISBN CHAR(15) NOT NULL,
Language CHAR(2) FIELD_FORMAT='$.LANG', Language CHAR(2) JPATH='$.LANG',
Subject CHAR(32) FIELD_FORMAT='$.SUBJECT', Subject CHAR(32) JPATH='$.SUBJECT',
AuthorFN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].FIRSTNAME', AuthorFN CHAR(128) JPATH='$.AUTHOR[*].FIRSTNAME',
AuthorLN CHAR(128) FIELD_FORMAT='$.AUTHOR[*].LASTNAME', AuthorLN CHAR(128) JPATH='$.AUTHOR[*].LASTNAME',
Title CHAR(32) FIELD_FORMAT='$.TITLE', Title CHAR(32) JPATH='$.TITLE',
Translation CHAR(32) FIELD_FORMAT='$.TRANSLATED.PREFIX', Translation CHAR(32) JPATH='$.TRANSLATED.PREFIX',
TranslatorFN CHAR(80) FIELD_FORMAT='$.TRANSLATED.TRANSLATOR.FIRSTNAME', TranslatorFN CHAR(80) JPATH='$.TRANSLATED.TRANSLATOR.FIRSTNAME',
TranslatorLN CHAR(80) FIELD_FORMAT='$.TRANSLATED.TRANSLATOR.LASTNAME', TranslatorLN CHAR(80) JPATH='$.TRANSLATED.TRANSLATOR.LASTNAME',
Publisher CHAR(20) FIELD_FORMAT='$.PUBLISHER.NAME', Publisher CHAR(20) JPATH='$.PUBLISHER.NAME',
Location CHAR(16) FIELD_FORMAT='$.PUBLISHER.PLACE', Location CHAR(16) JPATH='$.PUBLISHER.PLACE',
Year int(4) FIELD_FORMAT='$.DATEPUB', Year int(4) JPATH='$.DATEPUB',
INDEX IX(ISBN) INDEX IX(ISBN)
) )
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='bib0.json' LRECL=320 OPTION_LIST='Pretty=0'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='bib0.json' LRECL=320 OPTION_LIST='Pretty=0';
...@@ -148,9 +148,9 @@ DROP TABLE t1; ...@@ -148,9 +148,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[*].NUMBER', WEEK INT(2) JPATH='$.WEEK[*].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[].EXPENSE["+"].WHAT', WHAT CHAR(32) JPATH='$.WEEK[].EXPENSE["+"].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[].EXPENSE[+].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[].EXPENSE[+].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -160,9 +160,9 @@ DROP TABLE t1; ...@@ -160,9 +160,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[*].NUMBER', WEEK INT(2) JPATH='$.WEEK[*].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[*].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[*].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[*].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[*].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
#--error ER_GET_ERRMSG #--error ER_GET_ERRMSG
SELECT * FROM t1; SELECT * FROM t1;
...@@ -173,14 +173,14 @@ DROP TABLE t1; ...@@ -173,14 +173,14 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12) NOT NULL, WHO CHAR(12) NOT NULL,
WEEKS CHAR(12) NOT NULL FIELD_FORMAT='$.WEEK[", "].NUMBER', WEEKS CHAR(12) NOT NULL JPATH='$.WEEK[", "].NUMBER',
SUMS CHAR(64) NOT NULL FIELD_FORMAT='$.WEEK["+"].EXPENSE[+].AMOUNT', SUMS CHAR(64) NOT NULL JPATH='$.WEEK["+"].EXPENSE[+].AMOUNT',
SUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[+].EXPENSE[+].AMOUNT', SUM DOUBLE(8,2) NOT NULL JPATH='$.WEEK[+].EXPENSE[+].AMOUNT',
AVGS CHAR(64) NOT NULL FIELD_FORMAT='$.WEEK["+"].EXPENSE[!].AMOUNT', AVGS CHAR(64) NOT NULL JPATH='$.WEEK["+"].EXPENSE[!].AMOUNT',
SUMAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[+].EXPENSE[!].AMOUNT', SUMAVG DOUBLE(8,2) NOT NULL JPATH='$.WEEK[+].EXPENSE[!].AMOUNT',
AVGSUM DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[+].AMOUNT', AVGSUM DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[+].AMOUNT',
AVGAVG DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[!].AMOUNT', AVGAVG DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[!].AMOUNT',
AVERAGE DOUBLE(8,2) NOT NULL FIELD_FORMAT='$.WEEK[!].EXPENSE[*].AMOUNT') AVERAGE DOUBLE(8,2) NOT NULL JPATH='$.WEEK[!].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -190,25 +190,25 @@ DROP TABLE t1; ...@@ -190,25 +190,25 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t2 ( CREATE TABLE t2 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[0].NUMBER', WEEK INT(2) JPATH='$.WEEK[0].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[0].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[0].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[0].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[0].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t2; SELECT * FROM t2;
CREATE TABLE t3 ( CREATE TABLE t3 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[1].NUMBER', WEEK INT(2) JPATH='$.WEEK[1].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[1].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[1].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[1].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[1].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t3; SELECT * FROM t3;
CREATE TABLE t4 ( CREATE TABLE t4 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2) FIELD_FORMAT='$.WEEK[2].NUMBER', WEEK INT(2) JPATH='$.WEEK[2].NUMBER',
WHAT CHAR(32) FIELD_FORMAT='$.WEEK[2].EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.WEEK[2].EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.WEEK[2].EXPENSE[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.WEEK[2].EXPENSE[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='expense.json';
SELECT * FROM t4; SELECT * FROM t4;
...@@ -230,24 +230,24 @@ DROP TABLE t1, t2, t3, t4; ...@@ -230,24 +230,24 @@ DROP TABLE t1, t2, t3, t4;
CREATE TABLE t2 ( CREATE TABLE t2 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp3.json';
SELECT * FROM t2; SELECT * FROM t2;
CREATE TABLE t3 ( CREATE TABLE t3 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp4.json';
SELECT * FROM t3; SELECT * FROM t3;
CREATE TABLE t4 ( CREATE TABLE t4 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp5.json';
SELECT * FROM t4; SELECT * FROM t4;
...@@ -257,8 +257,8 @@ SELECT * FROM t4; ...@@ -257,8 +257,8 @@ SELECT * FROM t4;
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp*.json' MULTIPLE=1;
SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT; SELECT * FROM t1 ORDER BY WHO, WEEK, WHAT, AMOUNT;
DROP TABLE t1; DROP TABLE t1;
...@@ -269,8 +269,8 @@ DROP TABLE t1; ...@@ -269,8 +269,8 @@ DROP TABLE t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
WHO CHAR(12), WHO CHAR(12),
WEEK INT(2), WEEK INT(2),
WHAT CHAR(32) FIELD_FORMAT='$.EXPENSE[*].WHAT', WHAT CHAR(32) JPATH='$.EXPENSE[*].WHAT',
AMOUNT DOUBLE(8,2) FIELD_FORMAT='$.EXPENSE.[*].AMOUNT') AMOUNT DOUBLE(8,2) JPATH='$.EXPENSE.[*].AMOUNT')
ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json'; ENGINE=CONNECT TABLE_TYPE=JSON FILE_NAME='mulexp%s.json';
ALTER TABLE t1 ALTER TABLE t1
PARTITION BY LIST COLUMNS(WEEK) ( PARTITION BY LIST COLUMNS(WEEK) (
......
...@@ -3,7 +3,7 @@ set connect_enable_mongo=1; ...@@ -3,7 +3,7 @@ set connect_enable_mongo=1;
--echo # --echo #
--echo # Test the MONGO table type --echo # Test the MONGO table type
--echo # --echo #
eval CREATE TABLE t1 (Document varchar(1024) field_format='*') eval CREATE TABLE t1 (Document varchar(1024) JPATH='*')
ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants $CONN ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants $CONN
OPTION_LIST='Driver=$DRV,Version=$VERS' DATA_CHARSET=utf8; OPTION_LIST='Driver=$DRV,Version=$VERS' DATA_CHARSET=utf8;
SELECT * from t1 limit 3; SELECT * from t1 limit 3;
...@@ -13,7 +13,7 @@ DROP TABLE t1; ...@@ -13,7 +13,7 @@ DROP TABLE t1;
--echo # Test catfunc --echo # Test catfunc
--echo # --echo #
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants CATFUNC=columns eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants CATFUNC=columns
OPTION_LIST='Level=1,Driver=$DRV,Version=$VERS' DATA_CHARSET=utf8 $CONN; OPTION_LIST='Depth=1,Driver=$DRV,Version=$VERS' DATA_CHARSET=utf8 $CONN;
SELECT * from t1; SELECT * from t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -36,7 +36,7 @@ DROP TABLE t1; ...@@ -36,7 +36,7 @@ DROP TABLE t1;
--echo # Test discovery --echo # Test discovery
--echo # --echo #
eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants eval CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME=restaurants
OPTION_LIST='Level=1,Driver=$DRV,Version=$VERS' $CONN DATA_CHARSET=utf8; OPTION_LIST='Depth=1,Driver=$DRV,Version=$VERS' $CONN DATA_CHARSET=utf8;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1 LIMIT 5; SELECT * FROM t1 LIMIT 5;
DROP TABLE t1; DROP TABLE t1;
...@@ -58,12 +58,12 @@ _id VARCHAR(24) NOT NULL, ...@@ -58,12 +58,12 @@ _id VARCHAR(24) NOT NULL,
name VARCHAR(64) NOT NULL, name VARCHAR(64) NOT NULL,
cuisine CHAR(200) NOT NULL, cuisine CHAR(200) NOT NULL,
borough CHAR(16) NOT NULL, borough CHAR(16) NOT NULL,
street VARCHAR(65) FIELD_FORMAT='address.street', street VARCHAR(65) JPATH='address.street',
building CHAR(16) FIELD_FORMAT='address.building', building CHAR(16) JPATH='address.building',
zipcode CHAR(5) FIELD_FORMAT='address.zipcode', zipcode CHAR(5) JPATH='address.zipcode',
grade CHAR(1) FIELD_FORMAT='grades.0.grade', grade CHAR(1) JPATH='grades.0.grade',
score INT(4) NOT NULL FIELD_FORMAT='grades.0.score', score INT(4) NOT NULL JPATH='grades.0.score',
`date` DATE FIELD_FORMAT='grades.0.date', `date` DATE JPATH='grades.0.date',
restaurant_id VARCHAR(255) NOT NULL) restaurant_id VARCHAR(255) NOT NULL)
ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME='restaurants' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME='restaurants' DATA_CHARSET=utf8
OPTION_LIST='Driver=$DRV,Version=$VERS' $CONN; OPTION_LIST='Driver=$DRV,Version=$VERS' $CONN;
...@@ -156,8 +156,8 @@ DROP TABLE t1; ...@@ -156,8 +156,8 @@ DROP TABLE t1;
eval CREATE TABLE t1 ( eval CREATE TABLE t1 (
_id char(5) NOT NULL, _id char(5) NOT NULL,
city char(16) NOT NULL, city char(16) NOT NULL,
loc_0 double(12,6) NOT NULL `FIELD_FORMAT`='loc.0', loc_0 double(12,6) NOT NULL `JPATH`='loc.0',
loc_1 char(12) NOT NULL `FIELD_FORMAT`='loc.1', loc_1 char(12) NOT NULL `JPATH`='loc.1',
pop int(11) NOT NULL, pop int(11) NOT NULL,
state char(2) NOT NULL) state char(2) NOT NULL)
ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=$TYPE TABNAME='cities' ENGINE=CONNECT CONNECTION='mongodb://localhost:27017' TABLE_TYPE=$TYPE TABNAME='cities'
...@@ -181,11 +181,11 @@ DROP TABLE t1; ...@@ -181,11 +181,11 @@ DROP TABLE t1;
eval CREATE TABLE t1 ( eval CREATE TABLE t1 (
_id int(4) NOT NULL, _id int(4) NOT NULL,
item CHAR(8) NOT NULL, item CHAR(8) NOT NULL,
prices_0 INT(6) FIELD_FORMAT='prices.0', prices_0 INT(6) JPATH='prices.0',
prices_1 INT(6) FIELD_FORMAT='prices.1', prices_1 INT(6) JPATH='prices.1',
prices_2 INT(6) FIELD_FORMAT='prices.2', prices_2 INT(6) JPATH='prices.2',
prices_3 INT(6) FIELD_FORMAT='prices.3', prices_3 INT(6) JPATH='prices.3',
prices_4 INT(6) FIELD_FORMAT='prices.4') prices_4 INT(6) JPATH='prices.4')
ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME='testcoll' DATA_CHARSET=utf8 ENGINE=CONNECT TABLE_TYPE=$TYPE TABNAME='testcoll' DATA_CHARSET=utf8
OPTION_LIST='Driver=$DRV,Version=$VERS' $CONN; OPTION_LIST='Driver=$DRV,Version=$VERS' $CONN;
INSERT INTO t1 VALUES INSERT INTO t1 VALUES
......
...@@ -78,42 +78,42 @@ SET NAMES utf8; ...@@ -78,42 +78,42 @@ SET NAMES utf8;
--echo # All tables in all schemas (filtered with WHERE) --echo # All tables in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables; CATFUNC=Tables;
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables in all schemas (filtered with WHERE) --echo # All tables in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='%.%'; CATFUNC=Tables TABNAME='%.%';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables "T1" in all schemas (filtered with WHERE) --echo # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='%.T1'; CATFUNC=Tables TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables "T1" in all schemas (filtered with WHERE) --echo # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='T1'; CATFUNC=Tables TABNAME='T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # Table "T1" in the schema "MTR" --echo # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='MTR.T1'; CATFUNC=Tables TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables in the schema "MTR" --echo # All tables in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Tables TABNAME='MTR.%'; CATFUNC=Tables TABNAME='MTR.%';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
...@@ -127,7 +127,7 @@ DROP TABLE t1; ...@@ -127,7 +127,7 @@ DROP TABLE t1;
--echo # All columns in all schemas (limited with WHERE) --echo # All columns in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns; CATFUNC=Columns;
# Disable warnings to avoid "Result limited to 20000 lines" # Disable warnings to avoid "Result limited to 20000 lines"
--disable_warnings --disable_warnings
...@@ -137,7 +137,7 @@ DROP TABLE t1; ...@@ -137,7 +137,7 @@ DROP TABLE t1;
--echo # All columns in all schemas (limited with WHERE) --echo # All columns in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='%.%'; CATFUNC=Columns TABNAME='%.%';
# Disable warnings to avoid "Result limited to 20000 lines" # Disable warnings to avoid "Result limited to 20000 lines"
--disable_warnings --disable_warnings
...@@ -146,20 +146,20 @@ SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; ...@@ -146,20 +146,20 @@ SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables "T1" in all schemas (limited with WHERE) --echo # All tables "T1" in all schemas (limited with WHERE)
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' CATFUNC=Columns TABNAME='%.T1'; CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr' CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # Table "T1" in the schema "MTR" --echo # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='MTR.T1'; CATFUNC=Columns TABNAME='MTR.T1';
SELECT * FROM t1 ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
--echo # All tables "T1" in all schemas (filtered with WHERE) --echo # All tables "T1" in all schemas (filtered with WHERE)
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
CATFUNC=Columns TABNAME='%.T1'; CATFUNC=Columns TABNAME='%.T1';
SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name; SELECT * FROM t1 WHERE Table_Schema='MTR' ORDER BY Table_Schema, Table_Name;
DROP TABLE t1; DROP TABLE t1;
...@@ -172,7 +172,7 @@ DROP TABLE t1; ...@@ -172,7 +172,7 @@ DROP TABLE t1;
--echo # Table "T1" in the default schema ("MTR") --echo # Table "T1" in the default schema ("MTR")
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='T1'; TABNAME='T1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1 ORDER BY A; SELECT * FROM t1 ORDER BY A;
...@@ -189,7 +189,7 @@ DROP TABLE t1; ...@@ -189,7 +189,7 @@ DROP TABLE t1;
--echo # Table "T1" in the schema "MTR" --echo # Table "T1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.T1'; TABNAME='MTR.T1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -197,7 +197,7 @@ DROP TABLE t1; ...@@ -197,7 +197,7 @@ DROP TABLE t1;
--echo # View "V1" in the schema "MTR" --echo # View "V1" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.V1'; TABNAME='MTR.V1';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -214,7 +214,7 @@ DROP TABLE t1; ...@@ -214,7 +214,7 @@ DROP TABLE t1;
--echo # Table "T2" in the schema "MTR" --echo # Table "T2" in the schema "MTR"
CREATE TABLE t1 ENGINE=CONNECT CREATE TABLE t1 ENGINE=CONNECT
TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=mtr' TABLE_TYPE=ODBC CONNECTION='DSN=ConnectEngineOracle;UID=mtr;PWD=newmtr'
TABNAME='MTR.T2'; TABNAME='MTR.T2';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -77,9 +77,9 @@ DROP TABLE t1; ...@@ -77,9 +77,9 @@ DROP TABLE t1;
--echo # Testing mixed tag and attribute values --echo # Testing mixed tag and attribute values
--echo # --echo #
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -98,9 +98,9 @@ DROP TABLE t1; ...@@ -98,9 +98,9 @@ DROP TABLE t1;
--copy_file $MTR_SUITE_DIR/std_data/xsample.xml $MYSQLD_DATADIR/test/xsample2.xml --copy_file $MTR_SUITE_DIR/std_data/xsample.xml $MYSQLD_DATADIR/test/xsample2.xml
--chmod 0644 $MYSQLD_DATADIR/test/xsample2.xml --chmod 0644 $MYSQLD_DATADIR/test/xsample2.xml
CREATE TABLE t1 ( CREATE TABLE t1 (
ISBN CHAR(15) FIELD_FORMAT='@', ISBN CHAR(15) XPATH='@',
LANG CHAR(2) FIELD_FORMAT='@', LANG CHAR(2) XPATH='@',
SUBJECT CHAR(32) FIELD_FORMAT='@', SUBJECT CHAR(32) XPATH='@',
AUTHOR CHAR(50), AUTHOR CHAR(50),
TITLE CHAR(32), TITLE CHAR(32),
TRANSLATOR CHAR(40), TRANSLATOR CHAR(40),
...@@ -123,18 +123,18 @@ DROP TABLE t1; ...@@ -123,18 +123,18 @@ DROP TABLE t1;
--echo # Testing XPath --echo # Testing XPath
--echo # --echo #
CREATE TABLE t1 ( CREATE TABLE t1 (
isbn CHAR(15) FIELD_FORMAT='@ISBN', isbn CHAR(15) XPATH='@ISBN',
language CHAR(2) FIELD_FORMAT='@LANG', language CHAR(2) XPATH='@LANG',
subject CHAR(32) FIELD_FORMAT='@SUBJECT', subject CHAR(32) XPATH='@SUBJECT',
authorfn CHAR(20) FIELD_FORMAT='AUTHOR/FIRSTNAME', authorfn CHAR(20) XPATH='AUTHOR/FIRSTNAME',
authorln CHAR(20) FIELD_FORMAT='AUTHOR/LASTNAME', authorln CHAR(20) XPATH='AUTHOR/LASTNAME',
title CHAR(32) FIELD_FORMAT='TITLE', title CHAR(32) XPATH='TITLE',
translated CHAR(32) FIELD_FORMAT='TRANSLATOR/@PREFIX', translated CHAR(32) XPATH='TRANSLATOR/@PREFIX',
tranfn CHAR(20) FIELD_FORMAT='TRANSLATOR/FIRSTNAME', tranfn CHAR(20) XPATH='TRANSLATOR/FIRSTNAME',
tranln CHAR(20) FIELD_FORMAT='TRANSLATOR/LASTNAME', tranln CHAR(20) XPATH='TRANSLATOR/LASTNAME',
publisher CHAR(20) FIELD_FORMAT='PUBLISHER/NAME', publisher CHAR(20) XPATH='PUBLISHER/NAME',
location CHAR(20) FIELD_FORMAT='PUBLISHER/PLACE', location CHAR(20) XPATH='PUBLISHER/PLACE',
year INT(4) FIELD_FORMAT='DATEPUB' year INT(4) XPATH='DATEPUB'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -150,8 +150,8 @@ DROP TABLE t1; ...@@ -150,8 +150,8 @@ DROP TABLE t1;
#--echo # Relative paths are not supported #--echo # Relative paths are not supported
#--echo # #--echo #
#CREATE TABLE t1 ( #CREATE TABLE t1 (
# authorfn CHAR(20) FIELD_FORMAT='//FIRSTNAME', # authorfn CHAR(20) XPATH='//FIRSTNAME',
# authorln CHAR(20) FIELD_FORMAT='//LASTNAME' # authorln CHAR(20) XPATH='//LASTNAME'
#) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' #) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
# TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1'; # TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1';
#SELECT * FROM t1; #SELECT * FROM t1;
...@@ -165,8 +165,8 @@ DROP TABLE t1; ...@@ -165,8 +165,8 @@ DROP TABLE t1;
#--echo # Absolute path is not supported #--echo # Absolute path is not supported
#--echo # #--echo #
#CREATE TABLE t1 ( #CREATE TABLE t1 (
# authorfn CHAR(20) FIELD_FORMAT='/BIBLIO/BOOK/AUTHOR/FIRSTNAME', # authorfn CHAR(20) XPATH='/BIBLIO/BOOK/AUTHOR/FIRSTNAME',
# authorln CHAR(20) FIELD_FORMAT='/BIBLIO/BOOK/AUTHOR/LASTNAME' # authorln CHAR(20) XPATH='/BIBLIO/BOOK/AUTHOR/LASTNAME'
#) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' #) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
# TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1'; # TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1';
#SELECT * FROM t1; #SELECT * FROM t1;
...@@ -178,7 +178,7 @@ DROP TABLE t1; ...@@ -178,7 +178,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
isbn CHAR(15) FIELD_FORMAT='@isbn' isbn CHAR(15) XPATH='@isbn'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml' ) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc'; TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -11,9 +11,9 @@ SET NAMES utf8; ...@@ -11,9 +11,9 @@ SET NAMES utf8;
--echo # Testing HTML like XML file --echo # Testing HTML like XML file
--echo # --echo #
CREATE TABLE beers ( CREATE TABLE beers (
`Name` CHAR(16) FIELD_FORMAT='brandName', `Name` CHAR(16) XPATH='brandName',
`Origin` CHAR(16) FIELD_FORMAT='origin', `Origin` CHAR(16) XPATH='origin',
`Description` CHAR(32) FIELD_FORMAT='details') `Description` CHAR(32) XPATH='details')
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml'
TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td';
SELECT * FROM beers; SELECT * FROM beers;
......
...@@ -15,9 +15,9 @@ SET NAMES utf8; ...@@ -15,9 +15,9 @@ SET NAMES utf8;
--echo # Testing expanded values --echo # Testing expanded values
--echo # --echo #
CREATE TABLE `bookstore` ( CREATE TABLE `bookstore` (
`category` CHAR(16) NOT NULL FIELD_FORMAT='@', `category` CHAR(16) NOT NULL XPATH='@',
`title` VARCHAR(50) NOT NULL, `title` VARCHAR(50) NOT NULL,
`lang` char(2) NOT NULL FIELD_FORMAT='title/@', `lang` char(2) NOT NULL XPATH='title/@',
`author` VARCHAR(24) NOT NULL, `author` VARCHAR(24) NOT NULL,
`year` INT(4) NOT NULL, `year` INT(4) NOT NULL,
`price` DOUBLE(8,2) NOT NULL) `price` DOUBLE(8,2) NOT NULL)
......
...@@ -11,9 +11,9 @@ SET NAMES utf8; ...@@ -11,9 +11,9 @@ SET NAMES utf8;
--echo # Testing HTML like XML file --echo # Testing HTML like XML file
--echo # --echo #
CREATE TABLE beers ( CREATE TABLE beers (
`Name` CHAR(16) FIELD_FORMAT='brandName', `Name` CHAR(16) XPATH='brandName',
`Origin` CHAR(16) FIELD_FORMAT='origin', `Origin` CHAR(16) XPATH='origin',
`Description` CHAR(32) FIELD_FORMAT='details') `Description` CHAR(32) XPATH='details')
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml'
TABNAME='table' OPTION_LIST='xmlsup=domdoc,rownode=tr,colnode=td'; TABNAME='table' OPTION_LIST='xmlsup=domdoc,rownode=tr,colnode=td';
SELECT * FROM beers; SELECT * FROM beers;
......
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