Commit cb7f5948 authored by Sergei Golubchik's avatar Sergei Golubchik

simplify the handler api - table_type() is no longer abstract, not even virtual

parent a0589744
...@@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` ( ...@@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` (
`email` varchar(60) NOT NULL DEFAULT '', `email` varchar(60) NOT NULL DEFAULT '',
PRIMARY KEY (`a`), PRIMARY KEY (`a`),
UNIQUE KEY `email` (`email`) UNIQUE KEY `email` (`email`)
) TYPE=HEAP ROW_FORMAT=DYNAMIC ) TYPE=MEMORY ROW_FORMAT=DYNAMIC
set sql_mode="postgresql,oracle,mssql,db2,maxdb"; set sql_mode="postgresql,oracle,mssql,db2,maxdb";
select @@sql_mode; select @@sql_mode;
@@sql_mode @@sql_mode
......
...@@ -211,10 +211,10 @@ VARIABLE_NAME VARIABLE_VALUE ...@@ -211,10 +211,10 @@ VARIABLE_NAME VARIABLE_VALUE
DEFAULT_STORAGE_ENGINE MEMORY DEFAULT_STORAGE_ENGINE MEMORY
show global variables like 'default_storage_engine'; show global variables like 'default_storage_engine';
Variable_name Value Variable_name Value
default_storage_engine MRG_MYISAM default_storage_engine MRG_MyISAM
select * from information_schema.global_variables where variable_name like 'default_storage_engine'; select * from information_schema.global_variables where variable_name like 'default_storage_engine';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
DEFAULT_STORAGE_ENGINE MRG_MYISAM DEFAULT_STORAGE_ENGINE MRG_MyISAM
set GLOBAL myisam_max_sort_file_size=2000000; set GLOBAL myisam_max_sort_file_size=2000000;
Warnings: Warnings:
Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000' Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000'
......
SELECT * FROM information_schema.engines SELECT * FROM information_schema.engines
WHERE ENGINE = 'MRG_MYISAM'; WHERE ENGINE = 'MRG_MYISAM';
ENGINE MRG_MYISAM ENGINE MRG_MyISAM
SUPPORT YES SUPPORT YES
COMMENT Collection of identical MyISAM tables COMMENT Collection of identical MyISAM tables
TRANSACTIONS NO TRANSACTIONS NO
......
...@@ -19,7 +19,7 @@ MyISAM ...@@ -19,7 +19,7 @@ MyISAM
SET @@global.default_storage_engine = MERGE; SET @@global.default_storage_engine = MERGE;
SELECT @@global.default_storage_engine; SELECT @@global.default_storage_engine;
@@global.default_storage_engine @@global.default_storage_engine
MRG_MYISAM MRG_MyISAM
SET @@global.default_storage_engine = MEMORY; SET @@global.default_storage_engine = MEMORY;
SELECT @@global.default_storage_engine; SELECT @@global.default_storage_engine;
@@global.default_storage_engine @@global.default_storage_engine
...@@ -36,7 +36,7 @@ MyISAM ...@@ -36,7 +36,7 @@ MyISAM
SET @@session.default_storage_engine = MERGE; SET @@session.default_storage_engine = MERGE;
SELECT @@session.default_storage_engine; SELECT @@session.default_storage_engine;
@@session.default_storage_engine @@session.default_storage_engine
MRG_MYISAM MRG_MyISAM
SET @@session.default_storage_engine = MEMORY; SET @@session.default_storage_engine = MEMORY;
SELECT @@session.default_storage_engine; SELECT @@session.default_storage_engine;
@@session.default_storage_engine @@session.default_storage_engine
......
...@@ -19,7 +19,7 @@ MyISAM ...@@ -19,7 +19,7 @@ MyISAM
SET @@global.storage_engine = MERGE; SET @@global.storage_engine = MERGE;
SELECT @@global.storage_engine; SELECT @@global.storage_engine;
@@global.storage_engine @@global.storage_engine
MRG_MYISAM MRG_MyISAM
SET @@global.storage_engine = MEMORY; SET @@global.storage_engine = MEMORY;
SELECT @@global.storage_engine; SELECT @@global.storage_engine;
@@global.storage_engine @@global.storage_engine
...@@ -36,7 +36,7 @@ MyISAM ...@@ -36,7 +36,7 @@ MyISAM
SET @@session.storage_engine = MERGE; SET @@session.storage_engine = MERGE;
SELECT @@session.storage_engine; SELECT @@session.storage_engine;
@@session.storage_engine @@session.storage_engine
MRG_MYISAM MRG_MyISAM
SET @@session.storage_engine = MEMORY; SET @@session.storage_engine = MEMORY;
SELECT @@session.storage_engine; SELECT @@session.storage_engine;
@@session.storage_engine @@session.storage_engine
......
...@@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10)); ...@@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10));
insert into t1 values (1,default); insert into t1 values (1,default);
insert into t2 values (2,default); insert into t2 values (2,default);
create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2); create table t3 (a int, b int as (a % 10)) engine=MERGE UNION=(t1,t2);
ERROR HY000: MRG_MYISAM storage engine does not support computed columns ERROR HY000: MRG_MyISAM storage engine does not support computed columns
drop table t1,t2; drop table t1,t2;
...@@ -298,13 +298,6 @@ void ha_partition::init_handler_variables() ...@@ -298,13 +298,6 @@ void ha_partition::init_handler_variables()
} }
const char *ha_partition::table_type() const
{
// we can do this since we only support a single engine type
return m_file[0]->table_type();
}
/* /*
Destructor method Destructor method
......
...@@ -635,9 +635,6 @@ public: ...@@ -635,9 +635,6 @@ public:
*/ */
virtual const char *index_type(uint inx); virtual const char *index_type(uint inx);
/* The name of the table type that will be used for display purposes */
virtual const char *table_type() const;
/* The name of the row type used for the underlying tables. */ /* The name of the row type used for the underlying tables. */
virtual enum row_type get_row_type() const; virtual enum row_type get_row_type() const;
......
...@@ -2408,7 +2408,7 @@ public: ...@@ -2408,7 +2408,7 @@ public:
{ return; } /* prepare InnoDB for HANDLER */ { return; } /* prepare InnoDB for HANDLER */
virtual void free_foreign_key_create_info(char* str) {} virtual void free_foreign_key_create_info(char* str) {}
/** The following can be called without an open handler */ /** The following can be called without an open handler */
virtual const char *table_type() const =0; const char *table_type() const { return hton_name(ht)->str; }
/** /**
If frm_error() is called then we will use this to find out what file If frm_error() is called then we will use this to find out what file
extentions exist for the storage engine. This is also used by the default extentions exist for the storage engine. This is also used by the default
......
...@@ -82,7 +82,6 @@ public: ...@@ -82,7 +82,6 @@ public:
~ha_archive() ~ha_archive()
{ {
} }
const char *table_type() const { return "ARCHIVE"; }
const char *index_type(uint inx) { return "NONE"; } const char *index_type(uint inx) { return "NONE"; }
const char **bas_ext() const; const char **bas_ext() const;
ulonglong table_flags() const ulonglong table_flags() const
......
...@@ -46,8 +46,6 @@ public: ...@@ -46,8 +46,6 @@ public:
~ha_blackhole() ~ha_blackhole()
{ {
} }
/* The name that will be used for display purposes */
const char *table_type() const { return "BLACKHOLE"; }
/* /*
The name of the index type that will be used for display The name of the index type that will be used for display
don't implement this method unless you really have indexes don't implement this method unless you really have indexes
......
...@@ -102,7 +102,6 @@ public: ...@@ -102,7 +102,6 @@ public:
delete file_buff; delete file_buff;
free_root(&blobroot, MYF(0)); free_root(&blobroot, MYF(0));
} }
const char *table_type() const { return "CSV"; }
const char *index_type(uint inx) { return "NONE"; } const char *index_type(uint inx) { return "NONE"; }
const char **bas_ext() const; const char **bas_ext() const;
ulonglong table_flags() const ulonglong table_flags() const
......
...@@ -66,11 +66,6 @@ public: ...@@ -66,11 +66,6 @@ public:
{ {
} }
/** @brief
The name that will be used for display purposes.
*/
const char *table_type() const { return "EXAMPLE"; }
/** @brief /** @brief
The name of the index type that will be used for display. The name of the index type that will be used for display.
Don't implement this method unless you really have indexes. Don't implement this method unless you really have indexes.
......
...@@ -124,8 +124,6 @@ private: ...@@ -124,8 +124,6 @@ private:
public: public:
ha_federated(handlerton *hton, TABLE_SHARE *table_arg); ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
~ha_federated() {} ~ha_federated() {}
/* The name that will be used for display purposes */
const char *table_type() const { return "FEDERATED"; }
/* /*
Next pointer used in transaction Next pointer used in transaction
*/ */
......
...@@ -311,8 +311,6 @@ private: ...@@ -311,8 +311,6 @@ private:
public: public:
ha_federatedx(handlerton *hton, TABLE_SHARE *table_arg); ha_federatedx(handlerton *hton, TABLE_SHARE *table_arg);
~ha_federatedx() {} ~ha_federatedx() {}
/* The name that will be used for display purposes */
const char *table_type() const { return "FEDERATED"; }
/* /*
The name of the index type that will be used for display The name of the index type that will be used for display
don't implement this method unless you really have indexes don't implement this method unless you really have indexes
......
...@@ -38,11 +38,6 @@ public: ...@@ -38,11 +38,6 @@ public:
ha_heap(handlerton *hton, TABLE_SHARE *table); ha_heap(handlerton *hton, TABLE_SHARE *table);
~ha_heap() {} ~ha_heap() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root);
const char *table_type() const
{
return (table->in_use->variables.sql_mode & MODE_MYSQL323) ?
"HEAP" : "MEMORY";
}
const char *index_type(uint inx) const char *index_type(uint inx)
{ {
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
......
...@@ -59,8 +59,6 @@ public: ...@@ -59,8 +59,6 @@ public:
ha_maria(handlerton *hton, TABLE_SHARE * table_arg); ha_maria(handlerton *hton, TABLE_SHARE * table_arg);
~ha_maria() {} ~ha_maria() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root);
const char *table_type() const
{ return "Aria"; }
const char *index_type(uint key_number); const char *index_type(uint key_number);
const char **bas_ext() const; const char **bas_ext() const;
ulonglong table_flags() const ulonglong table_flags() const
......
...@@ -56,7 +56,6 @@ class ha_myisam: public handler ...@@ -56,7 +56,6 @@ class ha_myisam: public handler
ha_myisam(handlerton *hton, TABLE_SHARE *table_arg); ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisam() {} ~ha_myisam() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root);
const char *table_type() const { return "MyISAM"; }
const char *index_type(uint key_number); const char *index_type(uint key_number);
const char **bas_ext() const; const char **bas_ext() const;
ulonglong table_flags() const { return int_table_flags; } ulonglong table_flags() const { return int_table_flags; }
......
...@@ -1717,28 +1717,11 @@ static int myisammrg_init(void *p) ...@@ -1717,28 +1717,11 @@ static int myisammrg_init(void *p)
struct st_mysql_storage_engine myisammrg_storage_engine= struct st_mysql_storage_engine myisammrg_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION }; { MYSQL_HANDLERTON_INTERFACE_VERSION };
mysql_declare_plugin(myisammrg)
{
MYSQL_STORAGE_ENGINE_PLUGIN,
&myisammrg_storage_engine,
"MRG_MYISAM",
"MySQL AB",
"Collection of identical MyISAM tables",
PLUGIN_LICENSE_GPL,
myisammrg_init, /* Plugin Init */
NULL, /* Plugin Deinit */
0x0100, /* 1.0 */
NULL, /* status variables */
NULL, /* system variables */
NULL, /* config options */
0, /* flags */
}
mysql_declare_plugin_end;
maria_declare_plugin(myisammrg) maria_declare_plugin(myisammrg)
{ {
MYSQL_STORAGE_ENGINE_PLUGIN, MYSQL_STORAGE_ENGINE_PLUGIN,
&myisammrg_storage_engine, &myisammrg_storage_engine,
"MRG_MYISAM", "MRG_MyISAM",
"MySQL AB", "MySQL AB",
"Collection of identical MyISAM tables", "Collection of identical MyISAM tables",
PLUGIN_LICENSE_GPL, PLUGIN_LICENSE_GPL,
......
...@@ -82,7 +82,6 @@ public: ...@@ -82,7 +82,6 @@ public:
ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg); ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisammrg(); ~ha_myisammrg();
const char *table_type() const { return "MRG_MyISAM"; }
const char **bas_ext() const; const char **bas_ext() const;
const char *index_type(uint key_number); const char *index_type(uint key_number);
ulonglong table_flags() const ulonglong table_flags() const
......
...@@ -62,10 +62,6 @@ public: ...@@ -62,10 +62,6 @@ public:
Table_flags table_flags() const; Table_flags table_flags() const;
#endif #endif
~ha_oqgraph() {} ~ha_oqgraph() {}
const char *table_type() const
{
return "OQGRAPH";
}
const char *index_type(uint inx) const char *index_type(uint inx)
{ {
return "HASH"; return "HASH";
......
...@@ -42,8 +42,6 @@ public: ...@@ -42,8 +42,6 @@ public:
~ha_perfschema(); ~ha_perfschema();
const char *table_type(void) const { return pfs_engine_name; }
const char *index_type(uint) { return ""; } const char *index_type(uint) { return ""; }
const char **bas_ext(void) const; const char **bas_ext(void) const;
......
...@@ -4004,17 +4004,6 @@ static const char* ha_innobase_exts[] = { ...@@ -4004,17 +4004,6 @@ static const char* ha_innobase_exts[] = {
NullS NullS
}; };
/****************************************************************//**
Returns the table type (storage engine name).
@return table type */
UNIV_INTERN
const char*
ha_innobase::table_type() const
/*===========================*/
{
return(innobase_hton_name);
}
/****************************************************************//** /****************************************************************//**
Returns the index type. */ Returns the index type. */
UNIV_INTERN UNIV_INTERN
......
...@@ -123,7 +123,6 @@ class ha_innobase: public handler ...@@ -123,7 +123,6 @@ class ha_innobase: public handler
*/ */
enum row_type get_row_type() const; enum row_type get_row_type() const;
const char* table_type() const;
const char* index_type(uint key_number); const char* index_type(uint key_number);
const char** bas_ext() const; const char** bas_ext() const;
Table_flags table_flags() const; Table_flags table_flags() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment