summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2016-05-12 23:26:40 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2016-05-12 23:26:40 +0200
commit4a1ffc3853dcbb279dfe3dce313d21b9ea1eb2f5 (patch)
tree0016d21f5955b0b9247e1946229b2c6e33c9c803
parent5af076e564602559158db38a69a9cb4a09537986 (diff)
downloadmariadb-git-4a1ffc3853dcbb279dfe3dce313d21b9ea1eb2f5.tar.gz
Add forgotten changes made on 10.1
-rw-r--r--storage/connect/mycat.cc16
-rw-r--r--storage/connect/odbconn.cpp2
-rw-r--r--storage/connect/plgdbsem.h12
-rw-r--r--storage/connect/tabodbc.cpp8
4 files changed, 26 insertions, 12 deletions
diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc
index 97ad980dd6a..da8be207237 100644
--- a/storage/connect/mycat.cc
+++ b/storage/connect/mycat.cc
@@ -80,6 +80,10 @@
#define NODBC
#include "tabodbc.h"
#endif // ODBC_SUPPORT
+#if defined(JDBC_SUPPORT)
+#define NJDBC
+#include "tabjdbc.h"
+#endif // ODBC_SUPPORT
#if defined(PIVOT_SUPPORT)
#include "tabpivot.h"
#endif // PIVOT_SUPPORT
@@ -140,7 +144,10 @@ TABTYPE GetTypeID(const char *type)
#ifdef ODBC_SUPPORT
: (!stricmp(type, "ODBC")) ? TAB_ODBC
#endif
- : (!stricmp(type, "MYSQL")) ? TAB_MYSQL
+#ifdef JDBC_SUPPORT
+ : (!stricmp(type, "JDBC")) ? TAB_JDBC
+#endif
+ : (!stricmp(type, "MYSQL")) ? TAB_MYSQL
: (!stricmp(type, "MYPRX")) ? TAB_MYSQL
: (!stricmp(type, "DIR")) ? TAB_DIR
#ifdef __WIN__
@@ -301,12 +308,12 @@ int GetIndexType(TABTYPE type)
break;
case TAB_MYSQL:
case TAB_ODBC:
- xtyp= 2;
+ case TAB_JDBC:
+ xtyp= 2;
break;
case TAB_VIR:
xtyp= 3;
break;
-// case TAB_ODBC:
default:
xtyp= 0;
break;
@@ -558,6 +565,9 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am)
#if defined(ODBC_SUPPORT)
case TAB_ODBC: tdp= new(g) ODBCDEF; break;
#endif // ODBC_SUPPORT
+#if defined(JDBC_SUPPORT)
+ case TAB_JDBC: tdp= new(g)JDBCDEF; break;
+#endif // JDBC_SUPPORT
#if defined(__WIN__)
case TAB_MAC: tdp= new(g) MACDEF; break;
case TAB_WMI: tdp= new(g) WMIDEF; break;
diff --git a/storage/connect/odbconn.cpp b/storage/connect/odbconn.cpp
index 55ccbdbada1..8b2626fe962 100644
--- a/storage/connect/odbconn.cpp
+++ b/storage/connect/odbconn.cpp
@@ -1458,7 +1458,7 @@ int ODBConn::ExecDirectSQL(char *sql, ODBCCOL *tocols)
n++;
// n can be 0 for query such as Select count(*) from table
- if (n && n != (UWORD)ncol)
+ if (n && n > (UWORD)ncol)
ThrowDBX(MSG(COL_NUM_MISM));
// Now bind the column buffers
diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h
index b57d9e20ceb..910ce97f48a 100644
--- a/storage/connect/plgdbsem.h
+++ b/storage/connect/plgdbsem.h
@@ -77,7 +77,8 @@ enum TABTYPE {TAB_UNDEF = 0, /* Table of undefined type */
TAB_JSON = 23, /* JSON tables */
TAB_JCT = 24, /* Junction tables NIY */
TAB_DMY = 25, /* DMY Dummy tables NIY */
- TAB_NIY = 26}; /* Table not implemented yet */
+ TAB_JDBC = 26, /* Table accessed via JDBC */
+ TAB_NIY = 27}; /* Table not implemented yet */
enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */
TYPE_AM_ROWID = 1, /* ROWID type (special column) */
@@ -109,7 +110,9 @@ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */
TYPE_AM_DIR = 90, /* DIR access method type no */
TYPE_AM_ODBC = 100, /* ODBC access method type no */
TYPE_AM_XDBC = 101, /* XDBC access method type no */
- TYPE_AM_OEM = 110, /* OEM access method type no */
+ TYPE_AM_JDBC = 102, /* JDBC access method type no */
+ TYPE_AM_XJDC = 103, /* XJDC access method type no */
+ TYPE_AM_OEM = 110, /* OEM access method type no */
TYPE_AM_TBL = 115, /* TBL access method type no */
TYPE_AM_PIVOT = 120, /* PIVOT access method type no */
TYPE_AM_SRC = 121, /* PIVOT multiple column type no */
@@ -146,8 +149,9 @@ enum RECFM {RECFM_NAF = -2, /* Not a file */
RECFM_BIN = 2, /* Binary DOS files (also fixed) */
RECFM_VCT = 3, /* VCT formatted files */
RECFM_ODBC = 4, /* Table accessed via ODBC */
- RECFM_PLG = 5, /* Table accessed via PLGconn */
- RECFM_DBF = 6}; /* DBase formatted file */
+ RECFM_JDBC = 5, /* Table accessed via JDBC */
+ RECFM_PLG = 6, /* Table accessed via PLGconn */
+ RECFM_DBF = 7}; /* DBase formatted file */
enum MISC {DB_TABNO = 1, /* DB routines in Utility Table */
MAX_MULT_KEY = 10, /* Max multiple key number */
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index b8961789ccd..b3b6c2919c0 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -97,8 +97,8 @@ ODBCDEF::ODBCDEF(void)
{
Connect = Tabname = Tabschema = Username = Password = NULL;
Tabcat = Srcdef = Qchar = Qrystr = Sep = NULL;
- Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = 0;
- Scrollable = Memory = Xsrc = UseCnc = false;
+ Catver = Options = Cto = Qto = Quoted = Maxerr = Maxres = Memory = 0;
+ Scrollable = Xsrc = UseCnc = false;
} // end of ODBCDEF constructor
/***********************************************************************/
@@ -1009,7 +1009,7 @@ bool TDBODBC::SetRecpos(PGLOBAL g, int recpos)
} // end of SetRecpos
/***********************************************************************/
-/* Data Base indexed read routine for MYSQL access method. */
+/* Data Base indexed read routine for ODBC access method. */
/***********************************************************************/
bool TDBODBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr)
{
@@ -1028,7 +1028,7 @@ bool TDBODBC::ReadKey(PGLOBAL g, OPVAL op, const key_range *kr)
return false;
} else {
- if (To_Def->GetHandler()->MakeKeyWhere(g, Query, op, c, kr))
+ if (hc->MakeKeyWhere(g, Query, op, c, kr))
return true;
if (To_CondFil) {