diff options
author | monty@donna.mysql.com <> | 2000-10-17 00:47:15 +0300 |
---|---|---|
committer | monty@donna.mysql.com <> | 2000-10-17 00:47:15 +0300 |
commit | 117d8b7f64bc9be9fa74a61644936031ef43e1ee (patch) | |
tree | ab2709570d10aac2956fa63114d45c79b2b5ea19 /sql/handler.cc | |
parent | 422979694649ad87e1406a8ea408467cbc4e5d0e (diff) | |
download | mariadb-git-117d8b7f64bc9be9fa74a61644936031ef43e1ee.tar.gz |
Automatic repair of MyISAM tables + small bug fixes
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index a0ec18d3614..c7353a864ff 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -32,6 +32,9 @@ #ifdef HAVE_BERKELEY_DB #include "ha_berkeley.h" #endif +#ifdef HAVE_INNOBASE_DB +#include "ha_innobase.h" +#endif #include <myisampack.h> #include <errno.h> @@ -46,7 +49,7 @@ ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count, const char *ha_table_type[] = { "", "DIAB_ISAM","HASH","MISAM","PISAM","RMS_ISAM","HEAP", "ISAM", - "MRG_ISAM","MYISAM", "MRG_MYISAM", "BERKELEY_DB?", "?", "?",NullS + "MRG_ISAM","MYISAM", "MRG_MYISAM", "BDB", "INNOBASE", "?", "?",NullS }; const char *ha_row_type[] = { @@ -66,6 +69,10 @@ enum db_type ha_checktype(enum db_type database_type) case DB_TYPE_BERKELEY_DB: return(berkeley_skip ? DB_TYPE_MYISAM : database_type); #endif +#ifdef HAVE_INNOBASE_DB + case DB_TYPE_INNOBASE: + return(innobase_skip ? DB_TYPE_MYISAM : database_type); +#endif #ifndef NO_HASH case DB_TYPE_HASH: #endif @@ -104,6 +111,10 @@ handler *get_new_handler(TABLE *table, enum db_type db_type) case DB_TYPE_BERKELEY_DB: return new ha_berkeley(table); #endif +#ifdef HAVE_INNOBASE_DB + case DB_TYPE_INNOBASE_DB: + return new ha_innobase(table); +#endif case DB_TYPE_HEAP: return new ha_heap(table); case DB_TYPE_MYISAM: @@ -124,6 +135,14 @@ int ha_init() return error; } #endif +#ifdef HAVE_INNOBASE_DB + if (!innobase_skip) + { + int error; + if ((error=innobase_init())) + return error; + } +#endif return 0; } @@ -147,6 +166,10 @@ int ha_panic(enum ha_panic_function flag) if (!berkeley_skip) error|=berkeley_end(); #endif +#ifdef HAVE_INNOBASE_DB + if (!innobase_skip) + error|=innobase_end(); +#endif return error; } /* ha_panic */ @@ -154,7 +177,7 @@ int ha_panic(enum ha_panic_function flag) int ha_autocommit_or_rollback(THD *thd, int error) { DBUG_ENTER("ha_autocommit_or_rollback"); -#ifdef HAVE_BERKELEY_DB +#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) if ((thd->options & OPTION_AUTO_COMMIT) && !thd->locked_tables) { if (!error) @@ -184,6 +207,17 @@ int ha_commit(THD *thd) } } #endif +#ifdef HAVE_INNOBASE_DB + if (thd->transaction.innobase_tid) + { + int error=innobase_commit(thd); + if (error) + { + my_error(ER_ERROR_DURING_COMMIT, MYF(0), error); + error=1; + } + } +#endif DBUG_RETURN(error); } @@ -202,6 +236,17 @@ int ha_rollback(THD *thd) } } #endif +#ifdef HAVE_INNOBASE_DB + if (thd->transaction.innobase_tid) + { + int error=innobase_rollback(thd); + if (error) + { + my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error); + error=1; + } + } +#endif DBUG_RETURN(error); } @@ -213,6 +258,10 @@ bool ha_flush_logs() if (!berkeley_skip && berkeley_flush_logs()) result=1; #endif +#ifdef HAVE_INNOBASE_DB + if (!innobase_skip && innobase_flush_logs()) + result=1; +#endif return result; } |