diff options
author | unknown <monty@donna.mysql.com> | 2000-10-17 00:47:15 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2000-10-17 00:47:15 +0300 |
commit | 0c511215f23809c4b9e8f5c26ad96520252e7758 (patch) | |
tree | ab2709570d10aac2956fa63114d45c79b2b5ea19 /sql/handler.cc | |
parent | 9c019f4e4fc4d34f3c82723d1182f0917b9c5360 (diff) | |
download | mariadb-git-0c511215f23809c4b9e8f5c26ad96520252e7758.tar.gz |
Automatic repair of MyISAM tables + small bug fixes
Docs/manual.texi:
Updates for 3.23.26
include/Makefile.am:
Install my_config.h
include/my_pthread.h:
Fix for Ia64
myisam/mi_check.c:
Wrong new record pos on dupplicate key error
myisam/mi_open.c:
Fix for automatic repair
myisam/myisamchk.c:
Fix for automatic repair
myisam/myisamdef.h:
Fix for automatic repair
mysys/mf_tempfile.c:
Fix usage of mkstemp
sql-bench/bench-init.pl.sh:
Better help text
sql-bench/test-insert.sh:
Fix for slow databases
sql/field.cc:
Fix of default values for CREATE TABLE ... SELECT
sql/ha_berkeley.cc:
Fix bug in BDB records_in_range
sql/ha_myisam.cc:
Fix for automatic repair
sql/ha_myisam.h:
Fix for automatic repair
sql/handler.cc:
Fixes for innobase
sql/item_strfunc.cc:
Fix for SUBSTR_INDEX and REPLACE
sql/log_event.h:
Portability fix
sql/mysqld.cc:
Added INNOBASE and fixes for automatic recover of MyISAM tables
sql/sql_base.cc:
Fix for automatic repair
sql/sql_table.cc:
Fix for IF EXISTS when used with CREATE TEMPORARY
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; } |