From: Date: April 14 2005 3:25am Subject: bk commit into 4.1 tree (jimw:1.2181) BUG#9815 List-Archive: http://lists.mysql.com/internals/23999 X-Bug: 9815 Message-Id: <20050414012535.344C6A85A9@rama.trainedmonkey.com> Below is the list of changes that have just been committed into a local 4.1 repository of jimw. When jimw does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2181 05/04/13 18:25:31 jimw@stripped +3 -0 Check that the default storage engine is really available, and refuse to start up if it is not. (Bug #9815) sql/mysqld.cc 1.571 05/04/13 18:25:28 jimw@stripped +12 -0 Abort startup if the specified default storage engine is not available. sql/handler.h 1.137 05/04/13 18:25:28 jimw@stripped +1 -0 Declare ha_storage_engine_is_enabled() sql/handler.cc 1.161 05/04/13 18:25:28 jimw@stripped +14 -0 Add ha_storage_engine_is_enabled function. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jimw # Host: rama.(none) # Root: /home/jimw/my/mysql-4.1-9815 --- 1.160/sql/handler.cc 2005-03-22 16:10:36 -08:00 +++ 1.161/sql/handler.cc 2005-04-13 18:25:28 -07:00 @@ -145,6 +145,20 @@ return "none"; } + +my_bool ha_storage_engine_is_enabled(enum db_type database_type) +{ + show_table_type_st *types; + for (types= sys_table_types; types->type; types++) + { + if ((database_type == types->db_type) && + (*types->value == SHOW_OPTION_YES)) + return TRUE; + } + return FALSE; +} + + /* Use other database handler if databasehandler is not incompiled */ enum db_type ha_checktype(enum db_type database_type) --- 1.136/sql/handler.h 2005-04-07 02:16:34 -07:00 +++ 1.137/sql/handler.h 2005-04-13 18:25:28 -07:00 @@ -542,6 +542,7 @@ int ha_panic(enum ha_panic_function flag); void ha_close_connection(THD* thd); enum db_type ha_checktype(enum db_type database_type); +my_bool ha_storage_engine_is_enabled(enum db_type database_type); int ha_create_table(const char *name, HA_CREATE_INFO *create_info, bool update_create_info); int ha_create_table_from_engine(THD* thd, const char *db, const char *name, --- 1.570/sql/mysqld.cc 2005-04-13 05:05:50 -07:00 +++ 1.571/sql/mysqld.cc 2005-04-13 18:25:28 -07:00 @@ -6435,6 +6435,18 @@ sql_print_warning("this binary does not contain BDB storage engine"); #endif + /* + Check that the default storage engine is actually available. + */ + if (!ha_storage_engine_is_enabled((enum db_type) + global_system_variables.table_type)) + { + sql_print_error("Default storage engine (%s) is not available", + ha_get_storage_engine((enum db_type) + global_system_variables.table_type)); + exit(1); + } + if (argc > 0) { fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv);