summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortsmith@maint1.mysql.com <>2006-07-21 09:53:12 +0200
committertsmith@maint1.mysql.com <>2006-07-21 09:53:12 +0200
commit539ac78df2522a4c6efbea137f1bc636146552db (patch)
tree9828a3b2b98f2fb78f98e683fc68562b0c710617
parentf22a4ce1a174ee7d651540947dfa437ef0ea6a16 (diff)
downloadmariadb-git-539ac78df2522a4c6efbea137f1bc636146552db.tar.gz
Merge patch for bug #15195 from 5.0 -> 5.0-release (for 5.0.24)
-rw-r--r--mysql-test/r/warnings.result7
-rw-r--r--mysql-test/t/warnings-master.opt2
-rw-r--r--mysql-test/t/warnings.test4
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/mysql_priv.h4
-rw-r--r--sql/mysqld.cc13
-rw-r--r--sql/set_var.cc1
7 files changed, 31 insertions, 4 deletions
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index f9006ebca37..59be512d5a6 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -173,6 +173,13 @@ alter table t1 engine=isam;
Warnings:
Warning 1266 Using storage engine MyISAM for table 't1'
drop table t1;
+create table t1 (id int) engine=merge;
+Warnings:
+Warning 1266 Using storage engine MyISAM for table 't1'
+alter table t1 engine=merge;
+Warnings:
+Warning 1266 Using storage engine MyISAM for table 't1'
+drop table t1;
create table t1 (id int) type=heap;
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
diff --git a/mysql-test/t/warnings-master.opt b/mysql-test/t/warnings-master.opt
index 3b8baeddb14..e924a22e2ce 100644
--- a/mysql-test/t/warnings-master.opt
+++ b/mysql-test/t/warnings-master.opt
@@ -1 +1 @@
---skip-isam
+--skip-isam --skip-merge
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index 71e847d1d8c..4768c7574e5 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -117,6 +117,10 @@ create table t1 (id int) engine=isam;
alter table t1 engine=isam;
drop table t1;
+create table t1 (id int) engine=merge;
+alter table t1 engine=merge;
+drop table t1;
+
#
# Test for deprecated TYPE= syntax
#
diff --git a/sql/handler.cc b/sql/handler.cc
index b40934ea194..977ff466996 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 3c58f2cbc6b..dffd2677d0d 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -1304,6 +1304,10 @@ 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_raid, have_openssl, have_symlink, have_dlopen;
extern SHOW_COMP_OPTION have_query_cache;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 429bdee17d6..786a1ea4f4c 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -300,7 +300,7 @@ static bool lower_case_table_names_used= 0;
static bool volatile select_thread_in_use, signal_thread_in_use;
static bool volatile ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
-static my_bool opt_bdb, opt_isam, opt_ndbcluster;
+static my_bool opt_bdb, opt_isam, opt_ndbcluster, opt_merge;
static my_bool opt_short_log_format= 0;
static uint kill_cached_threads, wake_thread;
static ulong killed_threads, thread_created;
@@ -4648,7 +4648,8 @@ enum options_mysqld
OPT_OLD_STYLE_USER_LIMITS,
OPT_LOG_SLOW_ADMIN_STATEMENTS,
OPT_TABLE_LOCK_WAIT_TIMEOUT,
- OPT_PORT_OPEN_TIMEOUT
+ OPT_PORT_OPEN_TIMEOUT,
+ OPT_MERGE
};
@@ -5101,6 +5102,9 @@ master-ssl",
#endif /* HAVE_REPLICATION */
{"memlock", OPT_MEMLOCK, "Lock mysqld in memory.", (gptr*) &locked_in_memory,
(gptr*) &locked_in_memory, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"merge", OPT_MERGE, "Enable Merge storage engine. Disable with \
+--skip-merge.",
+ (gptr*) &opt_merge, (gptr*) &opt_merge, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0},
{"myisam-recover", OPT_MYISAM_RECOVER,
"Syntax: myisam-recover[=option[,option...]], where option can be DEFAULT, BACKUP, FORCE or QUICK.",
(gptr*) &myisam_recover_options_str, (gptr*) &myisam_recover_options_str, 0,
@@ -6883,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 */
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 1cb3878ac70..eca44fa823b 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -865,6 +865,7 @@ struct show_var_st init_vars[]= {
{"have_innodb", (char*) &have_innodb, SHOW_HAVE},
{"have_isam", (char*) &have_isam, SHOW_HAVE},
{"have_ndbcluster", (char*) &have_ndbcluster, SHOW_HAVE},
+ {"have_merge_engine", (char*) &have_merge_db, SHOW_HAVE},
{"have_openssl", (char*) &have_openssl, SHOW_HAVE},
{"have_query_cache", (char*) &have_query_cache, SHOW_HAVE},
{"have_raid", (char*) &have_raid, SHOW_HAVE},