2017-07-02 22:29:31 +02:00
|
|
|
/* Copyright (C) MariaDB Corporation Ab
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; version 2 of the License.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2017-02-10 12:26:55 +01:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA */
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/**************** MYCAT H Declares Source Code File (.H) ***************/
|
|
|
|
/* Name: MYCAT.H Version 2.3 */
|
2017-07-02 22:29:31 +02:00
|
|
|
/* Author: Olivier Bertrand */
|
2013-02-07 10:34:27 +01:00
|
|
|
/* This file contains the CONNECT plugin MYCAT class definitions. */
|
|
|
|
/***********************************************************************/
|
|
|
|
#ifndef __MYCAT__H
|
|
|
|
#define __MYCAT__H
|
|
|
|
|
|
|
|
#include "block.h"
|
|
|
|
#include "catalog.h"
|
|
|
|
|
2015-05-26 01:02:33 +02:00
|
|
|
//typedef struct ha_table_option_struct TOS, *PTOS;
|
2015-04-17 20:05:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
structure for CREATE TABLE options (table options)
|
|
|
|
|
|
|
|
These can be specified in the CREATE TABLE:
|
|
|
|
CREATE TABLE ( ... ) {...here...}
|
|
|
|
*/
|
|
|
|
struct ha_table_option_struct {
|
|
|
|
const char *type;
|
|
|
|
const char *filename;
|
|
|
|
const char *optname;
|
|
|
|
const char *tabname;
|
|
|
|
const char *tablist;
|
|
|
|
const char *dbname;
|
|
|
|
const char *separator;
|
|
|
|
//const char *connect;
|
|
|
|
const char *qchar;
|
|
|
|
const char *module;
|
|
|
|
const char *subtype;
|
|
|
|
const char *catfunc;
|
|
|
|
const char *srcdef;
|
|
|
|
const char *colist;
|
2017-05-29 19:46:59 +02:00
|
|
|
const char *filter;
|
2015-04-17 20:05:41 +02:00
|
|
|
const char *oplist;
|
|
|
|
const char *data_charset;
|
|
|
|
ulonglong lrecl;
|
|
|
|
ulonglong elements;
|
|
|
|
//ulonglong estimate;
|
|
|
|
ulonglong multiple;
|
|
|
|
ulonglong header;
|
|
|
|
ulonglong quoted;
|
|
|
|
ulonglong ending;
|
|
|
|
ulonglong compressed;
|
|
|
|
bool mapped;
|
|
|
|
bool huge;
|
|
|
|
bool split;
|
|
|
|
bool readonly;
|
|
|
|
bool sepindex;
|
2016-12-14 14:20:23 +01:00
|
|
|
bool zipped;
|
2015-04-17 20:05:41 +02:00
|
|
|
};
|
|
|
|
|
2013-02-12 12:34:14 +01:00
|
|
|
// Possible value for catalog functions
|
|
|
|
#define FNC_NO (1 << 0) // Not a catalog table
|
|
|
|
#define FNC_COL (1 << 1) // Column catalog function
|
|
|
|
#define FNC_TABLE (1 << 2) // Table catalog function
|
|
|
|
#define FNC_DSN (1 << 3) // Data Source catalog function
|
|
|
|
#define FNC_DRIVER (1 << 4) // Column catalog function
|
|
|
|
#define FNC_NIY (1 << 5) // Catalog function NIY
|
|
|
|
|
|
|
|
typedef class ha_connect *PHC;
|
|
|
|
|
2015-12-04 22:38:16 +01:00
|
|
|
char *GetPluginDir(void);
|
2013-02-12 12:34:14 +01:00
|
|
|
TABTYPE GetTypeID(const char *type);
|
2013-03-07 21:38:00 +01:00
|
|
|
bool IsFileType(TABTYPE type);
|
2014-02-16 18:05:43 +01:00
|
|
|
bool IsExactType(TABTYPE type);
|
2013-03-17 11:31:11 +01:00
|
|
|
bool IsTypeNullable(TABTYPE type);
|
2013-04-03 21:54:02 +02:00
|
|
|
bool IsTypeFixed(TABTYPE type);
|
2013-12-04 23:53:30 +01:00
|
|
|
bool IsTypeIndexable(TABTYPE type);
|
2014-04-14 14:26:48 +02:00
|
|
|
int GetIndexType(TABTYPE type);
|
2013-02-12 12:34:14 +01:00
|
|
|
uint GetFuncID(const char *func);
|
2013-02-07 13:37:44 +01:00
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/***********************************************************************/
|
|
|
|
/* MYCAT: class for managing the CONNECT plugin DB items. */
|
|
|
|
/***********************************************************************/
|
|
|
|
class MYCAT : public CATALOG {
|
|
|
|
public:
|
|
|
|
MYCAT(PHC hc); // Constructor
|
|
|
|
|
|
|
|
// Implementation
|
|
|
|
PHC GetHandler(void) {return Hc;}
|
|
|
|
void SetHandler(PHC hc) {Hc= hc;}
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
void Reset(void);
|
2015-05-09 17:30:20 +02:00
|
|
|
bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary
|
2016-01-09 20:52:17 +01:00
|
|
|
PRELDEF GetTableDesc(PGLOBAL g, PTABLE tablep,
|
|
|
|
LPCSTR type, PRELDEF *prp = NULL);
|
2013-04-12 18:30:15 +02:00
|
|
|
PTDB GetTable(PGLOBAL g, PTABLE tablep,
|
|
|
|
MODE mode = MODE_READ, LPCSTR type = NULL);
|
2013-02-07 10:34:27 +01:00
|
|
|
void ClearDB(PGLOBAL g);
|
|
|
|
|
|
|
|
protected:
|
2016-01-09 20:52:17 +01:00
|
|
|
PRELDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
// Members
|
|
|
|
ha_connect *Hc; // The Connect handler
|
|
|
|
}; // end of class MYCAT
|
|
|
|
|
2013-02-07 13:37:44 +01:00
|
|
|
#endif /* __MYCAT__H */
|