diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2013-10-26 17:14:58 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2013-10-26 17:14:58 +0200 |
commit | 0f6bcf73de25040c442cec62ddcdbe7f1d43040b (patch) | |
tree | 387c8094b935b4518cbf7257648b0ce021528651 /storage/connect/tabmysql.h | |
parent | ba3f4a2cc9ec5337f7677def0a1366cbb7332922 (diff) | |
download | mariadb-git-0f6bcf73de25040c442cec62ddcdbe7f1d43040b.tar.gz |
- Implement the "exec source" feature for table type MYSQL.
modified:
storage/connect/ha_connect.cc
storage/connect/myconn.h
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
Diffstat (limited to 'storage/connect/tabmysql.h')
-rw-r--r-- | storage/connect/tabmysql.h | 86 |
1 files changed, 85 insertions, 1 deletions
diff --git a/storage/connect/tabmysql.h b/storage/connect/tabmysql.h index 2573259ec3c..f4a234526ff 100644 --- a/storage/connect/tabmysql.h +++ b/storage/connect/tabmysql.h @@ -3,8 +3,10 @@ typedef class MYSQLDEF *PMYDEF; typedef class TDBMYSQL *PTDBMY; -typedef class MYSQLC *PMYC; typedef class MYSQLCOL *PMYCOL; +typedef class TDBMYEXC *PTDBMYX; +typedef class MYXCOL *PMYXCOL; +typedef class MYSQLC *PMYC; /* ------------------------- MYSQL classes --------------------------- */ @@ -54,6 +56,7 @@ class MYSQLDEF : public TABDEF {/* Logical table description */ bool Isview; /* TRUE if this table is a MySQL view */ bool Bind; /* Use prepared statement on insert */ bool Delayed; /* Delayed insert */ + bool Xsrc; /* Execution type */ }; // end of MYSQLDEF /***********************************************************************/ @@ -159,6 +162,87 @@ class MYSQLCOL : public COLBLK { }; // end of class MYSQLCOL /***********************************************************************/ +/* This is the class declaration for the exec command MYSQL table. */ +/***********************************************************************/ +class TDBMYEXC : public TDBMYSQL { + friend class MYXCOL; + public: + // Constructor + TDBMYEXC(PMYDEF tdp) : TDBMYSQL(tdp) {Cmdcol = NULL;} + TDBMYEXC(PGLOBAL g, PTDBMYX tdbp) : TDBMYSQL(g, tdbp) + {Cmdcol = tdbp->Cmdcol;} + + // Implementation +//virtual AMT GetAmType(void) {return TYPE_AM_MYSQL;} + virtual PTDB Duplicate(PGLOBAL g) {return (PTDB)new(g) TDBMYEXC(g, this);} + + // Methods + virtual PTDB CopyOne(PTABS t); +//virtual int GetAffectedRows(void) {return AftRows;} +//virtual int GetRecpos(void) {return N;} +//virtual int GetProgMax(PGLOBAL g); +//virtual void ResetDB(void) {N = 0;} +//virtual int RowNumber(PGLOBAL g, bool b = FALSE); + virtual bool IsView(void) {return Isview;} +//virtual PSZ GetServer(void) {return Server;} +// void SetDatabase(LPCSTR db) {Database = (char*)db;} + + // 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); + + // Specific routines +// bool SetColumnRanks(PGLOBAL g); +// PCOL MakeFieldColumn(PGLOBAL g, char *name); +// PSZ FindFieldColumn(char *name); + + protected: + // Internal functions + char *MakeCMD(PGLOBAL g); +//bool MakeSelect(PGLOBAL g); +//bool MakeInsert(PGLOBAL g); +//int BindColumns(PGLOBAL g); + + // Members + char *Cmdcol; // The name of the Xsrc command column + }; // end of class TDBMYEXC + +/***********************************************************************/ +/* Class MYXCOL: MySQL exec command table column. */ +/***********************************************************************/ +class MYXCOL : public MYSQLCOL { + friend class TDBMYEXC; + public: + // Constructors + MYXCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PSZ am = "MYSQL"); + MYXCOL(MYSQL_FIELD *fld, PTDB tdbp, int i, PSZ am = "MYSQL"); + MYXCOL(MYXCOL *colp, PTDB tdbp); // Constructor used in copy process + + // Implementation +//virtual int GetAmType(void) {return TYPE_AM_MYSQL;} +// void InitBind(PGLOBAL g); + + // Methods +//virtual bool SetBuffer(PGLOBAL g, PVAL value, bool ok, bool check); + virtual void ReadColumn(PGLOBAL g); + virtual void WriteColumn(PGLOBAL g); +// bool FindRank(PGLOBAL g); + + protected: + // Default constructor not to be used + MYXCOL(void) {} + + // Members + char *Buffer; // To get returned message + int Flag; // Column content desc + }; // end of class MYXCOL + +/***********************************************************************/ /* This is the class declaration for the MYSQL column catalog table. */ /***********************************************************************/ class TDBMCL : public TDBCAT { |