From 9747c64a30a9d31dfd90a01b3df38a22234300a7 Mon Sep 17 00:00:00 2001 From: V Narayanan Date: Thu, 3 Dec 2009 16:16:49 +0530 Subject: WL#4448 Generalize the handlerton::fill_files_table call with handlerton::fill_is_table The attached patch adds a method handlerton::fill_is_table that can be used instead of having to create specific handlerton::fill_*_table methods. --- sql/ha_ndbcluster.cc | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'sql/ha_ndbcluster.cc') diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 83cceb0da76..3bb3c3388e2 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -94,6 +94,11 @@ static bool ndbcluster_show_status(handlerton *hton, THD*, static int ndbcluster_alter_tablespace(handlerton *hton, THD* thd, st_alter_tablespace *info); +static int ndbcluster_fill_is_table(handlerton *hton, + THD *thd, + TABLE_LIST *tables, + COND *cond, + enum enum_schema_tables); static int ndbcluster_fill_files_table(handlerton *hton, THD *thd, TABLE_LIST *tables, @@ -7403,7 +7408,7 @@ static int ndbcluster_init(void *p) h->alter_tablespace= ndbcluster_alter_tablespace; /* Show status */ h->partition_flags= ndbcluster_partition_flags; /* Partition flags */ h->alter_table_flags=ndbcluster_alter_table_flags; /* Alter table flags */ - h->fill_files_table= ndbcluster_fill_files_table; + h->fill_is_table= ndbcluster_fill_is_table; #ifdef HAVE_NDB_BINLOG ndbcluster_binlog_init_handlerton(); #endif @@ -7539,6 +7544,34 @@ ndbcluster_init_error: DBUG_RETURN(TRUE); } +/** + Used to fill in INFORMATION_SCHEMA* tables. + + @param hton handle to the handlerton structure + @param thd the thread/connection descriptor + @param[in,out] tables the information schema table that is filled up + @param cond used for conditional pushdown to storage engine + @param schema_table_idx the table id that distinguishes the type of table + + @return Operation status + */ +static int ndbcluster_fill_is_table(handlerton *hton, + THD *thd, + TABLE_LIST *tables, + COND *cond, + enum enum_schema_tables schema_table_idx) +{ + int ret= 0; + + if (schema_table_idx == SCH_FILES) + { + ret= ndbcluster_fill_files_table(hton, thd, tables, cond); + } + + return ret; +} + + static int ndbcluster_end(handlerton *hton, ha_panic_function type) { DBUG_ENTER("ndbcluster_end"); -- cgit v1.2.1