2014-04-19 11:11:30 +02:00
|
|
|
/* Copyright (C) Olivier Bertrand 2004 - 2014
|
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
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
/** @file ha_connect.h
|
|
|
|
|
|
|
|
@brief
|
|
|
|
The ha_connect engine is a prototype storage engine to access external data.
|
|
|
|
|
|
|
|
@see
|
|
|
|
/sql/handler.h and /storage/connect/ha_connect.cc
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
|
|
|
|
2014-10-21 17:29:51 +02:00
|
|
|
static char *strz(PGLOBAL g, LEX_STRING &ls);
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/****************************************************************************/
|
|
|
|
/* Structures used to pass info between CONNECT and ha_connect. */
|
|
|
|
/****************************************************************************/
|
|
|
|
typedef struct _create_xinfo {
|
|
|
|
char *Type; /* Retrieved from table comment */
|
2013-04-09 23:14:45 +02:00
|
|
|
char *Filename; /* Set if not standard */
|
2013-02-07 10:34:27 +01:00
|
|
|
char *IndexFN; /* Set if not standard */
|
|
|
|
ulonglong Maxrows; /* Estimated max nb of rows */
|
|
|
|
ulong Lrecl; /* Set if not default */
|
2013-04-09 23:14:45 +02:00
|
|
|
ulong Elements; /* Number of lines in blocks */
|
2013-02-07 10:34:27 +01:00
|
|
|
bool Fixed; /* False for DOS type */
|
|
|
|
void *Pcf; /* To list of columns */
|
|
|
|
void *Pxdf; /* To list of indexes */
|
|
|
|
} CRXINFO, *PCXF;
|
|
|
|
|
|
|
|
typedef struct _xinfo {
|
2013-04-09 23:14:45 +02:00
|
|
|
ulonglong data_file_length; /* Length of data file */
|
2013-02-07 10:34:27 +01:00
|
|
|
ha_rows records; /* Records in table */
|
|
|
|
ulong mean_rec_length; /* Physical record length */
|
2013-04-09 23:14:45 +02:00
|
|
|
char *data_file_name; /* Physical file name */
|
2013-02-07 10:34:27 +01:00
|
|
|
} XINFO, *PXF;
|
|
|
|
|
2013-04-09 23:14:45 +02:00
|
|
|
class XCHK : public BLOCK {
|
|
|
|
public:
|
2014-04-19 11:11:30 +02:00
|
|
|
XCHK(void) {oldsep= newsep= false;
|
2014-02-03 16:14:13 +01:00
|
|
|
oldopn= newopn= NULL;
|
|
|
|
oldpix= newpix= NULL;}
|
|
|
|
|
|
|
|
inline char *SetName(PGLOBAL g, char *name) {
|
|
|
|
char *nm= NULL;
|
|
|
|
if (name) {nm= (char*)PlugSubAlloc(g, NULL, strlen(name) + 1);
|
|
|
|
strcpy(nm, name);}
|
|
|
|
return nm;}
|
|
|
|
|
2013-04-09 23:14:45 +02:00
|
|
|
bool oldsep; // Sepindex before create/alter
|
|
|
|
bool newsep; // Sepindex after create/alter
|
2014-02-03 16:14:13 +01:00
|
|
|
char *oldopn; // Optname before create/alter
|
|
|
|
char *newopn; // Optname after create/alter
|
2013-04-09 23:14:45 +02:00
|
|
|
PIXDEF oldpix; // The indexes before create/alter
|
|
|
|
PIXDEF newpix; // The indexes after create/alter
|
|
|
|
}; // end of class XCHK
|
|
|
|
|
|
|
|
typedef class XCHK *PCHK;
|
2013-02-07 10:34:27 +01:00
|
|
|
typedef class user_connect *PCONNECT;
|
|
|
|
typedef struct ha_table_option_struct TOS, *PTOS;
|
2014-04-19 11:11:30 +02:00
|
|
|
typedef struct ha_field_option_struct FOS, *PFOS;
|
2014-04-26 00:17:26 +02:00
|
|
|
typedef struct ha_index_option_struct XOS, *PXOS;
|
2013-02-07 10:34:27 +01:00
|
|
|
|
2013-04-19 20:35:43 +02:00
|
|
|
extern handlerton *connect_hton;
|
|
|
|
|
2013-04-29 13:50:20 +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;
|
2013-05-10 20:22:21 +02:00
|
|
|
const char *srcdef;
|
|
|
|
const char *colist;
|
2013-04-29 13:50:20 +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;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
structure for CREATE TABLE options (field options)
|
|
|
|
|
|
|
|
These can be specified in the CREATE TABLE per field:
|
|
|
|
CREATE TABLE ( field ... {...here...}, ... )
|
|
|
|
*/
|
|
|
|
struct ha_field_option_struct
|
|
|
|
{
|
|
|
|
ulonglong offset;
|
2014-04-19 11:11:30 +02:00
|
|
|
ulonglong freq;
|
2013-04-29 13:50:20 +02:00
|
|
|
ulonglong fldlen;
|
2014-07-17 18:13:51 +02:00
|
|
|
uint opt;
|
2013-04-29 13:50:20 +02:00
|
|
|
const char *dateformat;
|
|
|
|
const char *fieldformat;
|
|
|
|
char *special;
|
|
|
|
};
|
|
|
|
|
2014-03-23 18:49:19 +01:00
|
|
|
/*
|
|
|
|
index options can be declared similarly
|
|
|
|
using the ha_index_option_struct structure.
|
|
|
|
|
|
|
|
Their values can be specified in the CREATE TABLE per index:
|
|
|
|
CREATE TABLE ( field ..., .., INDEX .... *here*, ... )
|
|
|
|
*/
|
2014-04-19 11:11:30 +02:00
|
|
|
struct ha_index_option_struct
|
|
|
|
{
|
2014-04-30 10:48:29 +02:00
|
|
|
bool dynamic;
|
2014-04-19 11:11:30 +02:00
|
|
|
bool mapped;
|
|
|
|
};
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/** @brief
|
|
|
|
CONNECT_SHARE is a structure that will be shared among all open handlers.
|
|
|
|
This example implements the minimum of what you will probably need.
|
|
|
|
*/
|
2013-07-23 16:29:16 +02:00
|
|
|
class CONNECT_SHARE : public Handler_share {
|
|
|
|
public:
|
2013-02-07 10:34:27 +01:00
|
|
|
mysql_mutex_t mutex;
|
|
|
|
THR_LOCK lock;
|
2013-07-23 16:29:16 +02:00
|
|
|
CONNECT_SHARE()
|
|
|
|
{
|
|
|
|
thr_lock_init(&lock);
|
|
|
|
}
|
|
|
|
~CONNECT_SHARE()
|
|
|
|
{
|
|
|
|
thr_lock_delete(&lock);
|
|
|
|
mysql_mutex_destroy(&mutex);
|
|
|
|
}
|
|
|
|
};
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
typedef class ha_connect *PHC;
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
Class definition for the storage engine
|
|
|
|
*/
|
|
|
|
class ha_connect: public handler
|
|
|
|
{
|
|
|
|
THR_LOCK_DATA lock; ///< MySQL lock
|
|
|
|
CONNECT_SHARE *share; ///< Shared lock info
|
2013-07-23 16:29:16 +02:00
|
|
|
CONNECT_SHARE *get_share();
|
2013-02-07 10:34:27 +01:00
|
|
|
|
2014-10-01 09:13:11 +02:00
|
|
|
protected:
|
|
|
|
char *PlugSubAllocStr(PGLOBAL g, void *memp, const char *str, size_t length)
|
|
|
|
{
|
2014-10-21 17:29:51 +02:00
|
|
|
char *ptr= (char*)PlgDBSubAlloc(g, memp, length + 1);
|
|
|
|
|
|
|
|
if (ptr) {
|
|
|
|
memcpy(ptr, str, length);
|
|
|
|
ptr[length]= '\0';
|
|
|
|
} // endif ptr
|
|
|
|
|
2014-10-01 09:13:11 +02:00
|
|
|
return ptr;
|
2014-10-21 17:29:51 +02:00
|
|
|
} // end of PlugSubAllocStr
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
public:
|
|
|
|
ha_connect(handlerton *hton, TABLE_SHARE *table_arg);
|
|
|
|
~ha_connect();
|
|
|
|
|
|
|
|
// CONNECT Implementation
|
|
|
|
static bool connect_init(void);
|
|
|
|
static bool connect_end(void);
|
2014-04-14 14:26:48 +02:00
|
|
|
TABTYPE GetRealType(PTOS pos= NULL);
|
This is a new version of the CONNECT storage engine. It was developed in
a sub-branch of this one and merged by pushing all the changes from it.
This version adds the following to CONNECT:
- MRR support (similar to the MyISAM one)
- Block, Remote and dynamic indexing
- Partitioning support (using the PARTITION engine)
Here is a list of the commited changes made in the sub-branch:
========================================================================
------------------------------------------------------------
revno: 4009
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Thu 2014-07-17 18:13:51 +0200
message:
This commit brings many changes, in particular two important ones:
1) Support of partitioning by connect. A table can be partitioned
by files, this is an enhanced MULTIPLE table. It can be also
partitioned by sub-tables like TBL and this enables table sharding.
2) Handling a CONNECT bug that causes in some cases extraneous rows
to remain in the table after an UPDATE or DELETE when the command
uses indexing (for not fixed file tables). Until a real fix is
done, CONNECT tries to ignore indexing and if it cannot do it
abort the command with an error message.
- Add tests on partitioning
added:
storage/connect/mysql-test/connect/r/part_file.result
storage/connect/mysql-test/connect/r/part_table.result
storage/connect/mysql-test/connect/t/part_file.test
storage/connect/mysql-test/connect/t/part_table.test
- Temporary fix
modified:
sql/sql_partition.cc
- Add partition support
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
storage/connect/reldef.h
storage/connect/tabdos.cpp
- Add functions ha_connect::IsUnique and ha_connect::CheckColumnList
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
- Prevent updating a partition table column that is part of
the partition function (outward tables only)
modified:
storage/connect/ha_connect.cc
- Support INSERT/UPDATE/DELETE for PROXY tables
modified:
storage/connect/tabutil.cpp
- Handle the bug on updating rows via indexing. Waiting for a real fix,
Don't use indexing when possible else raise an error and abort.
modified:
storage/connect/ha_connect.cc
- dbuserp->UseTemp set to TMP_AUTO
modified:
storage/connect/connect.cc
- Add members nox, abort and only
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
- Add arguments nox and abort to CntCloseTable
modified:
storage/connect/connect.cc
storage/connect/connect.h
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.cpp
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/ha_connect.cc
- Add arguments abort to CloseTableFile and RenameTempFile
modified:
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.cpp
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabvct.cpp
storage/connect/xtable.h
- Fix info->records when file does not exists
modified:
storage/connect/connect.cc
- Close XML table when opened for info
modified:
storage/connect/connect.cc
- Add function VCTFAM::GetFileLength
modified:
storage/connect/filamvct.cpp
storage/connect/filamvct.h
- Column option DISTRIB -> ENUM
modified:
storage/connect/ha_connect.cc
- Options connect, query_string and partname allways available
modified:
storage/connect/ha_connect.cc
- Add function MYSQLC::GetTableSize
modified:
storage/connect/myconn.cpp
storage/connect/myconn.h
- Add new special columns (PARTNAME, FNAME, FPATH, FTYPE and FDISK)
modified:
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/plgdbsem.h
storage/connect/table.cpp
- Add function ExtractFromPath
modified:
storage/connect/colblk.cpp
storage/connect/plgdbsem.h
storage/connect/plgdbutl.cpp
- Enhance Cardinality for some table types
modified:
storage/connect/tabdos.cpp
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
storage/connect/tabodbc.cpp
storage/connect/tabodbc.h
storage/connect/tabsys.cpp
storage/connect/tabsys.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
- Add test on special column
modified:
storage/connect/tabfmt.cpp
- Add new files (added for block indexing)
modified:
storage/connect/CMakeLists.txt
------------------------------------------------------------
revno: 4007 [merge]
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-31 12:31:26 +0200
message:
- Begin adding support of partition tables
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
- Add INSERT/UPDATE support to PROXY tables
modified:
storage/connect/tabutil.cpp
storage/connect/tabutil.h
- Take care of SPECIAL columns
modified:
storage/connect/filamdbf.cpp
storage/connect/reldef.h
storage/connect/tabfmt.cpp
-Typo and misc
modified:
storage/connect/odbconn.cpp
storage/connect/tabfix.cpp
storage/connect/xindex.cpp
------------------------------------------------------------
revno: 4006
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-10 12:21:08 +0200
message:
- FIX some MAP and XMAP errors (such as mapped indexes not closed)
Do not put version in XML files header
Remove HTON_NO_PARTITION for testing
Fix a wrong return (instead of DBUG_RETURN) in index_init
Plus a few typos
modified:
storage/connect/connect.cc
storage/connect/filter.cpp
storage/connect/ha_connect.cc
storage/connect/maputil.cpp
storage/connect/mysql-test/connect/r/alter_xml.result
storage/connect/mysql-test/connect/r/xml.result
storage/connect/table.cpp
storage/connect/tabxml.cpp
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 4005
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Fri 2014-05-02 15:55:45 +0200
message:
- Adding fetched columns to Dynamic index key (unique only)
Fix two bugs concerning added KXYCOL's:
1 - Not set during reading
2 - Val_K not set in FastFind
modified:
storage/connect/connect.cc
storage/connect/filamtxt.h
storage/connect/tabdos.cpp
storage/connect/tabfix.cpp
storage/connect/table.cpp
storage/connect/valblk.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 4003
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Wed 2014-04-30 10:48:29 +0200
message:
- Implementation of adding selected columns to dynamic indexes.
modified:
storage/connect/connect.cc
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabvct.cpp
storage/connect/tabvct.h
storage/connect/xindex.cpp
storage/connect/xindex.h
------------------------------------------------------------
revno: 4001
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-04-26 00:17:26 +0200
message:
- Implement dynamic indexing
modified:
storage/connect/connect.cc
storage/connect/filter.cpp
storage/connect/filter.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/table.cpp
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 3995
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sun 2014-03-23 18:49:19 +0100
message:
- Work in progress
modified:
storage/connect/filter.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/mysql-test/connect/r/alter.result
storage/connect/mysql-test/connect/r/xml.result
------------------------------------------------------------
revno: 3991
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Mon 2014-03-10 18:59:36 +0100
message:
- Adding files needed for block indexing
added:
storage/connect/array.cpp
storage/connect/array.h
storage/connect/blkfil.cpp
storage/connect/blkfil.h
storage/connect/filter.cpp
storage/connect/filter.h
========================================================================
This commit of the main branch adds:
- A change needed to have the engine function check_if_supported_inplace_alter
called for partition tables (was done manually in the sub-branch) by adding
the preparser define: PARTITION_SUPPORTS_INPLACE_ALTER
modified:
sql/CMakeLists.txt
- A fix concerning the FileExists function. It was needed to force the function
table_flags to return the same flags for all partitions. This is tested by
the partition engine and raises an error if flags are not equal.
The way file name, table name and connection string are retrieved has been
modified to cope with it.
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
- A few typos, such as the version string.
modified:
storage/connect/ha_connect.cc
- Updating some test result files because some warnings are no more raised.
modified:
storage/connect/mysql-test/connect/r/occur.result
storage/connect/mysql-test/connect/r/part_file.result
storage/connect/mysql-test/connect/r/pivot.result
2014-07-20 12:31:42 +02:00
|
|
|
char *GetRealString(const char *s);
|
2013-02-07 10:34:27 +01:00
|
|
|
char *GetStringOption(char *opname, char *sdef= NULL);
|
2014-04-22 19:15:08 +02:00
|
|
|
PTOS GetTableOptionStruct(TABLE_SHARE *s= NULL);
|
2013-02-07 10:34:27 +01:00
|
|
|
bool GetBooleanOption(char *opname, bool bdef);
|
2013-04-09 23:14:45 +02:00
|
|
|
bool SetBooleanOption(char *opname, bool b);
|
2013-02-07 10:34:27 +01:00
|
|
|
int GetIntegerOption(char *opname);
|
2014-04-30 10:48:29 +02:00
|
|
|
bool GetIndexOption(KEY *kp, char *opname);
|
2014-02-07 22:44:43 +01:00
|
|
|
bool CheckString(const char *str1, const char *str2);
|
|
|
|
bool SameString(TABLE *tab, char *opn);
|
2013-02-07 10:34:27 +01:00
|
|
|
bool SetIntegerOption(char *opname, int n);
|
2014-02-03 16:14:13 +01:00
|
|
|
bool SameInt(TABLE *tab, char *opn);
|
|
|
|
bool SameBool(TABLE *tab, char *opn);
|
This is a new version of the CONNECT storage engine. It was developed in
a sub-branch of this one and merged by pushing all the changes from it.
This version adds the following to CONNECT:
- MRR support (similar to the MyISAM one)
- Block, Remote and dynamic indexing
- Partitioning support (using the PARTITION engine)
Here is a list of the commited changes made in the sub-branch:
========================================================================
------------------------------------------------------------
revno: 4009
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Thu 2014-07-17 18:13:51 +0200
message:
This commit brings many changes, in particular two important ones:
1) Support of partitioning by connect. A table can be partitioned
by files, this is an enhanced MULTIPLE table. It can be also
partitioned by sub-tables like TBL and this enables table sharding.
2) Handling a CONNECT bug that causes in some cases extraneous rows
to remain in the table after an UPDATE or DELETE when the command
uses indexing (for not fixed file tables). Until a real fix is
done, CONNECT tries to ignore indexing and if it cannot do it
abort the command with an error message.
- Add tests on partitioning
added:
storage/connect/mysql-test/connect/r/part_file.result
storage/connect/mysql-test/connect/r/part_table.result
storage/connect/mysql-test/connect/t/part_file.test
storage/connect/mysql-test/connect/t/part_table.test
- Temporary fix
modified:
sql/sql_partition.cc
- Add partition support
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
storage/connect/reldef.h
storage/connect/tabdos.cpp
- Add functions ha_connect::IsUnique and ha_connect::CheckColumnList
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
- Prevent updating a partition table column that is part of
the partition function (outward tables only)
modified:
storage/connect/ha_connect.cc
- Support INSERT/UPDATE/DELETE for PROXY tables
modified:
storage/connect/tabutil.cpp
- Handle the bug on updating rows via indexing. Waiting for a real fix,
Don't use indexing when possible else raise an error and abort.
modified:
storage/connect/ha_connect.cc
- dbuserp->UseTemp set to TMP_AUTO
modified:
storage/connect/connect.cc
- Add members nox, abort and only
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
- Add arguments nox and abort to CntCloseTable
modified:
storage/connect/connect.cc
storage/connect/connect.h
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.cpp
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/ha_connect.cc
- Add arguments abort to CloseTableFile and RenameTempFile
modified:
storage/connect/filamap.cpp
storage/connect/filamap.h
storage/connect/filamdbf.cpp
storage/connect/filamdbf.h
storage/connect/filamfix.cpp
storage/connect/filamfix.h
storage/connect/filamtxt.cpp
storage/connect/filamtxt.h
storage/connect/filamvct.cpp
storage/connect/filamvct.h
storage/connect/filamzip.cpp
storage/connect/filamzip.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabvct.cpp
storage/connect/xtable.h
- Fix info->records when file does not exists
modified:
storage/connect/connect.cc
- Close XML table when opened for info
modified:
storage/connect/connect.cc
- Add function VCTFAM::GetFileLength
modified:
storage/connect/filamvct.cpp
storage/connect/filamvct.h
- Column option DISTRIB -> ENUM
modified:
storage/connect/ha_connect.cc
- Options connect, query_string and partname allways available
modified:
storage/connect/ha_connect.cc
- Add function MYSQLC::GetTableSize
modified:
storage/connect/myconn.cpp
storage/connect/myconn.h
- Add new special columns (PARTNAME, FNAME, FPATH, FTYPE and FDISK)
modified:
storage/connect/colblk.cpp
storage/connect/colblk.h
storage/connect/plgdbsem.h
storage/connect/table.cpp
- Add function ExtractFromPath
modified:
storage/connect/colblk.cpp
storage/connect/plgdbsem.h
storage/connect/plgdbutl.cpp
- Enhance Cardinality for some table types
modified:
storage/connect/tabdos.cpp
storage/connect/tabmysql.cpp
storage/connect/tabmysql.h
storage/connect/tabodbc.cpp
storage/connect/tabodbc.h
storage/connect/tabsys.cpp
storage/connect/tabsys.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
- Add test on special column
modified:
storage/connect/tabfmt.cpp
- Add new files (added for block indexing)
modified:
storage/connect/CMakeLists.txt
------------------------------------------------------------
revno: 4007 [merge]
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-31 12:31:26 +0200
message:
- Begin adding support of partition tables
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
- Add INSERT/UPDATE support to PROXY tables
modified:
storage/connect/tabutil.cpp
storage/connect/tabutil.h
- Take care of SPECIAL columns
modified:
storage/connect/filamdbf.cpp
storage/connect/reldef.h
storage/connect/tabfmt.cpp
-Typo and misc
modified:
storage/connect/odbconn.cpp
storage/connect/tabfix.cpp
storage/connect/xindex.cpp
------------------------------------------------------------
revno: 4006
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-05-10 12:21:08 +0200
message:
- FIX some MAP and XMAP errors (such as mapped indexes not closed)
Do not put version in XML files header
Remove HTON_NO_PARTITION for testing
Fix a wrong return (instead of DBUG_RETURN) in index_init
Plus a few typos
modified:
storage/connect/connect.cc
storage/connect/filter.cpp
storage/connect/ha_connect.cc
storage/connect/maputil.cpp
storage/connect/mysql-test/connect/r/alter_xml.result
storage/connect/mysql-test/connect/r/xml.result
storage/connect/table.cpp
storage/connect/tabxml.cpp
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 4005
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Fri 2014-05-02 15:55:45 +0200
message:
- Adding fetched columns to Dynamic index key (unique only)
Fix two bugs concerning added KXYCOL's:
1 - Not set during reading
2 - Val_K not set in FastFind
modified:
storage/connect/connect.cc
storage/connect/filamtxt.h
storage/connect/tabdos.cpp
storage/connect/tabfix.cpp
storage/connect/table.cpp
storage/connect/valblk.h
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 4003
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Wed 2014-04-30 10:48:29 +0200
message:
- Implementation of adding selected columns to dynamic indexes.
modified:
storage/connect/connect.cc
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/tabvct.cpp
storage/connect/tabvct.h
storage/connect/xindex.cpp
storage/connect/xindex.h
------------------------------------------------------------
revno: 4001
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sat 2014-04-26 00:17:26 +0200
message:
- Implement dynamic indexing
modified:
storage/connect/connect.cc
storage/connect/filter.cpp
storage/connect/filter.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/tabdos.cpp
storage/connect/tabdos.h
storage/connect/table.cpp
storage/connect/xindex.cpp
storage/connect/xindex.h
storage/connect/xtable.h
------------------------------------------------------------
revno: 3995
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Sun 2014-03-23 18:49:19 +0100
message:
- Work in progress
modified:
storage/connect/filter.h
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/mysql-test/connect/r/alter.result
storage/connect/mysql-test/connect/r/xml.result
------------------------------------------------------------
revno: 3991
committer: Olivier Bertrand <bertrandop@gmail.com>
branch nick: 10.0-connect
timestamp: Mon 2014-03-10 18:59:36 +0100
message:
- Adding files needed for block indexing
added:
storage/connect/array.cpp
storage/connect/array.h
storage/connect/blkfil.cpp
storage/connect/blkfil.h
storage/connect/filter.cpp
storage/connect/filter.h
========================================================================
This commit of the main branch adds:
- A change needed to have the engine function check_if_supported_inplace_alter
called for partition tables (was done manually in the sub-branch) by adding
the preparser define: PARTITION_SUPPORTS_INPLACE_ALTER
modified:
sql/CMakeLists.txt
- A fix concerning the FileExists function. It was needed to force the function
table_flags to return the same flags for all partitions. This is tested by
the partition engine and raises an error if flags are not equal.
The way file name, table name and connection string are retrieved has been
modified to cope with it.
modified:
storage/connect/ha_connect.cc
storage/connect/ha_connect.h
storage/connect/reldef.cpp
- A few typos, such as the version string.
modified:
storage/connect/ha_connect.cc
- Updating some test result files because some warnings are no more raised.
modified:
storage/connect/mysql-test/connect/r/occur.result
storage/connect/mysql-test/connect/r/part_file.result
storage/connect/mysql-test/connect/r/pivot.result
2014-07-20 12:31:42 +02:00
|
|
|
bool FileExists(const char *fn, bool bf);
|
2014-02-07 22:44:43 +01:00
|
|
|
bool NoFieldOptionChange(TABLE *tab);
|
2013-02-07 10:34:27 +01:00
|
|
|
PFOS GetFieldOptionStruct(Field *fp);
|
2013-07-05 13:13:45 +02:00
|
|
|
void *GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf);
|
2014-04-26 00:17:26 +02:00
|
|
|
PXOS GetIndexOptionStruct(KEY *kp);
|
2014-02-03 16:14:13 +01:00
|
|
|
PIXDEF GetIndexInfo(TABLE_SHARE *s= NULL);
|
2014-10-31 12:28:07 +01:00
|
|
|
bool CheckVirtualIndex(TABLE_SHARE *s);
|
2013-02-07 10:34:27 +01:00
|
|
|
const char *GetDBName(const char *name);
|
|
|
|
const char *GetTableName(void);
|
2014-05-31 12:31:26 +02:00
|
|
|
char *GetPartName(void);
|
2013-08-09 18:02:47 +02:00
|
|
|
//int GetColNameLen(Field *fp);
|
|
|
|
//char *GetColName(Field *fp);
|
|
|
|
//void AddColName(char *cp, Field *fp);
|
2013-04-10 14:24:28 +02:00
|
|
|
TABLE *GetTable(void) {return table;}
|
|
|
|
bool IsSameIndex(PIXDEF xp1, PIXDEF xp2);
|
2014-05-31 12:31:26 +02:00
|
|
|
bool IsPartitioned(void);
|
2014-07-17 18:13:51 +02:00
|
|
|
bool IsUnique(uint n);
|
2014-08-23 19:17:15 +02:00
|
|
|
char *GetDataPath(void) {return (char*)datapath;}
|
2013-02-07 10:34:27 +01:00
|
|
|
|
2014-08-23 19:17:15 +02:00
|
|
|
void SetDataPath(PGLOBAL g, const char *path);
|
2013-02-07 10:34:27 +01:00
|
|
|
PTDB GetTDB(PGLOBAL g);
|
2013-11-11 13:00:39 +01:00
|
|
|
int OpenTable(PGLOBAL g, bool del= false);
|
2014-07-17 18:13:51 +02:00
|
|
|
bool CheckColumnList(PGLOBAL g);
|
2014-04-19 11:11:30 +02:00
|
|
|
bool IsOpened(void);
|
2013-02-07 10:34:27 +01:00
|
|
|
int CloseTable(PGLOBAL g);
|
|
|
|
int MakeRecord(char *buf);
|
|
|
|
int ScanRecord(PGLOBAL g, uchar *buf);
|
|
|
|
int CheckRecord(PGLOBAL g, const uchar *oldbuf, uchar *newbuf);
|
|
|
|
int ReadIndexed(uchar *buf, OPVAL op, const uchar* key= NULL,
|
|
|
|
uint key_len= 0);
|
2014-04-19 17:02:53 +02:00
|
|
|
bool MakeKeyWhere(PGLOBAL g, char *qry, OPVAL op, char *q,
|
|
|
|
const void *key, int klen);
|
2014-10-21 17:29:51 +02:00
|
|
|
inline char *Strz(LEX_STRING &ls);
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/** @brief
|
|
|
|
The name that will be used for display purposes.
|
|
|
|
*/
|
|
|
|
const char *table_type() const {return "CONNECT";}
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
The name of the index type that will be used for display.
|
|
|
|
Don't implement this method unless you really have indexes.
|
|
|
|
*/
|
2014-04-22 19:15:08 +02:00
|
|
|
const char *index_type(uint inx);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/** @brief
|
|
|
|
The file extensions.
|
|
|
|
*/
|
|
|
|
const char **bas_ext() const;
|
|
|
|
|
2014-02-03 16:14:13 +01:00
|
|
|
/**
|
|
|
|
Check if a storage engine supports a particular alter table in-place
|
|
|
|
@note Called without holding thr_lock.c lock.
|
|
|
|
*/
|
|
|
|
virtual enum_alter_inplace_result
|
|
|
|
check_if_supported_inplace_alter(TABLE *altered_table,
|
|
|
|
Alter_inplace_info *ha_alter_info);
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/** @brief
|
|
|
|
This is a list of flags that indicate what functionality the storage engine
|
|
|
|
implements. The current table flags are documented in handler.h
|
|
|
|
*/
|
2014-02-03 16:14:13 +01:00
|
|
|
ulonglong table_flags() const;
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/** @brief
|
|
|
|
This is a bitmap of flags that indicates how the storage engine
|
|
|
|
implements indexes. The current index flags are documented in
|
|
|
|
handler.h. If you do not implement indexes, just return zero here.
|
|
|
|
|
|
|
|
@details
|
|
|
|
part is the key part to check. First key part is 0.
|
|
|
|
If all_parts is set, MySQL wants to know the flags for the combined
|
|
|
|
index, up to and including 'part'.
|
|
|
|
*/
|
2014-04-22 19:15:08 +02:00
|
|
|
ulong index_flags(uint inx, uint part, bool all_parts) const;
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/** @brief
|
|
|
|
unireg.cc will call max_supported_record_length(), max_supported_keys(),
|
|
|
|
max_supported_key_parts(), uint max_supported_key_length()
|
|
|
|
to make sure that the storage engine can handle the data it is about to
|
|
|
|
send. Return *real* limits of your storage engine here; MySQL will do
|
|
|
|
min(your_limits, MySQL_limits) automatically.
|
|
|
|
*/
|
|
|
|
uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
unireg.cc will call this to make sure that the storage engine can handle
|
|
|
|
the data it is about to send. Return *real* limits of your storage engine
|
|
|
|
here; MySQL will do min(your_limits, MySQL_limits) automatically.
|
|
|
|
|
|
|
|
@details
|
|
|
|
There is no need to implement ..._key_... methods if your engine doesn't
|
|
|
|
support indexes.
|
|
|
|
*/
|
|
|
|
uint max_supported_keys() const { return 10; }
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
unireg.cc will call this to make sure that the storage engine can handle
|
|
|
|
the data it is about to send. Return *real* limits of your storage engine
|
|
|
|
here; MySQL will do min(your_limits, MySQL_limits) automatically.
|
|
|
|
|
|
|
|
@details
|
|
|
|
There is no need to implement ..._key_... methods if your engine doesn't
|
|
|
|
support indexes.
|
|
|
|
*/
|
|
|
|
uint max_supported_key_parts() const { return 10; }
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
unireg.cc will call this to make sure that the storage engine can handle
|
|
|
|
the data it is about to send. Return *real* limits of your storage engine
|
|
|
|
here; MySQL will do min(your_limits, MySQL_limits) automatically.
|
|
|
|
|
|
|
|
@details
|
|
|
|
There is no need to implement ..._key_... methods if your engine doesn't
|
|
|
|
support indexes.
|
|
|
|
*/
|
|
|
|
uint max_supported_key_length() const { return 255; }
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
Called in test_quick_select to determine if indexes should be used.
|
|
|
|
*/
|
|
|
|
virtual double scan_time() { return (double) (stats.records+stats.deleted) / 20.0+10; }
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
This method will never be called if you do not implement indexes.
|
|
|
|
*/
|
|
|
|
virtual double read_time(uint, uint, ha_rows rows)
|
|
|
|
{ return (double) rows / 20.0+1; }
|
|
|
|
|
|
|
|
/*
|
|
|
|
Everything below are methods that we implement in ha_connect.cc.
|
|
|
|
|
|
|
|
Most of these methods are not obligatory, skip them and
|
|
|
|
MySQL will treat them as not implemented
|
|
|
|
*/
|
|
|
|
virtual bool get_error_message(int error, String *buf);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Push condition down to the table handler.
|
|
|
|
|
|
|
|
@param cond Condition to be pushed. The condition tree must not be
|
|
|
|
modified by the by the caller.
|
|
|
|
|
|
|
|
@return
|
|
|
|
The 'remainder' condition that caller must use to filter out records.
|
|
|
|
NULL means the handler will not return rows that do not match the
|
|
|
|
passed condition.
|
|
|
|
|
|
|
|
@note
|
|
|
|
The pushed conditions form a stack (from which one can remove the
|
|
|
|
last pushed condition using cond_pop).
|
2014-04-19 11:11:30 +02:00
|
|
|
The table handler filters out rows using (pushed_cond1 AND pushed_cond2
|
2013-02-07 10:34:27 +01:00
|
|
|
AND ... AND pushed_condN)
|
|
|
|
or less restrictive condition, depending on handler's capabilities.
|
|
|
|
|
|
|
|
handler->ha_reset() call empties the condition stack.
|
|
|
|
Calls to rnd_init/rnd_end, index_init/index_end etc do not affect the
|
|
|
|
condition stack.
|
2014-04-19 11:11:30 +02:00
|
|
|
*/
|
2013-02-07 10:34:27 +01:00
|
|
|
virtual const COND *cond_push(const COND *cond);
|
2014-03-10 18:29:04 +01:00
|
|
|
PCFIL CheckCond(PGLOBAL g, PCFIL filp, AMT tty, Item *cond);
|
2013-02-07 13:37:44 +01:00
|
|
|
const char *GetValStr(OPVAL vop, bool neg);
|
2014-04-19 11:11:30 +02:00
|
|
|
PFIL CondFilter(PGLOBAL g, Item *cond);
|
2014-04-30 10:48:29 +02:00
|
|
|
//PFIL CheckFilter(PGLOBAL g);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
Number of rows in table. It will only be called if
|
|
|
|
(table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
|
|
|
|
*/
|
|
|
|
virtual ha_rows records();
|
|
|
|
|
2014-04-19 11:11:30 +02:00
|
|
|
/**
|
2013-07-12 11:25:01 +02:00
|
|
|
Type of table for caching query
|
|
|
|
CONNECT should not use caching because its tables are external
|
|
|
|
data prone to me modified out of MariaDB
|
|
|
|
*/
|
|
|
|
virtual uint8 table_cache_type(void)
|
|
|
|
{
|
|
|
|
#if defined(MEMORY_TRACE)
|
|
|
|
// Temporary until bug MDEV-4771 is fixed
|
|
|
|
return HA_CACHE_TBL_NONTRANSACT;
|
|
|
|
#else
|
|
|
|
return HA_CACHE_TBL_NOCACHE;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc; it's a required method.
|
|
|
|
*/
|
|
|
|
int open(const char *name, int mode, uint test_if_locked); // required
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc; it's a required method.
|
|
|
|
*/
|
|
|
|
int close(void); // required
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
int write_row(uchar *buf);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
int update_row(const uchar *old_data, uchar *new_data);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
int delete_row(const uchar *buf);
|
|
|
|
|
|
|
|
// Added to the connect handler
|
|
|
|
int index_init(uint idx, bool sorted);
|
|
|
|
int index_end();
|
|
|
|
int index_read(uchar * buf, const uchar * key, uint key_len,
|
|
|
|
enum ha_rkey_function find_flag);
|
|
|
|
int index_next_same(uchar *buf, const uchar *key, uint keylen);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
//int index_read_map(uchar *buf, const uchar *key,
|
|
|
|
// key_part_map keypart_map, enum ha_rkey_function find_flag);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
int index_next(uchar *buf);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
2014-04-08 11:15:08 +02:00
|
|
|
int index_prev(uchar *buf);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
|
|
|
int index_first(uchar *buf);
|
|
|
|
|
|
|
|
/** @brief
|
|
|
|
We implement this in ha_connect.cc. It's not an obligatory method;
|
|
|
|
skip it and and MySQL will treat it as not implemented.
|
|
|
|
*/
|
2014-04-01 18:14:57 +02:00
|
|
|
int index_last(uchar *buf);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
2014-03-10 18:29:04 +01:00
|
|
|
/* Index condition pushdown implementation */
|
|
|
|
//Item *idx_cond_push(uint keyno, Item* idx_cond);
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
/** @brief
|
|
|
|
Unlike index_init(), rnd_init() can be called two consecutive times
|
|
|
|
without rnd_end() in between (it only makes sense if scan=1). In this
|
|
|
|
case, the second call should prepare for the new table scan (e.g if
|
|
|
|
rnd_init() allocates the cursor, the second call should position the
|
|
|
|
cursor to the start of the table; no need to deallocate and allocate
|
|
|
|
it again. This is a required method.
|
|
|
|
*/
|
|
|
|
int rnd_init(bool scan); //required
|
|
|
|
int rnd_end();
|
|
|
|
int rnd_next(uchar *buf); ///< required
|
|
|
|
int rnd_pos(uchar *buf, uchar *pos); ///< required
|
|
|
|
void position(const uchar *record); ///< required
|
|
|
|
int info(uint); ///< required
|
|
|
|
int extra(enum ha_extra_function operation);
|
2013-08-12 21:51:56 +02:00
|
|
|
int start_stmt(THD *thd, thr_lock_type lock_type);
|
2013-02-07 10:34:27 +01:00
|
|
|
int external_lock(THD *thd, int lock_type); ///< required
|
|
|
|
int delete_all_rows(void);
|
|
|
|
ha_rows records_in_range(uint inx, key_range *min_key,
|
|
|
|
key_range *max_key);
|
2013-03-13 01:10:20 +01:00
|
|
|
/**
|
|
|
|
These methods can be overridden, but their default implementation
|
|
|
|
provide useful functionality.
|
|
|
|
*/
|
|
|
|
int rename_table(const char *from, const char *to);
|
|
|
|
/**
|
|
|
|
Delete a table in the engine. Called for base as well as temporary
|
|
|
|
tables.
|
|
|
|
*/
|
|
|
|
int delete_table(const char *name);
|
|
|
|
/**
|
|
|
|
Called by delete_table and rename_table
|
|
|
|
*/
|
|
|
|
int delete_or_rename_table(const char *from, const char *to);
|
2013-02-07 10:34:27 +01:00
|
|
|
int create(const char *name, TABLE *form,
|
|
|
|
HA_CREATE_INFO *create_info); ///< required
|
|
|
|
bool check_if_incompatible_data(HA_CREATE_INFO *info,
|
|
|
|
uint table_changes);
|
|
|
|
|
|
|
|
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
|
|
|
enum thr_lock_type lock_type); ///< required
|
|
|
|
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
|
|
|
|
|
2014-04-19 11:11:30 +02:00
|
|
|
/**
|
|
|
|
* Multi Range Read interface
|
|
|
|
*/
|
|
|
|
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
|
|
|
|
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
|
|
|
|
int multi_range_read_next(range_id_t *range_info);
|
|
|
|
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
|
|
|
|
void *seq_init_param,
|
|
|
|
uint n_ranges, uint *bufsz,
|
|
|
|
uint *flags, Cost_estimate *cost);
|
|
|
|
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
|
|
|
|
uint key_parts, uint *bufsz,
|
|
|
|
uint *flags, Cost_estimate *cost);
|
|
|
|
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
|
|
|
|
|
|
|
|
int reset(void) {ds_mrr.dsmrr_close(); return 0;}
|
|
|
|
|
|
|
|
/* Index condition pushdown implementation */
|
|
|
|
// Item *idx_cond_push(uint keyno, Item* idx_cond);
|
|
|
|
private:
|
|
|
|
DsMrr_impl ds_mrr;
|
|
|
|
|
2013-02-07 10:34:27 +01:00
|
|
|
protected:
|
2013-12-31 13:08:29 +01:00
|
|
|
bool check_privileges(THD *thd, PTOS options, char *dbn);
|
2013-08-12 21:51:56 +02:00
|
|
|
MODE CheckMode(PGLOBAL g, THD *thd, MODE newmode, bool *chk, bool *cras);
|
2013-12-31 13:08:29 +01:00
|
|
|
char *GetDBfromName(const char *name);
|
2013-02-07 10:34:27 +01:00
|
|
|
|
|
|
|
// Members
|
|
|
|
static ulong num; // Tracable handler number
|
2013-03-03 15:37:27 +01:00
|
|
|
PCONNECT xp; // To user_connect associated class
|
|
|
|
ulong hnum; // The number of this handler
|
|
|
|
query_id_t valid_query_id; // The one when tdbp was allocated
|
|
|
|
query_id_t creat_query_id; // The one when handler was allocated
|
2014-08-23 19:17:15 +02:00
|
|
|
char *datapath; // Is the Path of DB data directory
|
2013-03-03 15:37:27 +01:00
|
|
|
PTDB tdbp; // To table class object
|
|
|
|
PVAL sdvalin; // Used to convert date values
|
|
|
|
PVAL sdvalout; // Used to convert date values
|
2013-02-07 10:34:27 +01:00
|
|
|
bool istable; // True for table handler
|
2014-05-31 12:31:26 +02:00
|
|
|
char partname[64]; // The partition name
|
2013-02-07 10:34:27 +01:00
|
|
|
MODE xmod; // Table mode
|
|
|
|
XINFO xinfo; // The table info structure
|
2013-03-03 15:37:27 +01:00
|
|
|
bool valid_info; // True if xinfo is valid
|
|
|
|
bool stop; // Used when creating index
|
2014-02-03 16:14:13 +01:00
|
|
|
bool alter; // True when converting to other engine
|
2014-04-19 11:11:30 +02:00
|
|
|
bool mrr; // True when getting index positions
|
2014-07-17 18:13:51 +02:00
|
|
|
bool nox; // True when index should not be made
|
|
|
|
bool abort; // True after error in UPDATE/DELETE
|
2013-02-07 10:34:27 +01:00
|
|
|
int indexing; // Type of indexing for CONNECT
|
2013-08-12 21:51:56 +02:00
|
|
|
int locked; // Table lock
|
2014-07-17 18:13:51 +02:00
|
|
|
MY_BITMAP *part_id; // Columns used for partition func
|
2013-02-07 10:34:27 +01:00
|
|
|
THR_LOCK_DATA lock_data;
|
|
|
|
|
|
|
|
public:
|
2014-04-19 11:11:30 +02:00
|
|
|
TABLE_SHARE *tshp; // Used by called tables
|
2013-02-07 10:34:27 +01:00
|
|
|
char *data_file_name;
|
|
|
|
char *index_file_name;
|
|
|
|
uint int_table_flags; // Inherited from MyISAM
|
|
|
|
bool enable_activate_all_index; // Inherited from MyISAM
|
|
|
|
}; // end of ha_connect class definition
|