summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-09-10 18:01:27 +0300
committerMichael Widenius <monty@askmonty.org>2011-09-10 18:01:27 +0300
commit3fb22ac5e146e1fe34d282c3c3ef6bd50af90ca5 (patch)
tree4f069ae5398a3e17417f942cb6926c66efe968a6 /storage
parent3769841d9e706ee018d5273d2901954b9a281c3e (diff)
parent0db9c26b05439f9d6fc29234966f50d8e393dfe2 (diff)
downloadmariadb-git-3fb22ac5e146e1fe34d282c3c3ef6bd50af90ca5.tar.gz
Merge with 5.2
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/ha_myisam.cc1
-rw-r--r--storage/myisam/mi_check.c37
-rw-r--r--storage/myisam/myisamchk.c1
-rw-r--r--storage/pbxt/src/thread_xt.cc2
4 files changed, 32 insertions, 9 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 97815205586..e6ad635c885 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -528,6 +528,7 @@ void mi_check_print_info(HA_CHECK *param, const char *fmt,...)
va_list args;
va_start(args, fmt);
mi_check_print_msg(param, "info", fmt, args);
+ param->note_printed= 1;
va_end(args);
}
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index d97ae41ecc7..515b506bad4 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -1346,7 +1346,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
}
if (param->testflag & T_INFO)
{
- if (param->warning_printed || param->error_printed)
+ if (param->warning_printed || param->error_printed || param->note_printed)
puts("");
if (used != 0 && ! param->error_printed)
{
@@ -1540,8 +1540,7 @@ int mi_repair(HA_CHECK *param, register MI_INFO *info,
new_file= -1;
sort_param.sort_info=&sort_info;
param->retry_repair= 0;
- param->warning_printed= 0;
- param->error_printed= 0;
+ param->warning_printed= param->error_printed= param->note_printed= 0;
if (!(param->testflag & T_SILENT))
{
@@ -2248,8 +2247,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
}
param->testflag|=T_REP; /* for easy checking */
param->retry_repair= 0;
- param->warning_printed= 0;
- param->error_printed= 0;
+ param->warning_printed= param->error_printed= param->note_printed= 0;
if (info->s->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
param->testflag|=T_CALC_CHECKSUM;
@@ -2577,6 +2575,8 @@ err:
param->retry_repair= 0; /* Safety */
}
mi_mark_crashed_on_repair(info);
+ if (killed_ptr(param))
+ param->retry_repair= 0; /* No use to retry repair */
}
else if (key_map == share->state.key_map)
share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS;
@@ -3112,6 +3112,8 @@ err:
param->retry_repair= 0; /* Safety */
}
mi_mark_crashed_on_repair(info);
+ if (killed_ptr(param))
+ param->retry_repair= 0;
}
else if (key_map == share->state.key_map)
share->state.changed&= ~STATE_NOT_OPTIMIZED_KEYS;
@@ -3147,7 +3149,13 @@ static int sort_key_read(MI_SORT_PARAM *sort_param, void *key)
DBUG_ENTER("sort_key_read");
if ((error=sort_get_next_record(sort_param)))
+ {
+ DBUG_ASSERT(error < 0 ||
+ sort_info->param->error_printed ||
+ sort_info->param->warning_printed ||
+ sort_info->param->note_printed);
DBUG_RETURN(error);
+ }
if (info->state->records == sort_info->max_records)
{
mi_check_print_error(sort_info->param,
@@ -3264,7 +3272,12 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
DBUG_ENTER("sort_get_next_record");
if (killed_ptr(param))
+ {
+ mi_check_print_error(param, "Repair killed by user with cause: %d",
+ (int) killed_ptr(param));
+ param->retry_repair= 0;
DBUG_RETURN(1);
+ }
switch (share->data_file_type) {
case STATIC_RECORD:
@@ -3350,6 +3363,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
}
if (searching && ! sort_param->fix_datafile)
{
+ mi_check_print_info(param,
+ "Datafile is corrupted; Restart repair with option to copy datafile");
param->error_printed=1;
param->retry_repair=1;
param->testflag|=T_RETRY_WITHOUT_QUICK;
@@ -3411,6 +3426,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
}
if (error)
{
+ DBUG_ASSERT(param->note_printed);
if (found_record)
goto try_next;
searching=1;
@@ -3451,7 +3467,11 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
share->state.split++;
}
if (found_record)
+ {
+ mi_check_print_info(param,
+ "Found row block followed by deleted block");
goto try_next;
+ }
if (searching)
{
pos+=MI_DYN_ALIGN_SIZE;
@@ -3485,6 +3505,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
mi_check_print_error(param,"Not enough memory for blob at %s (need %lu)",
llstr(sort_param->start_recpos,llbuff),
(ulong) block_info.rec_len);
+ DBUG_ASSERT(param->error_printed);
DBUG_RETURN(1);
}
else
@@ -3566,8 +3587,6 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
if (_mi_rec_unpack(info,sort_param->record,sort_param->rec_buff,
sort_param->find_length) != MY_FILE_ERROR)
{
- if (sort_param->read_cache.error < 0)
- DBUG_RETURN(1);
if (sort_param->calc_checksum)
info->checksum= (*info->s->calc_check_checksum)(info,
sort_param->record);
@@ -3593,6 +3612,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
sort_param->key+1,
llstr(sort_param->start_recpos,llbuff));
try_next:
+ DBUG_ASSERT(param->error_printed || param->note_printed);
pos=(sort_param->start_recpos+=MI_DYN_ALIGN_SIZE);
searching=1;
}
@@ -3664,6 +3684,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
DBUG_ASSERT(0); /* Impossible */
break;
}
+ DBUG_ASSERT(0); /* Impossible */
DBUG_RETURN(1); /* Impossible */
}
@@ -3722,7 +3743,7 @@ int sort_write_record(MI_SORT_PARAM *sort_param)
if (sort_info->buff_length < reclength)
{
if (!(sort_info->buff=my_realloc(sort_info->buff, (uint) reclength,
- MYF(MY_FREE_ON_ERROR |
+ MYF(MY_FREE_ON_ERROR | MY_WME |
MY_ALLOW_ZERO_PTR))))
DBUG_RETURN(1);
sort_info->buff_length=reclength;
diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c
index 8c54d7f0411..83a106c7941 100644
--- a/storage/myisam/myisamchk.c
+++ b/storage/myisam/myisamchk.c
@@ -1757,6 +1757,7 @@ void mi_check_print_info(HA_CHECK *param __attribute__((unused)),
{
va_list args;
+ param->note_printed=1;
va_start(args,fmt);
VOID(vfprintf(stdout, fmt, args));
VOID(fputc('\n',stdout));
diff --git a/storage/pbxt/src/thread_xt.cc b/storage/pbxt/src/thread_xt.cc
index eb9941f13fb..16abd96f983 100644
--- a/storage/pbxt/src/thread_xt.cc
+++ b/storage/pbxt/src/thread_xt.cc
@@ -1178,7 +1178,7 @@ xtPublic XTThreadPtr xt_init_threading(u_int max_threads)
#ifdef XT_TRACK_CONNECTIONS
if (xt_thr_maximum_threads > XT_TRACK_MAX_CONNS) {
xt_log_error(XT_NS_CONTEXT, XT_LOG_FATAL, XT_ERR_TOO_MANY_THREADS, 0,
- "XT_TRACK_CONNECTIONS is enabled and xt_thr_maximum_threads > XT_TRACK_MAX_CONNS");
+ "XT_TRACK_CONNECTIONS (debugging aid) is enabled and xt_thr_maximum_threads > XT_TRACK_MAX_CONNS. To continue restart with a smaller value for --max-connections");
goto failed;
}
#endif