summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-03-09 15:47:59 +0200
committerMichael Widenius <monty@askmonty.org>2011-03-09 15:47:59 +0200
commit139a2b64bf8ec2e248656835e23a5c98ffc667a8 (patch)
tree7d77d6f1073f8090f275b30cb3f10254497da243 /sql/table.cc
parentb3f7eac5301529c2d069ebe4d0558980412af3a2 (diff)
parentce675406ca8dbc1532a908803a1371de8432d466 (diff)
downloadmariadb-git-139a2b64bf8ec2e248656835e23a5c98ffc667a8.tar.gz
Merge with 5.2
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/sql/table.cc b/sql/table.cc
index db10ddc8a14..d3295f9dc48 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2074,7 +2074,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
bool error_reported= FALSE;
uchar *record, *bitmaps;
Field **field_ptr, **vfield_ptr;
- bool save_view_prepare_mode= thd->lex->view_prepare_mode;
+ uint8 save_context_analysis_only= thd->lex->context_analysis_only;
DBUG_ENTER("open_table_from_share");
DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str,
share->table_name.str, (long) outparam));
@@ -2082,7 +2082,7 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
/* Parsing of partitioning information from .frm needs thd->lex set up. */
DBUG_ASSERT(thd->lex->is_lex_started);
- thd->lex->view_prepare_mode= FALSE; // not a view
+ thd->lex->context_analysis_only= 0; // not a view
error= 1;
bzero((char*) outparam, sizeof(*outparam));
@@ -2414,7 +2414,7 @@ partititon_err:
HA_HAS_OWN_BINLOGGING);
thd->status_var.opened_tables++;
- thd->lex->view_prepare_mode= save_view_prepare_mode;
+ thd->lex->context_analysis_only= save_context_analysis_only;
DBUG_RETURN (0);
err:
@@ -2427,7 +2427,7 @@ partititon_err:
#endif
outparam->file= 0; // For easier error checking
outparam->db_stat=0;
- thd->lex->view_prepare_mode= save_view_prepare_mode;
+ thd->lex->context_analysis_only= save_context_analysis_only;
free_root(&outparam->mem_root, MYF(0)); // Safe to call on bzero'd root
outparam->alias.free();
DBUG_RETURN (error);
@@ -2666,13 +2666,17 @@ void open_table_error(TABLE_SHARE *share, int error, int db_errno, int errarg)
{
int err_no;
char buff[FN_REFLEN];
- myf errortype= ME_ERROR+ME_WAITTANG;
+ myf errortype= ME_ERROR+ME_WAITTANG; // Write fatals error to log
DBUG_ENTER("open_table_error");
switch (error) {
case 7:
case 1:
- if (db_errno == ENOENT)
+ /*
+ Test if file didn't exists. We have to also test for EINVAL as this
+ may happen on windows when opening a file with a not legal file name
+ */
+ if (db_errno == ENOENT || db_errno == EINVAL)
my_error(ER_NO_SUCH_TABLE, MYF(0), share->db.str, share->table_name.str);
else
{