First part of automatic repair of MyISAM tables.

Error on full disk on repair.
SIGHUP signal handling.
Update with keys on timestamp
Portability fixes


Docs/manual.texi:
  Added documentation about automatic repair of MyISAM tables
client/mysql.cc:
  Remove usage of tempnam.
include/my_sys.h:
  Added create_temp_file
include/myisam.h:
  Fix for disk full on repair
myisam/mi_check.c:
  Fix for disk full on repair
myisam/sort.c:
  Fix for disk full on repair & removed usage of tempnam()
mysys/mf_cache.c:
  Remove usage of tempnam()
mysys/mf_dirname.c:
  Changed convert_dirname to return end 0
mysys/my_fopen.c:
  Security fixes
mysys/my_tempnam.c:
  remove blanks
readline/bind.c:
  Portability fixes
readline/complete.c:
  Portability fixes
readline/histexpand.c:
  Portability fixes
readline/input.c:
  Portability fixes
readline/search.c:
  Portability fixes
readline/shell.c:
  Portability fixes
readline/terminal.c:
  Portability fixes
readline/tilde.c:
  Portability fixes
readline/undo.c:
  Portability fixes
regex/cname.h:
  Portability fixes
regex/debug.c:
  Portability fixes
regex/main.c:
  Portability fixes
regex/regcomp.c:
  Portability fixes
regex/regerror.c:
  Portability fixes
sql/filesort.cc:
  Remove dummy code
sql/ha_myisam.cc:
  Automatic repair of MyISAM tables
sql/ha_myisam.h:
  Automatic repair of MyISAM tables
sql/handler.cc:
  Automatic repair of MyISAM tables
sql/handler.h:
  Automatic repair of MyISAM tables
sql/key.cc:
  Fix for UPDATE with key on timestamp column
sql/mysql_priv.h:
  Automatic repair of MyISAM tables
sql/mysqld.cc:
  Automatic repair of MyISAM tables & signal SIGHUP handling
sql/sql_base.cc:
  Automatic repair of MyISAM tables
sql/sql_class.cc:
  Automatic repair of MyISAM tables
sql/sql_class.h:
  Fix for insert with reference to columns
sql/sql_insert.cc:
  Fix for insert with reference to columns
sql/table.cc:
  Automatic repair of MyISAM tables
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
This commit is contained in:
unknown 2000-10-03 14:18:03 +03:00
commit 63b7b45ff7
38 changed files with 570 additions and 419 deletions

View file

@ -24,12 +24,14 @@
#include <myisam.h>
#include <ft_global.h>
enum myisam_recover_types { HA_RECOVER_NONE, HA_RECOVER_DEFAULT,
HA_RECOVER_BACKUP};
#define HA_RECOVER_NONE 0 // No automatic recover
#define HA_RECOVER_DEFAULT 1 // Automatic recover active
#define HA_RECOVER_BACKUP 2 // Make a backupfile on recover
#define HA_RECOVER_FORCE 4 // Recover even if we loose rows
extern ulong myisam_sort_buffer_size;
extern TYPELIB myisam_recover_typelib;
extern myisam_recover_types myisam_recover_type;
extern ulong myisam_recover_options;
class ha_myisam: public handler
{
@ -39,11 +41,12 @@ class ha_myisam: public handler
public:
ha_myisam(TABLE *table): handler(table), file(0),
int_option_flag(HA_READ_NEXT+HA_READ_PREV+HA_READ_RND_SAME+
HA_KEYPOS_TO_RNDPOS+ HA_READ_ORDER+ HA_LASTKEY_ORDER+
HA_HAVE_KEY_READ_ONLY+ HA_READ_NOT_EXACT_KEY+
HA_LONGLONG_KEYS+ HA_NULL_KEY +
HA_DUPP_POS + HA_BLOB_KEY + HA_AUTO_PART_KEY)
int_option_flag(HA_READ_NEXT | HA_READ_PREV | HA_READ_RND_SAME |
HA_KEYPOS_TO_RNDPOS | HA_READ_ORDER | HA_LASTKEY_ORDER |
HA_HAVE_KEY_READ_ONLY | HA_READ_NOT_EXACT_KEY |
HA_LONGLONG_KEYS | HA_NULL_KEY |
HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY |
HA_CHECK_AND_REPAIR)
{}
~ha_myisam() {}
const char *table_type() const { return "MyISAM"; }
@ -100,6 +103,7 @@ class ha_myisam: public handler
int check(THD* thd, HA_CHECK_OPT* check_opt);
int analyze(THD* thd,HA_CHECK_OPT* check_opt);
int repair(THD* thd, HA_CHECK_OPT* check_opt);
bool check_and_repair(THD *thd, const char *name);
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int restore(THD* thd, HA_CHECK_OPT* check_opt);
int backup(THD* thd, HA_CHECK_OPT* check_opt);