summaryrefslogtreecommitdiff
path: root/storage/connect/tabodbc.cpp
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-12-16 01:32:47 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-12-16 01:32:47 +0100
commite2804d9b74099b9ae2b9f012be881d04dd78a75a (patch)
tree8e5aa2b7385605d0b82f23949b51e3119e8f262f /storage/connect/tabodbc.cpp
parentd8ac8d187d09303cb6fc0ee67216f8144ce5a053 (diff)
downloadmariadb-git-e2804d9b74099b9ae2b9f012be881d04dd78a75a.tar.gz
- Fix MDEV-5393 and MDEV-5434. It is a major update of ODBC catalog tables
processing that takes care of: - Drastically reduce the amount of storge needed to process them. - Handle longjmp's. - Makes the line limit an opion (MAXRES) - Schema can also be specified with the DBNAME option. - Issue warnings on fetch errors or when result lines have been limited. - Change some column names to reflect ODBC version 3 standard. The documentation have been updated accordingly modified: storage/connect/filamdbf.cpp storage/connect/ha_connect.cc storage/connect/myconn.cpp storage/connect/mysql-test/connect/r/odbc.result storage/connect/mysql-test/connect/r/odbc_postgresql.result storage/connect/mysql-test/connect/r/odbc_sqlite3.result storage/connect/mysql-test/connect/r/odbc_xls.result storage/connect/mysql-test/connect/r/xml.result storage/connect/mysql-test/connect/t/odbc_postgresql.test storage/connect/odbccat.h storage/connect/odbconn.cpp storage/connect/odbconn.h storage/connect/plgdbsem.h storage/connect/plgdbutl.cpp storage/connect/rcmsg.c storage/connect/tabfmt.cpp storage/connect/table.cpp storage/connect/tabodbc.cpp storage/connect/tabodbc.h storage/connect/tabutil.cpp storage/connect/tabwmi.cpp storage/connect/user_connect.cc storage/connect/valblk.cpp storage/connect/valblk.h storage/connect/value.cpp
Diffstat (limited to 'storage/connect/tabodbc.cpp')
-rw-r--r--storage/connect/tabodbc.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp
index 164049b5267..9d705d7e757 100644
--- a/storage/connect/tabodbc.cpp
+++ b/storage/connect/tabodbc.cpp
@@ -1,7 +1,7 @@
/************* Tabodbc C++ Program Source Code File (.CPP) *************/
/* PROGRAM NAME: TABODBC */
/* ------------- */
-/* Version 2.6 */
+/* Version 2.7 */
/* */
/* COPYRIGHT: */
/* ---------- */
@@ -90,8 +90,8 @@ extern int num_read, num_there, num_eq[2]; // Statistics
/***********************************************************************/
ODBCDEF::ODBCDEF(void)
{
- Connect = Tabname = Tabowner = Tabqual = Srcdef = Qrystr = NULL;
- Catver = Options = Quoted = 0;
+ Connect = Tabname = Tabowner = Tabqual = Srcdef = Qchar = Qrystr = NULL;
+ Catver = Options = Quoted = Maxerr = Maxres = 0;
Xsrc = false;
} // end of ODBCDEF constructor
@@ -104,13 +104,15 @@ bool ODBCDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff)
Tabname = Cat->GetStringCatInfo(g, "Name",
(Catfunc & (FNC_TABLE | FNC_COL)) ? NULL : Name);
Tabname = Cat->GetStringCatInfo(g, "Tabname", Tabname);
- Tabowner = Cat->GetStringCatInfo(g, "Owner", "");
- Tabqual = Cat->GetStringCatInfo(g, "Qualifier", "");
+//Tabowner = Cat->GetStringCatInfo(g, "Owner", NULL);
+ Tabowner = Cat->GetStringCatInfo(g, "Dbname", NULL);
+ Tabqual = Cat->GetStringCatInfo(g, "Qualifier", NULL);
Srcdef = Cat->GetStringCatInfo(g, "Srcdef", NULL);
Qrystr = Cat->GetStringCatInfo(g, "Query_String", "?");
Catver = Cat->GetIntCatInfo("Catver", 2);
Xsrc = Cat->GetBoolCatInfo("Execsrc", FALSE);
- Mxr = Cat->GetIntCatInfo("Maxerr", 0);
+ Maxerr = Cat->GetIntCatInfo("Maxerr", 0);
+ Maxres = Cat->GetIntCatInfo("Maxres", 0);
Quoted = Cat->GetIntCatInfo("Quoted", 0);
Options = ODBConn::noOdbcDialog;
Pseudo = 2; // FILID is Ok but not ROWID
@@ -1152,7 +1154,7 @@ TDBXDBC::TDBXDBC(PODEF tdp) : TDBODBC(tdp)
{
Cmdlist = NULL;
Cmdcol = NULL;
- Mxr = tdp->Mxr;
+ Mxr = tdp->Maxerr;
Nerr = 0;
} // end of TDBXDBC constructor
@@ -1385,24 +1387,24 @@ void XSRCCOL::WriteColumn(PGLOBAL g)
// Should never be called
} // end of WriteColumn
-/* ---------------------------TDBSRC class --------------------------- */
+/* ---------------------------TDBDRV class --------------------------- */
/***********************************************************************/
-/* GetResult: Get the list of ODBC data sources. */
+/* GetResult: Get the list of ODBC drivers. */
/***********************************************************************/
-PQRYRES TDBSRC::GetResult(PGLOBAL g)
+PQRYRES TDBDRV::GetResult(PGLOBAL g)
{
- return ODBCDataSources(g, false);
+ return ODBCDrivers(g, Maxres, false);
} // end of GetResult
-/* ---------------------------TDBDRV class --------------------------- */
+/* ---------------------------TDBSRC class --------------------------- */
/***********************************************************************/
-/* GetResult: Get the list of ODBC drivers. */
+/* GetResult: Get the list of ODBC data sources. */
/***********************************************************************/
-PQRYRES TDBDRV::GetResult(PGLOBAL g)
+PQRYRES TDBSRC::GetResult(PGLOBAL g)
{
- return ODBCDrivers(g, false);
+ return ODBCDataSources(g, Maxres, false);
} // end of GetResult
/* ---------------------------TDBOTB class --------------------------- */
@@ -1410,9 +1412,10 @@ PQRYRES TDBDRV::GetResult(PGLOBAL g)
/***********************************************************************/
/* TDBOTB class constructor. */
/***********************************************************************/
-TDBOTB::TDBOTB(PODEF tdp) : TDBCAT(tdp)
+TDBOTB::TDBOTB(PODEF tdp) : TDBDRV(tdp)
{
- Dsn = tdp->GetConnect();
+ Dsn = tdp->GetConnect();
+ Schema = tdp->GetTabowner();
Tab = tdp->GetTabname();
} // end of TDBOTB constructor
@@ -1421,7 +1424,7 @@ TDBOTB::TDBOTB(PODEF tdp) : TDBCAT(tdp)
/***********************************************************************/
PQRYRES TDBOTB::GetResult(PGLOBAL g)
{
- return ODBCTables(g, Dsn, Tab, false);
+ return ODBCTables(g, Dsn, Schema, Tab, Maxres, false);
} // end of GetResult
/* ---------------------------TDBOCL class --------------------------- */
@@ -1431,7 +1434,7 @@ PQRYRES TDBOTB::GetResult(PGLOBAL g)
/***********************************************************************/
PQRYRES TDBOCL::GetResult(PGLOBAL g)
{
- return ODBCColumns(g, Dsn, Tab, NULL, false);
+ return ODBCColumns(g, Dsn, Schema, Tab, NULL, Maxres, false);
} // end of GetResult
/* ------------------------ End of Tabodbc --------------------------- */