summaryrefslogtreecommitdiff
path: root/storage/archive
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-02-24 16:52:27 +0300
committerAlexander Nozdrin <alik@sun.com>2010-02-24 16:52:27 +0300
commitb3018e86132ff94ef7bde5d593b0c529cb10eced (patch)
tree46d0af1ca06ba43198a4cde04fa6f0a3937b0118 /storage/archive
parent5fb9f61e4faf24cbc364108c0709fa935f2c3a09 (diff)
parent4709825c608fdcf2af29a472a61be6cfe7040d5e (diff)
downloadmariadb-git-b3018e86132ff94ef7bde5d593b0c529cb10eced.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - client/mysql.cc - client/mysqldump.c - configure.in - mysql-test/r/csv.result - mysql-test/r/func_time.result - mysql-test/r/show_check.result - mysql-test/r/sp-error.result - mysql-test/r/sp.result - mysql-test/r/sp_trans.result - mysql-test/r/type_blob.result - mysql-test/r/type_timestamp.result - mysql-test/r/warnings.result - mysql-test/suite/rpl/r/rpl_sp.result - sql/mysql_priv.h - sql/mysqld.cc - sql/sp.cc - sql/sql_base.cc - sql/sql_table.cc - sql/sql_trigger.cc - sql/sql_view.cc - sql/table.h - sql/share/errmsg.txt - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
Diffstat (limited to 'storage/archive')
-rw-r--r--storage/archive/ha_archive.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index d902a4557dc..f95a7252f2f 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -384,6 +384,9 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, int *rc)
*/
if (!(azopen(&archive_tmp, share->data_file_name, O_RDONLY|O_BINARY)))
{
+ *rc= my_errno ? my_errno : -1;
+ mysql_mutex_unlock(&archive_mutex);
+ my_free(share, MYF(0));
DBUG_RETURN(NULL);
}
stats.auto_increment_value= archive_tmp.auto_increment + 1;
@@ -533,16 +536,18 @@ int ha_archive::open(const char *name, int mode, uint open_options)
For now we have to refuse to open such table to avoid
potential data loss.
*/
- if ((rc == HA_ERR_CRASHED_ON_USAGE && !(open_options & HA_OPEN_FOR_REPAIR))
- || rc == HA_ERR_TABLE_NEEDS_UPGRADE)
+ switch (rc)
{
- /* purecov: begin inspected */
+ case 0:
+ break;
+ case HA_ERR_CRASHED_ON_USAGE:
+ if (open_options & HA_OPEN_FOR_REPAIR)
+ break;
+ /* fall through */
+ case HA_ERR_TABLE_NEEDS_UPGRADE:
free_share();
- DBUG_RETURN(rc);
- /* purecov: end */
- }
- else if (rc == HA_ERR_OUT_OF_MEM)
- {
+ /* fall through */
+ default:
DBUG_RETURN(rc);
}