mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +03:00
- Add column pattern and table type argument to catalog tables
modified: storage/connect/ha_connect.cc modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/odbccat.h modified: storage/connect/odbconn.cpp modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h modified: storage/connect/tabodbc.cpp modified: storage/connect/tabodbc.h - Avoid longjump in AllocCatInfo functions modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/odbconn.cpp - Change GetColumns error return value from 0 to -1 modified: storage/connect/JdbcInterface.class modified: storage/connect/JdbcInterface.java
This commit is contained in:
Binary file not shown.
@@ -307,7 +307,7 @@ public class JdbcInterface {
|
|||||||
} // end of GetMaxValue
|
} // end of GetMaxValue
|
||||||
|
|
||||||
public int GetColumns(String[] parms) {
|
public int GetColumns(String[] parms) {
|
||||||
int ncol = 0;
|
int ncol = -1;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (rs != null) rs.close();
|
if (rs != null) rs.close();
|
||||||
|
@@ -5508,7 +5508,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case FNC_TABLE:
|
case FNC_TABLE:
|
||||||
qrp= ODBCTables(g, dsn, shm, tab, mxr, true, sop);
|
qrp= ODBCTables(g, dsn, shm, tab, NULL, mxr, true, sop);
|
||||||
break;
|
break;
|
||||||
case FNC_DSN:
|
case FNC_DSN:
|
||||||
qrp= ODBCDataSources(g, mxr, true);
|
qrp= ODBCDataSources(g, mxr, true);
|
||||||
|
@@ -174,42 +174,20 @@ int TranslateJDBCType(int stp, int prec, int& len, char& v)
|
|||||||
static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, char *db,
|
static JCATPARM *AllocCatInfo(PGLOBAL g, JCATINFO fid, char *db,
|
||||||
char *tab, PQRYRES qrp)
|
char *tab, PQRYRES qrp)
|
||||||
{
|
{
|
||||||
//size_t m, n;
|
|
||||||
JCATPARM *cap;
|
JCATPARM *cap;
|
||||||
|
|
||||||
#if defined(_DEBUG)
|
#if defined(_DEBUG)
|
||||||
assert(qrp);
|
assert(qrp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Save stack and allocation environment and prepare error return
|
if ((cap = (JCATPARM *)PlgDBSubAlloc(g, NULL, sizeof(JCATPARM)))) {
|
||||||
if (g->jump_level == MAX_JUMP) {
|
memset(cap, 0, sizeof(JCATPARM));
|
||||||
strcpy(g->Message, MSG(TOO_MANY_JUMPS));
|
cap->Id = fid;
|
||||||
return NULL;
|
cap->Qrp = qrp;
|
||||||
} // endif jump_level
|
cap->DB = db;
|
||||||
|
cap->Tab = tab;
|
||||||
|
} // endif cap
|
||||||
|
|
||||||
if (setjmp(g->jumper[++g->jump_level]) != 0) {
|
|
||||||
printf("%s\n", g->Message);
|
|
||||||
cap = NULL;
|
|
||||||
goto fin;
|
|
||||||
} // endif rc
|
|
||||||
|
|
||||||
//m = (size_t)qrp->Maxres;
|
|
||||||
//n = (size_t)qrp->Nbcol;
|
|
||||||
cap = (JCATPARM *)PlugSubAlloc(g, NULL, sizeof(JCATPARM));
|
|
||||||
memset(cap, 0, sizeof(JCATPARM));
|
|
||||||
cap->Id = fid;
|
|
||||||
cap->Qrp = qrp;
|
|
||||||
cap->DB = (PUCHAR)db;
|
|
||||||
cap->Tab = (PUCHAR)tab;
|
|
||||||
//cap->Vlen = (SQLLEN* *)PlugSubAlloc(g, NULL, n * sizeof(SQLLEN *));
|
|
||||||
|
|
||||||
//for (i = 0; i < n; i++)
|
|
||||||
// cap->Vlen[i] = (SQLLEN *)PlugSubAlloc(g, NULL, m * sizeof(SQLLEN));
|
|
||||||
|
|
||||||
//cap->Status = (UWORD *)PlugSubAlloc(g, NULL, m * sizeof(UWORD));
|
|
||||||
|
|
||||||
fin:
|
|
||||||
g->jump_level--;
|
|
||||||
return cap;
|
return cap;
|
||||||
} // end of AllocCatInfo
|
} // end of AllocCatInfo
|
||||||
|
|
||||||
@@ -291,7 +269,8 @@ PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table, char *colpat,
|
|||||||
if (!(cap = AllocCatInfo(g, CAT_COL, db, table, qrp)))
|
if (!(cap = AllocCatInfo(g, CAT_COL, db, table, qrp)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cap->Pat = (PUCHAR)colpat;
|
// Colpat cannot be null or empty for some drivers
|
||||||
|
cap->Pat = (colpat && *colpat) ? colpat : "%";
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
/* Now get the results into blocks. */
|
/* Now get the results into blocks. */
|
||||||
@@ -402,7 +381,7 @@ PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat, char *tabtyp,
|
|||||||
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
|
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
cap->Pat = (PUCHAR)tabtyp;
|
cap->Pat = tabtyp;
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol);
|
htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol);
|
||||||
@@ -1931,9 +1910,9 @@ bool JDBConn::SetParam(JDBCCOL *colp)
|
|||||||
{
|
{
|
||||||
PGLOBAL& g = m_G;
|
PGLOBAL& g = m_G;
|
||||||
// void *buffer;
|
// void *buffer;
|
||||||
int i;
|
int i, ncol;
|
||||||
PSZ fnc = "Unknown";
|
PSZ fnc = "Unknown";
|
||||||
uint n, ncol;
|
uint n;
|
||||||
short len, tp;
|
short len, tp;
|
||||||
int crow = 0;
|
int crow = 0;
|
||||||
PQRYRES qrp = cap->Qrp;
|
PQRYRES qrp = cap->Qrp;
|
||||||
@@ -1956,9 +1935,7 @@ bool JDBConn::SetParam(JDBCCOL *colp)
|
|||||||
env->SetObjectArrayElement(parms, 0, env->NewStringUTF(name.ptr(2)));
|
env->SetObjectArrayElement(parms, 0, env->NewStringUTF(name.ptr(2)));
|
||||||
env->SetObjectArrayElement(parms, 1, env->NewStringUTF(name.ptr(1)));
|
env->SetObjectArrayElement(parms, 1, env->NewStringUTF(name.ptr(1)));
|
||||||
env->SetObjectArrayElement(parms, 2, env->NewStringUTF(name.ptr(0)));
|
env->SetObjectArrayElement(parms, 2, env->NewStringUTF(name.ptr(0)));
|
||||||
|
env->SetObjectArrayElement(parms, 3, env->NewStringUTF((const char*)cap->Pat));
|
||||||
if (cap->Pat)
|
|
||||||
env->SetObjectArrayElement(parms, 3, env->NewStringUTF((const char*)cap->Pat));
|
|
||||||
|
|
||||||
// Now do call the proper JDBC API
|
// Now do call the proper JDBC API
|
||||||
switch (cap->Id) {
|
switch (cap->Id) {
|
||||||
|
@@ -46,9 +46,9 @@ enum JCATINFO {
|
|||||||
typedef struct tagJCATPARM {
|
typedef struct tagJCATPARM {
|
||||||
JCATINFO Id; // Id to indicate function
|
JCATINFO Id; // Id to indicate function
|
||||||
PQRYRES Qrp; // Result set pointer
|
PQRYRES Qrp; // Result set pointer
|
||||||
PUCHAR DB; // Database (Schema)
|
char *DB; // Database (Schema)
|
||||||
PUCHAR Tab; // Table name or pattern
|
char *Tab; // Table name or pattern
|
||||||
PUCHAR Pat; // Table type or column pattern
|
char *Pat; // Table type or column pattern
|
||||||
} JCATPARM;
|
} JCATPARM;
|
||||||
|
|
||||||
typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *);
|
typedef jint(JNICALL *CRTJVM) (JavaVM **, void **, void *);
|
||||||
|
@@ -21,5 +21,5 @@ PQRYRES ODBCColumns(PGLOBAL g, char *dsn, char *db, char *table,
|
|||||||
char *colpat, int maxres, bool info, POPARM sop);
|
char *colpat, int maxres, bool info, POPARM sop);
|
||||||
PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop);
|
PQRYRES ODBCSrcCols(PGLOBAL g, char *dsn, char *src, POPARM sop);
|
||||||
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
||||||
int maxres, bool info, POPARM sop);
|
char *tabtyp, int maxres, bool info, POPARM sop);
|
||||||
PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info);
|
PQRYRES ODBCDrivers(PGLOBAL g, int maxres, bool info);
|
||||||
|
@@ -606,7 +606,7 @@ PQRYRES ODBCDataSources(PGLOBAL g, int maxres, bool info)
|
|||||||
/* an ODBC database that will be retrieved by GetData commands. */
|
/* an ODBC database that will be retrieved by GetData commands. */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
||||||
int maxres, bool info, POPARM sop)
|
char *tabtyp, int maxres, bool info, POPARM sop)
|
||||||
{
|
{
|
||||||
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
|
int buftyp[] = {TYPE_STRING, TYPE_STRING, TYPE_STRING,
|
||||||
TYPE_STRING, TYPE_STRING};
|
TYPE_STRING, TYPE_STRING};
|
||||||
@@ -668,7 +668,7 @@ PQRYRES ODBCTables(PGLOBAL g, char *dsn, char *db, char *tabpat,
|
|||||||
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
|
if (!(cap = AllocCatInfo(g, CAT_TAB, db, tabpat, qrp)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
//cap->Pat = (PUCHAR)tabtyp;
|
cap->Pat = (PUCHAR)tabtyp;
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol);
|
htrc("Getting table results ncol=%d\n", cap->Qrp->Nbcol);
|
||||||
|
@@ -96,7 +96,7 @@ bool ExactInfo(void);
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
JDBCDEF::JDBCDEF(void)
|
JDBCDEF::JDBCDEF(void)
|
||||||
{
|
{
|
||||||
Driver = Url = Tabname = Tabschema = Username = NULL;
|
Driver = Url = Tabname = Tabschema = Username = Colpat = NULL;
|
||||||
Password = Tabcat = Tabtype = Srcdef = Qchar = Qrystr = Sep = NULL;
|
Password = Tabcat = Tabtype = Srcdef = Qchar = Qrystr = Sep = NULL;
|
||||||
Options = Quoted = Maxerr = Maxres = Memory = 0;
|
Options = Quoted = Maxerr = Maxres = Memory = 0;
|
||||||
Scrollable = Xsrc = false;
|
Scrollable = Xsrc = false;
|
||||||
@@ -237,7 +237,13 @@ bool JDBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
|||||||
Tabcat = GetStringCatInfo(g, "Catalog", Tabcat);
|
Tabcat = GetStringCatInfo(g, "Catalog", Tabcat);
|
||||||
Tabschema = GetStringCatInfo(g, "Dbname", NULL);
|
Tabschema = GetStringCatInfo(g, "Dbname", NULL);
|
||||||
Tabschema = GetStringCatInfo(g, "Schema", Tabschema);
|
Tabschema = GetStringCatInfo(g, "Schema", Tabschema);
|
||||||
Tabtype = GetStringCatInfo(g, "Tabtype", NULL);
|
|
||||||
|
if (Catfunc == FNC_COL)
|
||||||
|
Colpat = GetStringCatInfo(g, "Colpat", NULL);
|
||||||
|
|
||||||
|
if (Catfunc == FNC_TABLE)
|
||||||
|
Tabtype = GetStringCatInfo(g, "Tabtype", NULL);
|
||||||
|
|
||||||
Qrystr = GetStringCatInfo(g, "Query_String", "?");
|
Qrystr = GetStringCatInfo(g, "Query_String", "?");
|
||||||
Sep = GetStringCatInfo(g, "Separator", NULL);
|
Sep = GetStringCatInfo(g, "Separator", NULL);
|
||||||
Xsrc = GetBoolCatInfo("Execsrc", FALSE);
|
Xsrc = GetBoolCatInfo("Execsrc", FALSE);
|
||||||
@@ -1787,12 +1793,20 @@ PQRYRES TDBJTB::GetResult(PGLOBAL g)
|
|||||||
|
|
||||||
/* --------------------------TDBJDBCL class -------------------------- */
|
/* --------------------------TDBJDBCL class -------------------------- */
|
||||||
|
|
||||||
|
/***********************************************************************/
|
||||||
|
/* TDBJDBCL class constructor. */
|
||||||
|
/***********************************************************************/
|
||||||
|
TDBJDBCL::TDBJDBCL(PJDBCDEF tdp) : TDBJTB(tdp)
|
||||||
|
{
|
||||||
|
Colpat = tdp->Colpat;
|
||||||
|
} // end of TDBJDBCL constructor
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* GetResult: Get the list of JDBC table columns. */
|
/* GetResult: Get the list of JDBC table columns. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES TDBJDBCL::GetResult(PGLOBAL g)
|
PQRYRES TDBJDBCL::GetResult(PGLOBAL g)
|
||||||
{
|
{
|
||||||
return JDBCColumns(g, Schema, Tab, NULL, Maxres, false, &Ops);
|
return JDBCColumns(g, Schema, Tab, Colpat, Maxres, false, &Ops);
|
||||||
} // end of GetResult
|
} // end of GetResult
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
@@ -26,6 +26,7 @@ class DllExport JDBCDEF : public TABDEF { /* Logical table description */
|
|||||||
friend class TDBXJDC;
|
friend class TDBXJDC;
|
||||||
friend class TDBJDRV;
|
friend class TDBJDRV;
|
||||||
friend class TDBJTB;
|
friend class TDBJTB;
|
||||||
|
friend class TDBJDBCL;
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
JDBCDEF(void);
|
JDBCDEF(void);
|
||||||
@@ -58,6 +59,7 @@ protected:
|
|||||||
PSZ Password; /* Password connect info */
|
PSZ Password; /* Password connect info */
|
||||||
PSZ Tabcat; /* External table catalog */
|
PSZ Tabcat; /* External table catalog */
|
||||||
PSZ Tabtype; /* External table type */
|
PSZ Tabtype; /* External table type */
|
||||||
|
PSZ Colpat; /* Catalog column pattern */
|
||||||
PSZ Srcdef; /* The source table SQL definition */
|
PSZ Srcdef; /* The source table SQL definition */
|
||||||
PSZ Qchar; /* Identifier quoting character */
|
PSZ Qchar; /* Identifier quoting character */
|
||||||
PSZ Qrystr; /* The original query */
|
PSZ Qrystr; /* The original query */
|
||||||
@@ -317,14 +319,15 @@ protected:
|
|||||||
class TDBJDBCL : public TDBJTB {
|
class TDBJDBCL : public TDBJTB {
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
TDBJDBCL(PJDBCDEF tdp) : TDBJTB(tdp) {}
|
TDBJDBCL(PJDBCDEF tdp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Specific routines
|
// Specific routines
|
||||||
virtual PQRYRES GetResult(PGLOBAL g);
|
virtual PQRYRES GetResult(PGLOBAL g);
|
||||||
|
|
||||||
// No additional Members
|
// Members
|
||||||
}; // end of class TDBJCL
|
char *Colpat; // Points to catalog column pattern
|
||||||
|
}; // end of class TDBJDBCL
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
/************* Tabodbc C++ Program Source Code File (.CPP) *************/
|
/************* Tabodbc C++ Program Source Code File (.CPP) *************/
|
||||||
/* PROGRAM NAME: TABODBC */
|
/* PROGRAM NAME: TABODBC */
|
||||||
/* ------------- */
|
/* ------------- */
|
||||||
/* Version 3.0 */
|
/* Version 3.1 */
|
||||||
/* */
|
/* */
|
||||||
/* COPYRIGHT: */
|
/* COPYRIGHT: */
|
||||||
/* ---------- */
|
/* ---------- */
|
||||||
@@ -96,7 +96,7 @@ bool ExactInfo(void);
|
|||||||
ODBCDEF::ODBCDEF(void)
|
ODBCDEF::ODBCDEF(void)
|
||||||
{
|
{
|
||||||
Connect = Tabname = Tabschema = Username = Password = NULL;
|
Connect = Tabname = Tabschema = Username = Password = NULL;
|
||||||
Tabcat = Srcdef = Qchar = Qrystr = Sep = NULL;
|
Tabcat = Colpat = Srcdef = Qchar = Qrystr = Sep = NULL;
|
||||||
Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = Memory = 0;
|
Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = Memory = 0;
|
||||||
Scrollable = Xsrc = UseCnc = false;
|
Scrollable = Xsrc = UseCnc = false;
|
||||||
} // end of ODBCDEF constructor
|
} // end of ODBCDEF constructor
|
||||||
@@ -120,7 +120,7 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
|||||||
Tabschema = GetStringCatInfo(g, "Schema", Tabschema);
|
Tabschema = GetStringCatInfo(g, "Schema", Tabschema);
|
||||||
Tabcat = GetStringCatInfo(g, "Qualifier", NULL);
|
Tabcat = GetStringCatInfo(g, "Qualifier", NULL);
|
||||||
Tabcat = GetStringCatInfo(g, "Catalog", Tabcat);
|
Tabcat = GetStringCatInfo(g, "Catalog", Tabcat);
|
||||||
Username = GetStringCatInfo(g, "User", NULL);
|
Username = GetStringCatInfo(g, "User", NULL);
|
||||||
Password = GetStringCatInfo(g, "Password", NULL);
|
Password = GetStringCatInfo(g, "Password", NULL);
|
||||||
|
|
||||||
if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL)))
|
if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL)))
|
||||||
@@ -141,7 +141,13 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
|
|||||||
if ((Scrollable = GetBoolCatInfo("Scrollable", false)) && !Elemt)
|
if ((Scrollable = GetBoolCatInfo("Scrollable", false)) && !Elemt)
|
||||||
Elemt = 1; // Cannot merge SQLFetch and SQLExtendedFetch
|
Elemt = 1; // Cannot merge SQLFetch and SQLExtendedFetch
|
||||||
|
|
||||||
UseCnc = GetBoolCatInfo("UseDSN", false);
|
if (Catfunc == FNC_COL)
|
||||||
|
Colpat = GetStringCatInfo(g, "Colpat", NULL);
|
||||||
|
|
||||||
|
if (Catfunc == FNC_TABLE)
|
||||||
|
Tabtyp = GetStringCatInfo(g, "Tabtype", NULL);
|
||||||
|
|
||||||
|
UseCnc = GetBoolCatInfo("UseDSN", false);
|
||||||
|
|
||||||
// Memory was Boolean, it is now integer
|
// Memory was Boolean, it is now integer
|
||||||
if (!(Memory = GetIntCatInfo("Memory", 0)))
|
if (!(Memory = GetIntCatInfo("Memory", 0)))
|
||||||
@@ -1768,6 +1774,7 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp)
|
|||||||
Dsn = tdp->GetConnect();
|
Dsn = tdp->GetConnect();
|
||||||
Schema = tdp->GetTabschema();
|
Schema = tdp->GetTabschema();
|
||||||
Tab = tdp->GetTabname();
|
Tab = tdp->GetTabname();
|
||||||
|
Tabtyp = tdp->Tabtyp;
|
||||||
Ops.User = tdp->Username;
|
Ops.User = tdp->Username;
|
||||||
Ops.Pwd = tdp->Password;
|
Ops.Pwd = tdp->Password;
|
||||||
Ops.Cto = tdp->Cto;
|
Ops.Cto = tdp->Cto;
|
||||||
@@ -1780,17 +1787,25 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp)
|
|||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES TDBOTB::GetResult(PGLOBAL g)
|
PQRYRES TDBOTB::GetResult(PGLOBAL g)
|
||||||
{
|
{
|
||||||
return ODBCTables(g, Dsn, Schema, Tab, Maxres, false, &Ops);
|
return ODBCTables(g, Dsn, Schema, Tab, Tabtyp, Maxres, false, &Ops);
|
||||||
} // end of GetResult
|
} // end of GetResult
|
||||||
|
|
||||||
/* ---------------------------TDBOCL class --------------------------- */
|
/* ---------------------------TDBOCL class --------------------------- */
|
||||||
|
|
||||||
|
/***********************************************************************/
|
||||||
|
/* TDBOCL class constructor. */
|
||||||
|
/***********************************************************************/
|
||||||
|
TDBOCL::TDBOCL(PODEF tdp) : TDBOTB(tdp)
|
||||||
|
{
|
||||||
|
Colpat = tdp->Colpat;
|
||||||
|
} // end of TDBOTB constructor
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
/* GetResult: Get the list of ODBC table columns. */
|
/* GetResult: Get the list of ODBC table columns. */
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
PQRYRES TDBOCL::GetResult(PGLOBAL g)
|
PQRYRES TDBOCL::GetResult(PGLOBAL g)
|
||||||
{
|
{
|
||||||
return ODBCColumns(g, Dsn, Schema, Tab, NULL, Maxres, false, &Ops);
|
return ODBCColumns(g, Dsn, Schema, Tab, Colpat, Maxres, false, &Ops);
|
||||||
} // end of GetResult
|
} // end of GetResult
|
||||||
|
|
||||||
/* ------------------------ End of Tabodbc --------------------------- */
|
/* ------------------------ End of Tabodbc --------------------------- */
|
||||||
|
@@ -25,7 +25,8 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */
|
|||||||
friend class TDBXDBC;
|
friend class TDBXDBC;
|
||||||
friend class TDBDRV;
|
friend class TDBDRV;
|
||||||
friend class TDBOTB;
|
friend class TDBOTB;
|
||||||
public:
|
friend class TDBOCL;
|
||||||
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
ODBCDEF(void);
|
ODBCDEF(void);
|
||||||
|
|
||||||
@@ -54,7 +55,9 @@ class DllExport ODBCDEF : public TABDEF { /* Logical table description */
|
|||||||
PSZ Username; /* User connect name */
|
PSZ Username; /* User connect name */
|
||||||
PSZ Password; /* Password connect info */
|
PSZ Password; /* Password connect info */
|
||||||
PSZ Tabcat; /* External table catalog */
|
PSZ Tabcat; /* External table catalog */
|
||||||
PSZ Srcdef; /* The source table SQL definition */
|
PSZ Tabtyp; /* Catalog table type */
|
||||||
|
PSZ Colpat; /* Catalog column pattern */
|
||||||
|
PSZ Srcdef; /* The source table SQL definition */
|
||||||
PSZ Qchar; /* Identifier quoting character */
|
PSZ Qchar; /* Identifier quoting character */
|
||||||
PSZ Qrystr; /* The original query */
|
PSZ Qrystr; /* The original query */
|
||||||
PSZ Sep; /* Decimal separator */
|
PSZ Sep; /* Decimal separator */
|
||||||
@@ -326,7 +329,8 @@ class TDBOTB : public TDBDRV {
|
|||||||
char *Dsn; // Points to connection string
|
char *Dsn; // Points to connection string
|
||||||
char *Schema; // Points to schema name or NULL
|
char *Schema; // Points to schema name or NULL
|
||||||
char *Tab; // Points to ODBC table name or pattern
|
char *Tab; // Points to ODBC table name or pattern
|
||||||
ODBCPARM Ops; // Additional parameters
|
char *Tabtyp; // Points to ODBC table type
|
||||||
|
ODBCPARM Ops; // Additional parameters
|
||||||
}; // end of class TDBOTB
|
}; // end of class TDBOTB
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -335,13 +339,14 @@ class TDBOTB : public TDBDRV {
|
|||||||
class TDBOCL : public TDBOTB {
|
class TDBOCL : public TDBOTB {
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
TDBOCL(PODEF tdp) : TDBOTB(tdp) {}
|
TDBOCL(PODEF tdp);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Specific routines
|
// Specific routines
|
||||||
virtual PQRYRES GetResult(PGLOBAL g);
|
virtual PQRYRES GetResult(PGLOBAL g);
|
||||||
|
|
||||||
// No additional Members
|
// Members
|
||||||
|
char *Colpat; // Points to column pattern
|
||||||
}; // end of class TDBOCL
|
}; // end of class TDBOCL
|
||||||
|
|
||||||
#endif // !NODBC
|
#endif // !NODBC
|
||||||
|
Reference in New Issue
Block a user