diff options
author | unknown <serg@sergbook.mysql.com> | 2006-05-28 14:51:01 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2006-05-28 14:51:01 +0200 |
commit | e2e582d1fba236d40e7233dcdb47d46618529390 (patch) | |
tree | f608495a4495b48130506f40d940b93ebdb1bfe1 /sql/sql_show.cc | |
parent | cccd302c91a0bfb82ed6b387016a12a23420fb6f (diff) | |
download | mariadb-git-e2e582d1fba236d40e7233dcdb47d46618529390.tar.gz |
handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().
mysql-test-run.pl bugfixes
include/mysql/plugin.h:
added st_mysql_storage_engine
made handlerton tied to MySQL version
mysql-test/mysql-test-run.pl:
bugfixes (umask, --no-defaults)
mysql-test/r/ndb_dd_basic.result:
update error message
mysql-test/t/partition_mgm_err2.test:
fix typo
sql/ha_berkeley.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_berkeley.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_federated.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_heap.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisam.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisammrg.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster_binlog.cc:
no 'name' in the handlerton anymore
sql/ha_partition.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/handler.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
handlerton->plugin mapping
sql/handler.h:
handlerton cleanup: remove duplicate fields
sql/log.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/mysql_priv.h:
handler.h needs plugin.h
sql/mysqld.cc:
Convert --default-storage-engine to a handlerton* when
all storage engines are initialized and not in getopt
sql/set_var.cc:
no name in the handlerton anymore
sql/sql_parse.cc:
no default_hton anymore
sql/sql_partition.cc:
no name in the handlerton anymore
sql/sql_plugin.cc:
generalize plugin type-specific initialization.
initialize built-in plugins too
sql/sql_plugin.h:
generalize plugin type-specific initialization.
sql/sql_show.cc:
st_mysql_storage_engine structure
no name in the handlerton anymore
sql/sql_table.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_tablespace.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_yacc.yy:
no default_hton anymore
issue "unknown storage engine" warning where it is discovered
storage/archive/ha_archive.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/archive/ha_archive.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/blackhole/ha_blackhole.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/csv/ha_tina.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/example/ha_example.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 5fad0c7e09b..d8ae1bc1abb 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -46,7 +46,7 @@ static void store_key_options(THD *thd, String *packet, TABLE *table, KEY *key_info); /*************************************************************************** -** List all table types supported +** List all table types supported ***************************************************************************/ static my_bool show_handlerton(THD *thd, st_plugin_int *plugin, @@ -54,25 +54,25 @@ static my_bool show_handlerton(THD *thd, st_plugin_int *plugin, { handlerton *default_type= (handlerton *) arg; Protocol *protocol= thd->protocol; - handlerton *hton= (handlerton *) plugin->plugin->info; + handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; if (!(hton->flags & HTON_HIDDEN)) { protocol->prepare_for_resend(); - protocol->store(hton->name, system_charset_info); + protocol->store(plugin->plugin->name, system_charset_info); const char *option_name= show_comp_option_name[(int) hton->state]; if (hton->state == SHOW_OPTION_YES && default_type == hton) option_name= "DEFAULT"; protocol->store(option_name, system_charset_info); - protocol->store(hton->comment, system_charset_info); + protocol->store(plugin->plugin->descr, system_charset_info); protocol->store(hton->commit ? "YES" : "NO", system_charset_info); protocol->store(hton->prepare ? "YES" : "NO", system_charset_info); protocol->store(hton->savepoint_set ? "YES" : "NO", system_charset_info); - + return protocol->write() ? 1 : 0; } - return 0; + return 0; } bool mysqld_show_storage_engines(THD *thd) @@ -92,7 +92,7 @@ bool mysqld_show_storage_engines(THD *thd) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); - if (plugin_foreach(thd, show_handlerton, + if (plugin_foreach(thd, show_handlerton, MYSQL_STORAGE_ENGINE_PLUGIN, thd->variables.table_type)) DBUG_RETURN(TRUE); @@ -3055,7 +3055,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, void *ptable) { TABLE *table= (TABLE *) ptable; - handlerton *hton= (handlerton *) plugin->plugin->info; + handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; const char *wild= thd->lex->wild ? thd->lex->wild->ptr() : NullS; CHARSET_INFO *scs= system_charset_info; DBUG_ENTER("iter_schema_engines"); @@ -3063,21 +3063,26 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, if (!(hton->flags & HTON_HIDDEN)) { if (!(wild && wild[0] && - wild_case_compare(scs, hton->name,wild))) + wild_case_compare(scs, plugin->plugin->name,wild))) { - const char *tmp; + LEX_STRING state[2]={{STRING_WITH_LEN("ENABLED")}, + {STRING_WITH_LEN("DISABLED")}}; + LEX_STRING yesno[2]={{STRING_WITH_LEN("NO")}, {STRING_WITH_LEN("YES")}}; + LEX_STRING *tmp; restore_record(table, s->default_values); - table->field[0]->store(hton->name, strlen(hton->name), scs); - tmp= hton->state ? "DISABLED" : "ENABLED"; - table->field[1]->store( tmp, strlen(tmp), scs); - table->field[2]->store(hton->comment, strlen(hton->comment), scs); - tmp= hton->commit ? "YES" : "NO"; - table->field[3]->store( tmp, strlen(tmp), scs); - tmp= hton->prepare ? "YES" : "NO"; - table->field[4]->store( tmp, strlen(tmp), scs); - tmp= hton->savepoint_set ? "YES" : "NO"; - table->field[5]->store( tmp, strlen(tmp), scs); + table->field[0]->store(plugin->plugin->name, + strlen(plugin->plugin->name), scs); + tmp= &state[test(hton->state)]; + table->field[1]->store(tmp->str, tmp->length, scs); + table->field[2]->store(plugin->plugin->descr, + strlen(plugin->plugin->descr), scs); + tmp= &yesno[test(hton->commit)]; + table->field[3]->store(tmp->str, tmp->length, scs); + tmp= &yesno[test(hton->prepare)]; + table->field[4]->store(tmp->str, tmp->length, scs); + tmp= &yesno[test(hton->savepoint_set)]; + table->field[5]->store(tmp->str, tmp->length, scs); if (schema_table_store_record(thd, table)) DBUG_RETURN(1); @@ -3089,7 +3094,7 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin, int fill_schema_engines(THD *thd, TABLE_LIST *tables, COND *cond) { - return plugin_foreach(thd, iter_schema_engines, + return plugin_foreach(thd, iter_schema_engines, MYSQL_STORAGE_ENGINE_PLUGIN, tables->table); } @@ -3104,7 +3109,7 @@ int fill_schema_collation(THD *thd, TABLE_LIST *tables, COND *cond) { CHARSET_INFO **cl; CHARSET_INFO *tmp_cs= cs[0]; - if (!tmp_cs || !(tmp_cs->state & MY_CS_AVAILABLE) || + if (!tmp_cs || !(tmp_cs->state & MY_CS_AVAILABLE) || (tmp_cs->state & MY_CS_HIDDEN) || !(tmp_cs->state & MY_CS_PRIMARY)) continue; @@ -4839,7 +4844,7 @@ static my_bool run_hton_fill_schema_files(THD *thd, st_plugin_int *plugin, { struct run_hton_fill_schema_files_args *args= (run_hton_fill_schema_files_args *) arg; - handlerton *hton= (handlerton *) plugin->plugin->info; + handlerton *hton= ((st_mysql_storage_engine *)plugin->plugin->info)->handlerton; if(hton->fill_files_table) hton->fill_files_table(thd, args->tables, args->cond); return false; |