diff options
author | unknown <acurtis@poseidon.ndb.mysql.com> | 2005-11-07 16:25:06 +0100 |
---|---|---|
committer | unknown <acurtis@poseidon.ndb.mysql.com> | 2005-11-07 16:25:06 +0100 |
commit | 6b3a9caef9b8cf42f8a706f778bba72db89cdd2b (patch) | |
tree | 2b8ffe29d899326e4ad244ac3f67d4fcf29bfae6 /sql/examples | |
parent | df33aacd87ff08c27fd371a0bb348fe3986e6f95 (diff) | |
download | mariadb-git-6b3a9caef9b8cf42f8a706f778bba72db89cdd2b.tar.gz |
Make storage engines "pluggable", handlerton work
Makefile.am:
Changes to autoconf subst
config/ac-macros/ha_berkeley.m4:
simplify
config/ac-macros/ha_ndbcluster.m4:
simplify
config/ac-macros/ha_partition.m4:
simplify
configure.in:
strip configure of storage engine specific cruft and simplify
extra/Makefile.am:
changes to autoconf/automake subst
libmysqld/Makefile.am:
only compile storage engines if required.
make find object file a little smarter
libmysqld/examples/Makefile.am:
changes to autoconf subst
mysql-test/Makefile.am:
remove storage engine specific cruft
mysql-test/r/ps_1general.result:
cannot gaurantee order of results from 'show storage engines'
mysql-test/r/show_check.result:
fix test - frm file fails to be deleted if it is invalid
mysql-test/r/sql_mode.result:
isam does not exist, test may need to be redone/fixed in 5.0
mysql-test/r/warnings.result:
isam no longer exists
mysql-test/t/ps_1general.test:
cannot gaurantee order of results from 'show storage engines'
mysql-test/t/show_check.test:
fix test - frm file fails to be deleted if it is invalid
mysql-test/t/sql_mode.test:
isam does not exist, test may need to be redone/fixed in 5.0
mysql-test/t/system_mysql_db_fix.test:
change isam to myisam
mysql-test/t/view.test:
change isam to myisam
mysql-test/t/warnings.test:
isam no longer exists
sql/Makefile.am:
Make storage engines "pluggable" stage 1
only compile storage engines if included
sql/examples/ha_example.cc:
handlerton work
sql/examples/ha_example.h:
handlerton work
sql/examples/ha_tina.cc:
handlerton work
sql/examples/ha_tina.h:
handlerton work
sql/ha_archive.cc:
handlerton work
sql/ha_archive.h:
handlerton work
sql/ha_berkeley.cc:
handlerton work
sql/ha_berkeley.h:
handlerton work
sql/ha_blackhole.cc:
handlerton work
sql/ha_federated.cc:
handlerton work
sql/ha_federated.h:
handlerton work
sql/ha_heap.cc:
handlerton work
sql/ha_innodb.cc:
handlerton work
sql/ha_innodb.h:
handlerton work
sql/ha_myisam.cc:
handlerton work
sql/ha_myisammrg.cc:
handlerton work
sql/ha_ndbcluster.cc:
handlerton work
sql/ha_ndbcluster.h:
handlerton work
sql/ha_partition.cc:
handlerton work
sql/handler.cc:
start removing storage engine specific cruft
sql/handler.h:
start removing storage engine specific cruft
db_type for binlog handlerton
handlerton flag for not-user-selectable storage engines
sql/lex.h:
start removing storage engine specific cruft
sql/log.cc:
handlerton work
give binlog handlerton a 'real' db_type
sql/mysql_priv.h:
start removing storage engine specific cruft
sql/mysqld.cc:
start removing storage engine specific cruft
sql/set_var.cc:
start removing storage engine specific cruft
sql/sp_head.cc:
start removing storage engine specific cruft
sql/sql_class.cc:
start removing storage engine specific cruft
sql/sql_class.h:
start removing storage engine specific cruft
sql/sql_lex.h:
start removing storage engine specific cruft
sql/sql_manager.cc:
start removing storage engine specific cruft
sql/sql_manager.h:
start removing storage engine specific cruft
sql/sql_parse.cc:
start removing storage engine specific cruft
sql/sql_partition.cc:
start removing storage engine specific cruft
sql/sql_prepare.cc:
start removing storage engine specific cruft
sql/sql_show.cc:
start removing storage engine specific cruft
sql/sql_table.cc:
changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
start removing storage engine specific cruft
sql/sql_update.cc:
changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/sql_yacc.yy:
start removing storage engine specific cruft
test if we should throw error
sql/table.cc:
changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/table.h:
changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
sql/unireg.cc:
changed define from HAVE_PARTITION_DB to WITH_PARTITION_STORAGE_ENGINE
storage/ndb/include/kernel/kernel_types.h:
added my_config.h
storage/ndb/include/ndb_global.h.in:
added my_config.h
storage/ndb/include/ndb_types.h.in:
added my_config.h
config/ac-macros/storage.m4:
New BitKeeper file ``config/ac-macros/storage.m4''
sql/handlerton.cc.in:
New BitKeeper file ``sql/handlerton.cc.in''
Diffstat (limited to 'sql/examples')
-rw-r--r-- | sql/examples/ha_example.cc | 18 | ||||
-rw-r--r-- | sql/examples/ha_example.h | 1 | ||||
-rw-r--r-- | sql/examples/ha_tina.cc | 23 | ||||
-rw-r--r-- | sql/examples/ha_tina.h | 2 |
4 files changed, 36 insertions, 8 deletions
diff --git a/sql/examples/ha_example.cc b/sql/examples/ha_example.cc index d340b9289ec..68aed7c6483 100644 --- a/sql/examples/ha_example.cc +++ b/sql/examples/ha_example.cc @@ -69,9 +69,9 @@ #include "../mysql_priv.h" -#ifdef HAVE_EXAMPLE_DB #include "ha_example.h" +static handler* example_create_handler(TABLE *table); handlerton example_hton= { "EXAMPLE", @@ -94,6 +94,15 @@ handlerton example_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ + example_create_handler, /* Create a new handler */ + NULL, /* Drop a database */ + NULL, /* Panic call */ + NULL, /* Release temporary latches */ + NULL, /* Update Statistics */ + NULL, /* Start Consistent Snapshot */ + NULL, /* Flush logs */ + NULL, /* Show status */ + NULL, /* Replication Report Sent Binlog */ HTON_CAN_RECREATE }; @@ -204,6 +213,12 @@ static int free_share(EXAMPLE_SHARE *share) } +static handler* example_create_handler(TABLE *table) +{ + return new ha_example(table); +} + + ha_example::ha_example(TABLE *table_arg) :handler(&example_hton, table_arg) {} @@ -696,4 +711,3 @@ int ha_example::create(const char *name, TABLE *table_arg, /* This is not implemented but we want someone to be able that it works. */ DBUG_RETURN(0); } -#endif /* HAVE_EXAMPLE_DB */ diff --git a/sql/examples/ha_example.h b/sql/examples/ha_example.h index 37f38fe5210..d2ec83a5837 100644 --- a/sql/examples/ha_example.h +++ b/sql/examples/ha_example.h @@ -152,3 +152,4 @@ public: THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); //required }; + diff --git a/sql/examples/ha_tina.cc b/sql/examples/ha_tina.cc index 2c193f4ce84..46636b93d21 100644 --- a/sql/examples/ha_tina.cc +++ b/sql/examples/ha_tina.cc @@ -48,8 +48,6 @@ TODO: #include "mysql_priv.h" -#ifdef HAVE_CSV_DB - #include "ha_tina.h" #include <sys/mman.h> @@ -57,6 +55,7 @@ TODO: pthread_mutex_t tina_mutex; static HASH tina_open_tables; static int tina_init= 0; +static handler* tina_create_handler(TABLE *table); handlerton tina_hton= { "CSV", @@ -79,6 +78,15 @@ handlerton tina_hton= { NULL, /* create_cursor_read_view */ NULL, /* set_cursor_read_view */ NULL, /* close_cursor_read_view */ + tina_create_handler, /* Create a new handler */ + NULL, /* Drop a database */ + tina_end, /* Panic call */ + NULL, /* Release temporary latches */ + NULL, /* Update Statistics */ + NULL, /* Start Consistent Snapshot */ + NULL, /* Flush logs */ + NULL, /* Show status */ + NULL, /* Replication Report Sent Binlog */ HTON_CAN_RECREATE }; @@ -247,7 +255,7 @@ static int free_share(TINA_SHARE *share) DBUG_RETURN(result_code); } -bool tina_end() +int tina_end(ha_panic_function type) { if (tina_init) { @@ -255,7 +263,7 @@ bool tina_end() VOID(pthread_mutex_destroy(&tina_mutex)); } tina_init= 0; - return FALSE; + return 0; } /* @@ -272,6 +280,12 @@ byte * find_eoln(byte *data, off_t begin, off_t end) } +static handler* tina_create_handler(TABLE *table) +{ + return new ha_tina(table); +} + + ha_tina::ha_tina(TABLE *table_arg) :handler(&tina_hton, table_arg), /* @@ -909,4 +923,3 @@ int ha_tina::create(const char *name, TABLE *table_arg, DBUG_RETURN(0); } -#endif /* enable CSV */ diff --git a/sql/examples/ha_tina.h b/sql/examples/ha_tina.h index 0ac90a05812..2de6d8c8257 100644 --- a/sql/examples/ha_tina.h +++ b/sql/examples/ha_tina.h @@ -125,5 +125,5 @@ public: int chain_append(); }; -bool tina_end(); +int tina_end(ha_panic_function type); |