Commit eab917db authored by unknown's avatar unknown

ndb - fiexed for bug#15021, binlog_index table become inconsistent if errors...

ndb - fiexed for bug#15021, binlog_index table become inconsistent if errors during purge of binlogs.

improved the original patch, changed if/else to switch/case.


sql/table.cc:
  changed if/else to switch/case.
parent 885b6328
...@@ -1553,17 +1553,17 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, ...@@ -1553,17 +1553,17 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->file->auto_repair() && outparam->file->auto_repair() &&
!(ha_open_flags & HA_OPEN_FOR_REPAIR)); !(ha_open_flags & HA_OPEN_FOR_REPAIR));
if (ha_err == HA_ERR_NO_SUCH_TABLE) switch (ha_err)
{ {
case HA_ERR_NO_SUCH_TABLE:
/* /*
The table did not exists in storage engine, use same error message The table did not exists in storage engine, use same error message
as if the .frm file didn't exist as if the .frm file didn't exist
*/ */
error= 1; error= 1;
my_errno= ENOENT; my_errno= ENOENT;
} break;
else if (ha_err == EMFILE) case EMFILE:
{
/* /*
Too many files opened, use same error message as if the .frm Too many files opened, use same error message as if the .frm
file can't open file can't open
...@@ -1572,13 +1572,13 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, ...@@ -1572,13 +1572,13 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
share->normalized_path.str, ha_err)); share->normalized_path.str, ha_err));
error= 1; error= 1;
my_errno= EMFILE; my_errno= EMFILE;
} break;
else default:
{
outparam->file->print_error(ha_err, MYF(0)); outparam->file->print_error(ha_err, MYF(0));
error_reported= TRUE; error_reported= TRUE;
if (ha_err == HA_ERR_TABLE_DEF_CHANGED) if (ha_err == HA_ERR_TABLE_DEF_CHANGED)
error= 7; error= 7;
break;
} }
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment