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/sql_base.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/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 316ba28001a..a6b563046c7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -706,7 +706,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, /* make a new table */ if (!(table=(TABLE*) my_malloc(sizeof(*table),MYF(MY_WME)))) DBUG_RETURN(NULL); - if (open_unireg_entry(thd, table,db,table_name,alias,0) || + if (open_unireg_entry(thd, table,db,table_name,alias,1) || !(table->table_cache_key=memdup_root(&table->mem_root,(char*) key, key_length))) { @@ -1157,7 +1157,6 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, thd->net.last_error[0]=0; // Clear error message thd->net.last_errno=0; error=0; - sql_print_error("Warning: Repairing table: %s.%s",db,name); if (openfrm(path,alias, (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE | HA_GET_INDEX | HA_TRY_READ_ONLY), @@ -1167,11 +1166,17 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, (entry->file->is_crashed() && entry->file->check_and_repair(thd))) { sql_print_error("Error: Couldn't repair table: %s.%s",db,name); + closefrm(entry); error=1; } + else + { + thd->net.last_error[0]=0; // Clear error message + thd->net.last_errno=0; + } unlock_table_name(thd,&table_list); if (locked) - pthread_mutex_lock(&LOCK_open); // Get back old lock + pthread_mutex_lock(&LOCK_open); // Get back original lock if (error) goto err; } |