summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-09 15:34:09 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-09 15:34:09 +0200
commit5ad68a0d2f66b2d36f0a509c443829d58477caa2 (patch)
tree50db6c8c76f336bdecce14bdc8a64b6e4fd0e13f /sql/table.cc
parentcda52b2cb28091c4372880a2b68a9174f21bd885 (diff)
downloadmariadb-git-5ad68a0d2f66b2d36f0a509c443829d58477caa2.tar.gz
don't use I_S constants for open_table_def and get_table_share,
have a specially defined enum with clearly named values
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 46ac6578076..a0012e2e0d0 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -619,7 +619,7 @@ static bool has_disabled_path_chars(const char *str)
6 Unknown .frm version
*/
-int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
+int open_table_def(THD *thd, TABLE_SHARE *share, enum read_frm_op op)
{
int error, table_type;
bool error_given;
@@ -693,17 +693,11 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
if (head[2] == FRM_VER || head[2] == FRM_VER+1 ||
(head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4))
{
- /* Open view only */
- if (db_flags & OPEN_VIEW_ONLY)
- {
- error_given= 1;
- goto err;
- }
table_type= 1;
}
else
{
- error= 6; // Unkown .frm version
+ error= 6; // Unknown .frm version
goto err;
}
}
@@ -713,7 +707,7 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags)
if (memcmp(head+5,"VIEW",4) == 0)
{
share->is_view= 1;
- if (db_flags & OPEN_VIEW)
+ if (op == FRM_READ_NO_ERROR_FOR_VIEW)
error= 0;
}
goto err;