summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
committerMichael Widenius <monty@askmonty.org>2011-02-28 19:39:30 +0200
commit3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e (patch)
treeda0e622896425203d23ecdfd1bc77b57e3502edf /sql/table.cc
parent869f5d0e81d5cbecaec3605f292fbb363b9ccbf6 (diff)
parentf83e594218a6d19da2fa1ea2a01d860c30fe2913 (diff)
downloadmariadb-git-3358cdd5048671ee6cbbf50c291f7e0d0fda8e1e.tar.gz
Merge with 5.1 to get in changes from MySQL 5.1.55
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 27d5b0643c7..d52c6bb085d 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -2084,7 +2084,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));
@@ -2092,7 +2092,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));
@@ -2422,7 +2422,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:
@@ -2435,7 +2435,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);
@@ -2674,13 +2674,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
{