simplify the handler api - table_type() is no longer abstract, not even virtual
This commit is contained in:
parent
a058974440
commit
cb7f5948ec
@ -71,7 +71,7 @@ t1 CREATE TABLE `t1` (
|
||||
`email` varchar(60) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`),
|
||||
UNIQUE KEY `email` (`email`)
|
||||
) TYPE=HEAP ROW_FORMAT=DYNAMIC
|
||||
) TYPE=MEMORY ROW_FORMAT=DYNAMIC
|
||||
set sql_mode="postgresql,oracle,mssql,db2,maxdb";
|
||||
select @@sql_mode;
|
||||
@@sql_mode
|
||||
|
@ -211,10 +211,10 @@ VARIABLE_NAME VARIABLE_VALUE
|
||||
DEFAULT_STORAGE_ENGINE MEMORY
|
||||
show global variables like 'default_storage_engine';
|
||||
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';
|
||||
VARIABLE_NAME VARIABLE_VALUE
|
||||
DEFAULT_STORAGE_ENGINE MRG_MYISAM
|
||||
DEFAULT_STORAGE_ENGINE MRG_MyISAM
|
||||
set GLOBAL myisam_max_sort_file_size=2000000;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000'
|
||||
|
@ -1,6 +1,6 @@
|
||||
SELECT * FROM information_schema.engines
|
||||
WHERE ENGINE = 'MRG_MYISAM';
|
||||
ENGINE MRG_MYISAM
|
||||
ENGINE MRG_MyISAM
|
||||
SUPPORT YES
|
||||
COMMENT Collection of identical MyISAM tables
|
||||
TRANSACTIONS NO
|
||||
|
@ -19,7 +19,7 @@ MyISAM
|
||||
SET @@global.default_storage_engine = MERGE;
|
||||
SELECT @@global.default_storage_engine;
|
||||
@@global.default_storage_engine
|
||||
MRG_MYISAM
|
||||
MRG_MyISAM
|
||||
SET @@global.default_storage_engine = MEMORY;
|
||||
SELECT @@global.default_storage_engine;
|
||||
@@global.default_storage_engine
|
||||
@ -36,7 +36,7 @@ MyISAM
|
||||
SET @@session.default_storage_engine = MERGE;
|
||||
SELECT @@session.default_storage_engine;
|
||||
@@session.default_storage_engine
|
||||
MRG_MYISAM
|
||||
MRG_MyISAM
|
||||
SET @@session.default_storage_engine = MEMORY;
|
||||
SELECT @@session.default_storage_engine;
|
||||
@@session.default_storage_engine
|
||||
|
@ -19,7 +19,7 @@ MyISAM
|
||||
SET @@global.storage_engine = MERGE;
|
||||
SELECT @@global.storage_engine;
|
||||
@@global.storage_engine
|
||||
MRG_MYISAM
|
||||
MRG_MyISAM
|
||||
SET @@global.storage_engine = MEMORY;
|
||||
SELECT @@global.storage_engine;
|
||||
@@global.storage_engine
|
||||
@ -36,7 +36,7 @@ MyISAM
|
||||
SET @@session.storage_engine = MERGE;
|
||||
SELECT @@session.storage_engine;
|
||||
@@session.storage_engine
|
||||
MRG_MYISAM
|
||||
MRG_MyISAM
|
||||
SET @@session.storage_engine = MEMORY;
|
||||
SELECT @@session.storage_engine;
|
||||
@@session.storage_engine
|
||||
|
@ -4,5 +4,5 @@ create table t2 (a int, b int as (a % 10));
|
||||
insert into t1 values (1,default);
|
||||
insert into t2 values (2,default);
|
||||
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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -635,9 +635,6 @@ public:
|
||||
*/
|
||||
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. */
|
||||
virtual enum row_type get_row_type() const;
|
||||
|
||||
|
@ -2408,7 +2408,7 @@ public:
|
||||
{ return; } /* prepare InnoDB for HANDLER */
|
||||
virtual void free_foreign_key_create_info(char* str) {}
|
||||
/** 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
|
||||
extentions exist for the storage engine. This is also used by the default
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
~ha_archive()
|
||||
{
|
||||
}
|
||||
const char *table_type() const { return "ARCHIVE"; }
|
||||
const char *index_type(uint inx) { return "NONE"; }
|
||||
const char **bas_ext() const;
|
||||
ulonglong table_flags() const
|
||||
|
@ -46,8 +46,6 @@ public:
|
||||
~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
|
||||
don't implement this method unless you really have indexes
|
||||
|
@ -102,7 +102,6 @@ public:
|
||||
delete file_buff;
|
||||
free_root(&blobroot, MYF(0));
|
||||
}
|
||||
const char *table_type() const { return "CSV"; }
|
||||
const char *index_type(uint inx) { return "NONE"; }
|
||||
const char **bas_ext() const;
|
||||
ulonglong table_flags() const
|
||||
|
@ -66,11 +66,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
/** @brief
|
||||
The name that will be used for display purposes.
|
||||
*/
|
||||
const char *table_type() const { return "EXAMPLE"; }
|
||||
|
||||
/** @brief
|
||||
The name of the index type that will be used for display.
|
||||
Don't implement this method unless you really have indexes.
|
||||
|
@ -124,8 +124,6 @@ private:
|
||||
public:
|
||||
ha_federated(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
~ha_federated() {}
|
||||
/* The name that will be used for display purposes */
|
||||
const char *table_type() const { return "FEDERATED"; }
|
||||
/*
|
||||
Next pointer used in transaction
|
||||
*/
|
||||
|
@ -311,8 +311,6 @@ private:
|
||||
public:
|
||||
ha_federatedx(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
~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
|
||||
don't implement this method unless you really have indexes
|
||||
|
@ -38,11 +38,6 @@ public:
|
||||
ha_heap(handlerton *hton, TABLE_SHARE *table);
|
||||
~ha_heap() {}
|
||||
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)
|
||||
{
|
||||
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
|
||||
|
@ -59,8 +59,6 @@ public:
|
||||
ha_maria(handlerton *hton, TABLE_SHARE * table_arg);
|
||||
~ha_maria() {}
|
||||
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 **bas_ext() const;
|
||||
ulonglong table_flags() const
|
||||
|
@ -56,7 +56,6 @@ class ha_myisam: public handler
|
||||
ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
~ha_myisam() {}
|
||||
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 **bas_ext() const;
|
||||
ulonglong table_flags() const { return int_table_flags; }
|
||||
|
@ -1717,28 +1717,11 @@ static int myisammrg_init(void *p)
|
||||
struct st_mysql_storage_engine myisammrg_storage_engine=
|
||||
{ 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)
|
||||
{
|
||||
MYSQL_STORAGE_ENGINE_PLUGIN,
|
||||
&myisammrg_storage_engine,
|
||||
"MRG_MYISAM",
|
||||
"MRG_MyISAM",
|
||||
"MySQL AB",
|
||||
"Collection of identical MyISAM tables",
|
||||
PLUGIN_LICENSE_GPL,
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
|
||||
ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg);
|
||||
~ha_myisammrg();
|
||||
const char *table_type() const { return "MRG_MyISAM"; }
|
||||
const char **bas_ext() const;
|
||||
const char *index_type(uint key_number);
|
||||
ulonglong table_flags() const
|
||||
|
@ -62,10 +62,6 @@ public:
|
||||
Table_flags table_flags() const;
|
||||
#endif
|
||||
~ha_oqgraph() {}
|
||||
const char *table_type() const
|
||||
{
|
||||
return "OQGRAPH";
|
||||
}
|
||||
const char *index_type(uint inx)
|
||||
{
|
||||
return "HASH";
|
||||
|
@ -42,8 +42,6 @@ public:
|
||||
|
||||
~ha_perfschema();
|
||||
|
||||
const char *table_type(void) const { return pfs_engine_name; }
|
||||
|
||||
const char *index_type(uint) { return ""; }
|
||||
|
||||
const char **bas_ext(void) const;
|
||||
|
@ -4004,17 +4004,6 @@ static const char* ha_innobase_exts[] = {
|
||||
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. */
|
||||
UNIV_INTERN
|
||||
|
@ -123,7 +123,6 @@ class ha_innobase: public handler
|
||||
*/
|
||||
enum row_type get_row_type() const;
|
||||
|
||||
const char* table_type() const;
|
||||
const char* index_type(uint key_number);
|
||||
const char** bas_ext() const;
|
||||
Table_flags table_flags() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user