summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2006-09-20 01:40:59 +0500
committerunknown <svoj@mysql.com/april.(none)>2006-09-20 01:40:59 +0500
commit485e862e043ac0a2be24cd12a10285c9d23cc23d (patch)
treedd33b5bc922fdbbd7b0aba0317f1fa251a8787e2 /sql/table.cc
parentd10d0af5e5cf77c8dbd4f27d8f612b05d59f0df9 (diff)
downloadmariadb-git-485e862e043ac0a2be24cd12a10285c9d23cc23d.tar.gz
BUG#10974 - No error message if merge table based on union of innodb, memory
Fixed confusing error message from the storage engine when it fails to open underlying table. The error message is issued when a table is _opened_ (not when it is created). myisammrg/myrg_open.c: Set my_errno to HA_ERR_WRONG_MRG_TABLE_DEF if attempt to open underlying table failed. mysql-test/r/merge.result: A test case for bug#10974. mysql-test/r/repair.result: Fixed a test case according to patch for bug#10974. mysql-test/t/merge.test: A test case for bug#10974. sql/share/english/errmsg.txt: Better error message if we fail to open underlying table. sql/table.cc: Report error from handler with print_error instead of frm_error. This fixes confusing error message from the handler. Actually this is backported from 5.0.
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 7587531b2f9..7680c1ff7c0 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -77,6 +77,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
my_string record;
const char **int_array;
bool use_hash, null_field_first;
+ bool error_reported= FALSE;
File file;
Field **field_ptr,*reg_field;
KEY *keyinfo;
@@ -791,6 +792,11 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
error= 1;
my_errno= ENOENT;
}
+ else
+ {
+ outparam->file->print_error(err, MYF(0));
+ error_reported= TRUE;
+ }
goto err_not_open; /* purecov: inspected */
}
}
@@ -812,7 +818,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
err_end: /* Here when no file */
delete crypted;
*root_ptr= old_root;
- frm_error(error, outparam, name, ME_ERROR + ME_WAITTANG, errarg);
+ if (!error_reported)
+ frm_error(error, outparam, name, ME_ERROR + ME_WAITTANG, errarg);
delete outparam->file;
outparam->file=0; // For easyer errorchecking
outparam->db_stat=0;