diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-02-11 00:31:03 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-02-11 00:31:03 +0100 |
commit | f6ca3b05f230498ede5f4d2467719d529abbb14a (patch) | |
tree | 837b0f2bc017208312a51b1b546bc693c09d5e7c /storage/connect/xtable.h | |
parent | b93db097a3bca6273e2906de4cafe2a1a60ededf (diff) | |
download | mariadb-git-f6ca3b05f230498ede5f4d2467719d529abbb14a.tar.gz |
Bug fixed: Column charset were not handled on read.
Modified: ha_connect.cc (MakeRecord)
Moved PlgAllocResult to plgdbutl.cpp
Modified:
mycat.cpp
plgdbutl.cpp
Continuing implementing the "catalog" tables (ex "info").
Already existing were the ODBC data source table and the
WMI column info table.
The common way to handle them was modified to enable each
table types to send personalized data.
Now takes care of all existing catalog functions for table
types that can retrieve and use such information.
Modified:
ha_connect.cc
odbconn.cpp
tabodbc.h
tabodbc.cpp
tabfmt.h
tabfmt.cpp
tabmysql.h
tabmysql.cpp
tabwmi.h
tabwmi.cpp
myconn.h
myconn.cpp
filamdbf.cpp
plgdbsem.h
reldef.h
reldef.cpp
tabdos.h
tabdos.cpp
tabfix.h
xtable.h
table.cpp
Diffstat (limited to 'storage/connect/xtable.h')
-rw-r--r-- | storage/connect/xtable.h | 71 |
1 files changed, 68 insertions, 3 deletions
diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h index 73af45c7e0a..6932fe7337a 100644 --- a/storage/connect/xtable.h +++ b/storage/connect/xtable.h @@ -15,9 +15,12 @@ /***********************************************************************/ #include "assert.h" #include "block.h" +#include "colblk.h" //pedef class INDEXDEF *PIXDEF; -typedef char *PFIL; // Specific to CONNECT +typedef char *PFIL; // Specific to CONNECT +typedef class TDBCAT *PTDBCAT; +typedef class CATCOL *PCATCOL; /***********************************************************************/ /* Definition of class TBX (pure virtual class for TDB and OPJOIN) */ @@ -170,8 +173,8 @@ class DllExport TDBASE : public TDB { virtual bool IsReadOnly(void) {return Read_Only;} virtual int GetProgMax(PGLOBAL g) {return GetMaxSize(g);} virtual int GetProgCur(void) {return GetRecpos();} - virtual PSZ GetFile(PGLOBAL g) {return "Not a file";} - virtual int GetRemote(void) {return 0;} + virtual PSZ GetFile(PGLOBAL g) {return "Not a file";} + virtual int GetRemote(void) {return 0;} virtual void SetFile(PGLOBAL g, PSZ fn) {} virtual void ResetDB(void) {} virtual void ResetSize(void) {MaxSize = -1;} @@ -198,4 +201,66 @@ class DllExport TDBASE : public TDB { bool Read_Only; // True for read only tables }; // end of class TDBASE +/***********************************************************************/ +/* The abstract base class declaration for the catalog tables. */ +/***********************************************************************/ +class TDBCAT : public TDBASE { + friend class CATCOL; + public: + // Constructor + TDBCAT(PTABDEF tdp); + + // Implementation + virtual AMT GetAmType(void) {return TYPE_AM_CAT;} + + // Methods + virtual int GetRecpos(void) {return N;} + virtual int GetProgCur(void) {return N;} + virtual int RowNumber(PGLOBAL g, bool b = false) {return N + 1;} + + // Database routines + virtual PCOL MakeCol(PGLOBAL g, PCOLDEF cdp, PCOL cprec, int n); + virtual int GetMaxSize(PGLOBAL g); + virtual bool OpenDB(PGLOBAL g); + virtual int ReadDB(PGLOBAL g); + virtual int WriteDB(PGLOBAL g); + virtual int DeleteDB(PGLOBAL g, int irc); + virtual void CloseDB(PGLOBAL g); + + protected: + // Specific routines + virtual PQRYRES GetResult(PGLOBAL g) = 0; + bool Initialize(PGLOBAL g); + bool InitCol(PGLOBAL g); + + // Members + PQRYRES Qrp; + int N; // Row number + bool Init; + }; // end of class TDBCAT + +/***********************************************************************/ +/* Class CATCOL: ODBC info column. */ +/***********************************************************************/ +class CATCOL : public COLBLK { + friend class TDBCAT; + public: + // Constructors + CATCOL(PCOLDEF cdp, PTDB tdbp, int n); + + // Implementation + virtual int GetAmType(void) {return TYPE_AM_ODBC;} + + // Methods + virtual void ReadColumn(PGLOBAL g); + + protected: + CATCOL(void) {} // Default constructor not to be used + + // Members + PTDBCAT Tdbp; // Points to ODBC table block + PCOLRES Crp; // The column data array + int Flag; + }; // end of class CATCOL + #endif // TABLE_DEFINED |