diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-08-30 18:07:40 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-08-30 18:07:40 +0400 |
commit | dc195adf34e58f9e4a7ba677cb0aa008d8a75c37 (patch) | |
tree | 0a5202757c09044f2c476f93621c75c9df31e32d /sql/handler.cc | |
parent | 6c64f826eb692dd8344770a32c2b6ff5351f6347 (diff) | |
parent | 862af4eeaaa89ea4f09491359d0a2dab77399924 (diff) | |
download | mariadb-git-dc195adf34e58f9e4a7ba677cb0aa008d8a75c37.tar.gz |
Auto-merge from mysql-5.5-merge.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 9893b3cac16..567dbe6ea49 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3670,6 +3670,34 @@ int ha_create_table_from_engine(THD* thd, const char *db, const char *name) DBUG_RETURN(error != 0); } + +/** + Try to find a table in a storage engine. + + @param db Normalized table schema name + @param name Normalized table name. + @param[out] exists Only valid if the function succeeded. + + @retval TRUE An error is found + @retval FALSE Success, check *exists +*/ + +bool +ha_check_if_table_exists(THD* thd, const char *db, const char *name, + bool *exists) +{ + uchar *frmblob= NULL; + size_t frmlen; + DBUG_ENTER("ha_check_if_table_exists"); + + *exists= ! ha_discover(thd, db, name, &frmblob, &frmlen); + if (*exists) + my_free(frmblob); + + DBUG_RETURN(FALSE); +} + + void st_ha_check_opt::init() { flags= sql_flags= 0; |