summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordli@dev3-76.dev.cn.tlan <>2006-11-28 11:14:36 +0800
committerdli@dev3-76.dev.cn.tlan <>2006-11-28 11:14:36 +0800
commit95478c16da96ff4af0c8419da68719f0e4a7150f (patch)
tree52f18f72ad7aa9b3d7c99481f94f731eb9c11a77
parent4a0faf70c8761198cfc2ecd7b75668f0c173cd73 (diff)
downloadmariadb-git-95478c16da96ff4af0c8419da68719f0e4a7150f.tar.gz
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.
-rw-r--r--sql/table.cc50
1 files changed, 25 insertions, 25 deletions
diff --git a/sql/table.cc b/sql/table.cc
index fb05162061e..01e98a8f63f 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1553,32 +1553,32 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
outparam->file->auto_repair() &&
!(ha_open_flags & HA_OPEN_FOR_REPAIR));
- if (ha_err == HA_ERR_NO_SUCH_TABLE)
+ switch (ha_err)
{
- /*
- The table did not exists in storage engine, use same error message
- as if the .frm file didn't exist
- */
- error= 1;
- my_errno= ENOENT;
- }
- else if (ha_err == EMFILE)
- {
- /*
- Too many files opened, use same error message as if the .frm
- file can't open
- */
- DBUG_PRINT("error", ("open file: %s failed, too many files opened (errno: %d)",
- share->normalized_path.str, ha_err));
- error= 1;
- my_errno= EMFILE;
- }
- else
- {
- outparam->file->print_error(ha_err, MYF(0));
- error_reported= TRUE;
- if (ha_err == HA_ERR_TABLE_DEF_CHANGED)
- error= 7;
+ case HA_ERR_NO_SUCH_TABLE:
+ /*
+ The table did not exists in storage engine, use same error message
+ as if the .frm file didn't exist
+ */
+ error= 1;
+ my_errno= ENOENT;
+ break;
+ case EMFILE:
+ /*
+ Too many files opened, use same error message as if the .frm
+ file can't open
+ */
+ DBUG_PRINT("error", ("open file: %s failed, too many files opened (errno: %d)",
+ share->normalized_path.str, ha_err));
+ error= 1;
+ my_errno= EMFILE;
+ break;
+ default:
+ outparam->file->print_error(ha_err, MYF(0));
+ error_reported= TRUE;
+ if (ha_err == HA_ERR_TABLE_DEF_CHANGED)
+ error= 7;
+ break;
}
goto err; /* purecov: inspected */
}