diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-18 04:58:15 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-18 04:58:15 +0300 |
commit | c91a3df5c38ee5f4ebc7e42f0c17da79d4930801 (patch) | |
tree | 4ac99859c8cc85b07cbaadfa18dc36026c886644 /myisam | |
parent | 9d62e4a05b1c8399787b624a90e0cab0aa42c57c (diff) | |
download | mariadb-git-c91a3df5c38ee5f4ebc7e42f0c17da79d4930801.tar.gz |
Fix for LOAD DATA FROM MASTER when using tables with checksum
Fixed some wrong test cases
Docs/manual.texi:
Changelog
extra/perror.c:
Added BDB table errors
include/myisam.h:
Fix for LOAD DATA FROM MASTER when using tables with checksum
myisam/mi_check.c:
Fix for LOAD DATA FROM MASTER when using tables with checksum
mysql-test/mysql-test-run.sh:
Better logging
mysql-test/r/join.result:
Fixed missing results
mysql-test/r/rpl000006.result:
Updated result
mysql-test/t/join.test:
Fixed wrong test
mysql-test/t/rpl000001.test:
Fixed wrong test
mysql-test/t/rpl000006.test:
Cleanup
mysql-test/t/rpl000017-slave.sh:
Fixed too long password
mysql-test/t/rpl000017.test:
Fixed too long password
sql/ha_myisam.cc:
Fix for LOAD DATA FROM MASTER when using tables with checksum
sql/handler.cc:
Unique error for DEADLOCK
sql/slave.cc:
Fix for LOAD DATA FROM MASTER when using tables with checksum
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_check.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index aedea3ca78b..c4f37511ffa 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1191,8 +1191,12 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, del=info->state->del; info->state->records=info->state->del=share->state.split=0; info->state->empty=0; + param->glob_crc=0; + if (param->testflag & T_CALC_CHECKSUM) + param->calc_checksum=1; if (!rep_quick) share->state.checksum=0; + info->update= (short) (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); for (i=0 ; i < info->s->base.keys ; i++) share->state.key_root[i]= HA_OFFSET_ERROR; @@ -1284,7 +1288,14 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, share->state.version=(ulong) time((time_t*) 0); /* Force reopen */ } else + { info->state->data_file_length=sort_info->max_pos; + if (param->testflag & T_CALC_CHECKSUM) + { + DBUG_PRINT("QQ",("set_checksum")); + share->state.checksum=param->glob_crc; + } + } if (!(param->testflag & T_SILENT)) { @@ -1867,6 +1878,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, sort_param.sort_info=sort_info; del=info->state->del; + param->glob_crc=0; + if (param->testflag & T_CALC_CHECKSUM) + param->calc_checksum=1; if (! rep_quick) share->state.checksum=0; @@ -1912,6 +1926,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, param->retry_repair=1; goto err; } + param->calc_checksum=0; /* No need to calc glob_crc */ /* Set for next loop */ sort_param.max_records=sort_info->max_records= @@ -1987,6 +2002,9 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, "Can't change size of datafile, error: %d", my_errno); } + else if (param->testflag & T_CALC_CHECKSUM) + share->state.checksum=param->glob_crc; + if (my_chsize(share->kfile,info->state->key_file_length,MYF(0))) mi_check_print_warning(param, "Can't change size of indexfile, error: %d", @@ -2116,7 +2134,14 @@ static int sort_get_next_record(SORT_INFO *sort_info) sort_info->max_pos=(sort_info->pos+=share->base.pack_reclength); share->state.split++; if (*sort_info->record) + { + if (param->calc_checksum) + { + DBUG_PRINT("QQ",("calc_checksum")); + param->glob_crc+= mi_static_checksum(info,sort_info->record); + } DBUG_RETURN(0); + } if (!sort_info->fix_datafile) { info->state->del++; @@ -2348,10 +2373,10 @@ static int sort_get_next_record(SORT_INFO *sort_info) { if (param->read_cache.error < 0) DBUG_RETURN(1); + if (info->s->calc_checksum) + info->checksum=mi_checksum(info,sort_info->record); if ((param->testflag & (T_EXTEND | T_REP)) || searching) { - if (info->s->calc_checksum) - info->checksum=mi_checksum(info,sort_info->record); if (_mi_rec_check(info, sort_info->record)) { mi_check_print_info(param,"Found wrong packed record at %s", @@ -2359,6 +2384,8 @@ static int sort_get_next_record(SORT_INFO *sort_info) goto try_next; } } + if (param->calc_checksum) + param->glob_crc+= info->checksum; DBUG_RETURN(0); } if (!searching) @@ -2421,6 +2448,8 @@ static int sort_get_next_record(SORT_INFO *sort_info) block_info.rec_len); share->state.split++; info->packed_length=block_info.rec_len; + if (param->calc_checksum) + param->glob_crc+= info->checksum; DBUG_RETURN(0); } } |