mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed problem when comparing a key for a multi-byte-character set. (bug 152)
Use 0x.... as strings if 'new' mode. (bug 152) Don't report -max on windows when InnoDB is enabled. (bug 332) Reset current_linfo; This could cause a hang when doing PURGE LOGS. Fix for row numbers in EXPLAIN (bug 322) Fix that USE_FRM works for all table types (bug 97) VC++Files/libmysql/libmysql.dsp: Added new source files myisam/mi_key.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_range.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_rkey.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_search.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_test2.c: Fixed printf statements myisam/myisamdef.h: Fixed problem when comparing a key for a multi-byte-character set. myisam/sort.c: Fixed printf statements mysql-test/r/ctype_latin1_de.result: New test results mysql-test/r/join.result: New test results mysql-test/r/repair.result: New test results mysql-test/r/rpl_alter.result: New test results mysql-test/t/ctype_latin1_de-master.opt: --new is needed to get 0x... strings to work properly mysql-test/t/ctype_latin1_de.test: New test for latin1_de mysql-test/t/repair.test: Test of USE_FRM and HEAP tables sql/field.cc: Fixed problem when comparing a key for a multi-byte-character set. sql/item.cc: Use 0x.... as strings if 'new' mode sql/item.h: Use 0x.... as strings if 'new' mode sql/mysqld.cc: Don't report -max on windows when InnoDB is enabled. sql/sql_analyse.cc: Removed unused variable sql/sql_insert.cc: Removed debug message sql/sql_repl.cc: Reset current_linfo; This could cause a hang when doing PURGE LOGS. sql/sql_select.cc: Fix for row numbers in EXPLAIN sql/sql_table.cc: Fix that USE_FRM works for all table types (without strange errors) sql/sql_yacc.yy: Removed compiler warnings.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#endif
|
||||
#include <hash.h>
|
||||
#include <myisam.h>
|
||||
#include <my_dir.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef __WIN__
|
||||
@@ -1046,12 +1047,31 @@ static int prepare_for_repair(THD* thd, TABLE_LIST* table,
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
User gave us USE_FRM which means that the header in the index file is
|
||||
trashed.
|
||||
In this case we will try to fix the table the following way:
|
||||
- Rename the data file to a temporary name
|
||||
- Truncate the table
|
||||
- Replace the new data file with the old one
|
||||
- Run a normal repair using the new index file and the old data file
|
||||
*/
|
||||
|
||||
char from[FN_REFLEN],tmp[FN_REFLEN];
|
||||
char* db = thd->db ? thd->db : table->db;
|
||||
char from[FN_REFLEN],tmp[FN_REFLEN+32];
|
||||
const char **ext= table->table->file->bas_ext();
|
||||
MY_STAT stat_info;
|
||||
|
||||
/*
|
||||
Check if this is a table type that stores index and data separately,
|
||||
like ISAM or MyISAM
|
||||
*/
|
||||
if (!ext[0] || !ext[1])
|
||||
DBUG_RETURN(0); // No data file
|
||||
|
||||
strxmov(from, table->table->path, ext[1], NullS); // Name of data file
|
||||
if (!my_stat(from, &stat_info, MYF(0)))
|
||||
DBUG_RETURN(0); // Can't use USE_FRM flag
|
||||
|
||||
sprintf(from, "%s/%s/%s", mysql_real_data_home, db, table->real_name);
|
||||
fn_format(from, from, "", MI_NAME_DEXT, 4);
|
||||
sprintf(tmp,"%s-%lx_%lx", from, current_pid, thd->thread_id);
|
||||
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
@@ -1067,7 +1087,7 @@ static int prepare_for_repair(THD* thd, TABLE_LIST* table,
|
||||
unlock_table_name(thd, table);
|
||||
pthread_mutex_unlock(&LOCK_open);
|
||||
DBUG_RETURN(send_check_errmsg(thd, table, "repair",
|
||||
"Failed renaming .MYD file"));
|
||||
"Failed renaming data file"));
|
||||
}
|
||||
if (mysql_truncate(thd, table, 1))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user