diff options
author | unknown <monty@donna.mysql.com> | 2001-01-31 04:47:25 +0200 |
---|---|---|
committer | unknown <monty@donna.mysql.com> | 2001-01-31 04:47:25 +0200 |
commit | 495231ea25a82d97e69e96ff9e5d7688434cfff2 (patch) | |
tree | 851a8ba92ed9883efe2504e0726aae6843c317c0 /myisam/mi_check.c | |
parent | bf1f8fd3eb4b98dadd265f8ed10d92220dabe1bb (diff) | |
download | mariadb-git-495231ea25a82d97e69e96ff9e5d7688434cfff2.tar.gz |
New myisamchk option --sort-recover
Allow delete of crashed MyISAM tables
Fixed bug when BLOB was first part of key
Fixed bug when using result from CASE in GROUP BY
Fixed core-dump bug in monthname()
Optimized calling of check_db_name()
Docs/manual.texi:
Added more information about myisamchk
client/mysqladmin.c:
Added error message for CREATE database and fixed possible overflow bug
include/myisam.h:
New myisamchk option --sort-recover
libmysql/libmysql.c:
Removed commented code
Don't define getpwuid (breaks on SCO 3.2)
myisam/mi_check.c:
Fixed (new) bug when using --recover --optimize
myisam/mi_delete_table.c:
Allow delete of crashed tables
myisam/mi_key.c:
Fixed bug when BLOB was first part of key
myisam/myisamchk.c:
New myisamchk option --sort-recover
mysql-test/r/case.result:
New test cases to check for reported bugs
mysql-test/r/func_time.result:
New test cases to check for reported bugs
mysql-test/r/type_blob.result:
New test cases to check for reported bugs
mysql-test/r/type_datetime.result:
New test cases to check for reported bugs
mysql-test/t/case.test:
New test cases to check for reported bugs
mysql-test/t/func_time.test:
New test cases to check for reported bugs
mysql-test/t/type_blob.test:
New test cases to check for reported bugs
mysql-test/t/type_datetime.test:
New test cases to check for reported bugs
mysys/my_bitmap.c:
Optimize
sql-bench/limits/ms-sql.cfg:
Updated limits
sql/item_cmpfunc.cc:
Fixed bug when using result from CASE in GROUP BY
sql/item_cmpfunc.h:
Fixed bug when using result from CASE in GROUP BY
sql/item_timefunc.cc:
Fixed core-dump bug in monthname()
sql/sql_db.cc:
Optimized calling of check_db_name()
sql/sql_parse.cc:
Optimized calling of check_db_name()
sql/table.cc:
Fixed typo
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r-- | myisam/mi_check.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 467e9a9bcb4..2736e98cea9 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1464,6 +1464,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) my_off_t index_pos[MI_MAX_POSSIBLE_KEY]; uint r_locks,w_locks; MYISAM_SHARE *share=info->s; + MI_STATE_INFO old_state; DBUG_ENTER("sort_index"); if (!(param->testflag & T_SILENT)) @@ -1502,9 +1503,10 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) /* Flush key cache for this file if we are calling this outside myisamchk */ flush_key_blocks(share->kfile, FLUSH_IGNORE_CHANGED); - /* Put same locks as old file */ share->state.version=(ulong) time((time_t*) 0); + old_state=share->state; /* save state if not stored */ r_locks=share->r_locks; w_locks=share->w_locks; + /* Put same locks as old file */ share->r_locks=share->w_locks=0; (void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); VOID(my_close(share->kfile,MYF(MY_WME))); @@ -1518,6 +1520,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name) _mi_readinfo(info,F_WRLCK,0); /* Will lock the table */ info->lock_type=F_WRLCK; share->r_locks=r_locks; share->w_locks=w_locks; + share->state=old_state; /* Restore old state */ info->state->key_file_length=param->new_file_pos; info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); @@ -3144,7 +3147,7 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) */ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, - my_bool force __attribute__((unused))) + my_bool force) { MYISAM_SHARE *share=info->s; uint i; @@ -3160,7 +3163,8 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, is very time-consuming process, it's better to leave it to repair stage but this repair shouldn't be repair_by_sort (serg) */ - if (mi_too_big_key_for_sort(key,rows) || (key->flag & HA_FULLTEXT)) + if (!force && mi_too_big_key_for_sort(key,rows) || + (key->flag & HA_FULLTEXT)) return FALSE; } return TRUE; |