summaryrefslogtreecommitdiff
path: root/sql/datadict.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-09 15:50:30 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-09 15:50:30 +0200
commitcdc01e29d3a9f6d98aaa482363af81003485e256 (patch)
tree20c8ce171e2666e720ac5977561997038fe3c2f2 /sql/datadict.h
parent15c936e4b3d151346c027bd4b51b44c826b095b6 (diff)
downloadmariadb-git-cdc01e29d3a9f6d98aaa482363af81003485e256.tar.gz
remove dd_frm_type(), dd_frm_storage_engine(), dd_check_storage_engine_flag()
from everywhere - now RENAME, SHOW FULL TABLES, and TRUNCATE work with discovery. improve error messages in truncate
Diffstat (limited to 'sql/datadict.h')
-rw-r--r--sql/datadict.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/sql/datadict.h b/sql/datadict.h
index 9c625e6434c..dd80942daca 100644
--- a/sql/datadict.h
+++ b/sql/datadict.h
@@ -28,14 +28,21 @@ enum frm_type_enum
FRMTYPE_VIEW
};
+/*
+ Take extra care when using dd_frm_type() - it only checks the .frm file,
+ and it won't work for any engine that supports discovery.
+
+ Prefer to use ha_table_exists() instead.
+ To check whether it's an frm of a view, use dd_frm_is_view().
+*/
frm_type_enum dd_frm_type(THD *thd, char *path, enum legacy_db_type *dbt);
-bool dd_frm_storage_engine(THD *thd, const char *db, const char *table_name,
- handlerton **table_type);
-bool dd_check_storage_engine_flag(THD *thd,
- const char *db, const char *table_name,
- uint32 flag,
- bool *yes_no);
+static inline bool dd_frm_is_view(THD *thd, char *path)
+{
+ enum legacy_db_type not_used;
+ return dd_frm_type(thd, path, &not_used) == FRMTYPE_VIEW;
+}
+
bool dd_recreate_table(THD *thd, const char *db, const char *table_name,
const char *path = NULL);