From 24f96519de1c1b8310131a07722f50904764e961 Mon Sep 17 00:00:00 2001 From: "tsmith/tim@siva.hindu.god" <> Date: Thu, 20 Jul 2006 13:41:00 -0600 Subject: [PATCH] Finish the merge of the patch for bug #15195 from 4.1 -> 5.0 - Adapt it to work with the handlerton class --- sql/handler.cc | 4 +++- sql/mysql_priv.h | 5 ++++- sql/mysqld.cc | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 9c03a9ef88f..448cfc6e1fa 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -302,7 +302,9 @@ handler *get_new_handler(TABLE *table, MEM_ROOT *alloc, enum db_type db_type) #endif case DB_TYPE_MRG_MYISAM: case DB_TYPE_MRG_ISAM: - return new (alloc) ha_myisammrg(table); + if (have_merge_db == SHOW_OPTION_YES) + return new (alloc) ha_myisammrg(table); + return NULL; #ifdef HAVE_BERKELEY_DB case DB_TYPE_BERKELEY_DB: if (have_berkeley_db == SHOW_OPTION_YES) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index f9159969b04..089bc965c8c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1323,8 +1323,11 @@ extern handlerton ndbcluster_hton; extern SHOW_COMP_OPTION have_ndbcluster; #endif +/* MRG_MYISAM handler is always built, but may be skipped */ +extern handlerton myisammrg_hton; +#define have_merge_db myisammrg_hton.state + extern SHOW_COMP_OPTION have_isam; -extern SHOW_COMP_OPTION have_merge_db; extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_dlopen; extern SHOW_COMP_OPTION have_query_cache; extern SHOW_COMP_OPTION have_geometry, have_rtree_keys; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b082e7d5046..786a1ea4f4c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6887,6 +6887,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), global_system_variables.tx_isolation= (type-1); break; } + case OPT_MERGE: + if (opt_merge) + have_merge_db= SHOW_OPTION_YES; + else + have_merge_db= SHOW_OPTION_DISABLED; #ifdef HAVE_BERKELEY_DB case OPT_BDB_NOSYNC: /* Deprecated option */