summaryrefslogtreecommitdiff
path: root/storage/connect/tabwmi.h
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2013-02-11 00:31:03 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2013-02-11 00:31:03 +0100
commitf6ca3b05f230498ede5f4d2467719d529abbb14a (patch)
tree837b0f2bc017208312a51b1b546bc693c09d5e7c /storage/connect/tabwmi.h
parentb93db097a3bca6273e2906de4cafe2a1a60ededf (diff)
downloadmariadb-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/tabwmi.h')
-rw-r--r--storage/connect/tabwmi.h79
1 files changed, 13 insertions, 66 deletions
diff --git a/storage/connect/tabwmi.h b/storage/connect/tabwmi.h
index 853f2174434..9df57e7c579 100644
--- a/storage/connect/tabwmi.h
+++ b/storage/connect/tabwmi.h
@@ -27,7 +27,7 @@ typedef struct _WMIutil {
/***********************************************************************/
/* Functions used externally. */
/***********************************************************************/
-PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *classname, PWMIUT wp);
+PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info);
/* -------------------------- WMI classes ---------------------------- */
@@ -37,10 +37,10 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *classname, PWMIUT wp);
class WMIDEF : public TABDEF { /* Logical table description */
friend class TDBWMI;
friend class TDBWCL;
+ friend class TDBWCX;
public:
// Constructor
- WMIDEF(void)
- {Pseudo = 3; Nspace = NULL; Wclass = NULL; Ems = 0; Info = false;}
+ WMIDEF(void) {Pseudo = 3; Nspace = NULL; Wclass = NULL; Ems = 0;}
// Implementation
virtual const char *GetType(void) {return "WMI";}
@@ -55,7 +55,6 @@ class WMIDEF : public TABDEF { /* Logical table description */
char *Nspace;
char *Wclass;
int Ems;
- bool Info;
}; // end of WMIDEF
/***********************************************************************/
@@ -99,13 +98,13 @@ class TDBWMI : public TDBASE {
char *Wclass; // Class name
char *ObjPath; // Used for direct access
char *Kvp; // Itou
- int Ems; // Estimated max size
+ int Ems; // Estimated max size
PCOL Kcol; // Key column
HRESULT Res;
PVBLK Vbp;
bool Init;
bool Done;
- ULONG Rc;
+ ULONG Rc;
int N; // Row number
}; // end of class TDBWMI
@@ -129,76 +128,24 @@ class WMICOL : public COLBLK {
// Members
PTDBWMI Tdbp; // Points to WMI table block
- VARIANT Prop; // Property value
- CIMTYPE Ctype; // CIM Type
+ VARIANT Prop; // Property value
+ CIMTYPE Ctype; // CIM Type
HRESULT Res;
}; // end of class WMICOL
/***********************************************************************/
-/* This is the class declaration for the WCL table. */
+/* This is the class declaration for the WMI catalog table. */
/***********************************************************************/
-class TDBWCL : public TDBASE {
- friend class WCLCOL;
+class TDBWCL : public TDBCAT {
public:
// Constructor
TDBWCL(PWMIDEF tdp);
- // Implementation
- virtual AMT GetAmType(void) {return TYPE_AM_WMI;}
-
- // 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
- bool Initialize(PGLOBAL g);
+ // Specific routines
+ virtual PQRYRES GetResult(PGLOBAL g);
// Members
- IWbemServices *Svc; // IWbemServices pointer
- IWbemClassObject *ClsObj;
- BSTR Propname;
- char *Nspace; // Namespace
- char *Wclass; // Class name
- HRESULT Res;
- bool Init;
- bool Done;
- int N; // Row number
- int Lng;
- int Typ;
- int Prec;
+ char *Nsp; // Name space
+ char *Cls; // Class
}; // end of class TDBWCL
-
-/***********************************************************************/
-/* Class WMICOL: WMI Address column. */
-/***********************************************************************/
-class WCLCOL : public COLBLK {
- friend class TDBWCL;
- public:
- // Constructors
- WCLCOL(PCOLDEF cdp, PTDB tdbp, int n);
-
- // Implementation
- virtual int GetAmType(void) {return TYPE_AM_WMI;}
-
- // Methods
- virtual void ReadColumn(PGLOBAL g);
-
- protected:
- WCLCOL(void) {} // Default constructor not to be used
-
- // Members
- PTDBWCL Tdbp; // Points to WMI table block
- HRESULT Res;
- int Flag;
- }; // end of class WCLCOL