summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorbrian@zim.(none) <>2006-08-25 13:32:06 -0700
committerbrian@zim.(none) <>2006-08-25 13:32:06 -0700
commite831273902da0af8d48eab4b76a7c77a06fbc1aa (patch)
treec9713021de8bd6fe080871a0696691c85eb50e18 /sql/handler.cc
parentaeea252b4d6df74016db3b20f7535c9e832e3425 (diff)
parentbaa914e66d326925f4bd3bb52a8c31de530f7c8b (diff)
downloadmariadb-git-e831273902da0af8d48eab4b76a7c77a06fbc1aa.tar.gz
Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-arch
into zim.(none):/home/brian/mysql/arch-5.1
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc31
1 files changed, 27 insertions, 4 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 44c23f82b2b..835a53b94a3 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -2705,18 +2705,41 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
>0 : error. frmblob and frmlen may not be set
*/
+typedef struct st_discover_args
+{
+ const char *db;
+ const char *name;
+ const void** frmblob;
+ uint* frmlen;
+};
+
+static my_bool discover_handlerton(THD *thd, st_plugin_int *plugin,
+ void *arg)
+{
+ st_discover_args *vargs= (st_discover_args *)arg;
+ handlerton *hton= (handlerton *)plugin->data;
+ if (hton->state == SHOW_OPTION_YES && hton->discover &&
+ (!(hton->discover(thd, vargs->db, vargs->name, vargs->frmblob, vargs->frmlen))))
+ return TRUE;
+
+ return FALSE;
+}
+
int ha_discover(THD *thd, const char *db, const char *name,
const void **frmblob, uint *frmlen)
{
int error= -1; // Table does not exist in any handler
DBUG_ENTER("ha_discover");
DBUG_PRINT("enter", ("db: %s, name: %s", db, name));
+ st_discover_args args= {db, name, frmblob, frmlen};
+
if (is_prefix(name,tmp_file_prefix)) /* skip temporary tables */
DBUG_RETURN(error);
-#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
- if (have_ndbcluster == SHOW_OPTION_YES)
- error= ndbcluster_discover(thd, db, name, frmblob, frmlen);
-#endif
+
+ if (plugin_foreach(thd, discover_handlerton,
+ MYSQL_STORAGE_ENGINE_PLUGIN, &args))
+ error= 0;
+
if (!error)
statistic_increment(thd->status_var.ha_discover_count,&LOCK_status);
DBUG_RETURN(error);