1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Cleanup of unused variables.

Fixed "discover" in the handler API.

Fixed problem where handlerton was not zero'ed. I need to look around, I suspect this problem is more widespread.
This commit is contained in:
brian@zim.(none)
2006-08-25 13:31:15 -07:00
parent d41188130a
commit baa914e66d
7 changed files with 33 additions and 20 deletions

View File

@@ -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);