diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-12-17 11:00:39 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-12-17 11:00:39 +0100 |
commit | cb7f5948ecedaaaf68de5bdbfab78f1c2e934453 (patch) | |
tree | 7204e1cd0161875fca1faaa420e13b25fc01eb18 | |
parent | a058974440f7df7832f4bb9bf5d2783ca040fa66 (diff) | |
download | mariadb-git-cb7f5948ecedaaaf68de5bdbfab78f1c2e934453.tar.gz |
simplify the handler api - table_type() is no longer abstract, not even virtual
24 files changed, 11 insertions, 78 deletions
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index 6736ca7f541..4fdac6b9cea 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -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 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index e055a333faf..6ec9d77230b 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -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' diff --git a/mysql-test/suite/funcs_1/r/is_engines_merge.result b/mysql-test/suite/funcs_1/r/is_engines_merge.result index 3bc7a498581..b72c98bfd7e 100644 --- a/mysql-test/suite/funcs_1/r/is_engines_merge.result +++ b/mysql-test/suite/funcs_1/r/is_engines_merge.result @@ -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 diff --git a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result index 727e6ca88f2..7e12c7dc477 100644 --- a/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result +++ b/mysql-test/suite/sys_vars/r/default_storage_engine_basic.result @@ -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 diff --git a/mysql-test/suite/sys_vars/r/storage_engine_basic.result b/mysql-test/suite/sys_vars/r/storage_engine_basic.result index 2831ebaa500..9461707dd79 100644 --- a/mysql-test/suite/sys_vars/r/storage_engine_basic.result +++ b/mysql-test/suite/sys_vars/r/storage_engine_basic.result @@ -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 diff --git a/mysql-test/suite/vcol/r/vcol_merge.result b/mysql-test/suite/vcol/r/vcol_merge.result index 4b5ed838c3a..e127ec35e8c 100644 --- a/mysql-test/suite/vcol/r/vcol_merge.result +++ b/mysql-test/suite/vcol/r/vcol_merge.result @@ -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; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index c139889a2f4..463a1678449 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -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 diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 86d43e3750f..71408324c1b 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -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; diff --git a/sql/handler.h b/sql/handler.h index 2731a198224..a7141246993 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -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 diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 165c7443070..d1c4bfbc7fb 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -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 diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index a7efd261ddb..51857f3bb2a 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -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 diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 88af2c9652c..26404b3a9e7 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -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 diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index ca8ca5ff293..9be370edfe3 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -67,11 +67,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. */ diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 98b0efdbe2b..6583d438c4d 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -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 */ diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index dc7733806ad..3af05387cb2 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -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 diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index c5b8a09b216..30ad06e2c06 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -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) ? diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 545daca12fe..5cb57a17f52 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -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 diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index 79324f64370..9d45d146582 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -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; } diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 2c1e85ec9ff..c124d5cc690 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -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, diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index f5ba2ffef38..8007e7d04e8 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -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 diff --git a/storage/oqgraph/ha_oqgraph.h b/storage/oqgraph/ha_oqgraph.h index 97f8cb54081..ee88e38c526 100644 --- a/storage/oqgraph/ha_oqgraph.h +++ b/storage/oqgraph/ha_oqgraph.h @@ -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"; diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index 17ab601e60f..35670339599 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -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; diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 965863eb2d2..58c92366b81 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -4005,17 +4005,6 @@ static const char* ha_innobase_exts[] = { }; /****************************************************************//** -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 const char* diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h index 933d75cf0d2..4d9c0a1ab35 100644 --- a/storage/xtradb/handler/ha_innodb.h +++ b/storage/xtradb/handler/ha_innodb.h @@ -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; |