#At bzr+ssh://bk-internal.mysql.com/bzrroot/server/mysql-6.0-sea
2693 Sergey Vojtovich 2008-08-25
WL#4515 - Falcon: fill INFORMATION_SCHEMA.FILES
Fill I_S.FILES with information about Falcon data files. Remove
I_S.FALCON_TABLESPACE_FILES. Make backup use I_S.FILES instead of
I_S.FALCON_TABLESPACE_FILES.
modified:
mysql-test/suite/funcs_1/r/is_columns_is_falcon.result
mysql-test/suite/funcs_1/r/is_tables_is_falcon.result
sql/backup/kernel.cc
sql/handler.h
sql/si_objects.cc
sql/si_objects.h
storage/falcon/TableSpaceManager.cpp
storage/falcon/ha_falcon.cpp
storage/falcon/ha_falcon.h
per-file messages:
mysql-test/suite/funcs_1/r/is_columns_is_falcon.result
Updated test result: there is no I_S.FALCON_TABLESPACE_FILES anymore.
mysql-test/suite/funcs_1/r/is_tables_is_falcon.result
Updated test result: there is no I_S.FALCON_TABLESPACE_FILES anymore.
sql/backup/kernel.cc
As tablespaces are identified by name + engine pair,
is_tablespace() now accepts tablespace object instead of tablespace name.
sql/handler.h
Removed enum entry for I_S.FALCON_TABLESPACE_FILES.
sql/si_objects.cc
Extended TablespaceObj with methods/variables that get/set tablespace storage engine
name.
Simplified InformationSchemaIterator::prepare_is_table(). With
this patch all I_S tables can be accessed via get_schema_table().
That is there is no need for extra code to handle tables.
Initialize engine name in TablespaceObj constructor.
TablespaceObj::materialize() now extracts storage engine from
serialization string.
In TablespaceObj::build_serialization() create serialization
string using storage engine name.
Rewritten find_tablespace_schema_row(), so it uses I_S.FILES instead of
I_S.FALCON_TABLESPACE_FILES and identifies tablespace by name + engine pair.
Rewritten get_tablespace_from_schema(), so it identifies tablespace by name + engine
pair.
get_tablespace_for_table() now attempts to get tablespace name
with all engines (not only Falcon). Also it identifies tablespace
by name + engine pair.
Rewritten tablespace_exists() and is_tablespace(), so they idenetify tablespace by
name + engine pair.
sql/si_objects.h
As tablespaces are identified by name + engine pair,
is_tablespace() now accepts tablespace object instead of tablespace name.
storage/falcon/TableSpaceManager.cpp
Reuse I_S.FALCON_TABLESPACE_FILES code to fill I_S.FILES
and fill fields properly.
Also added comments for fields in I_S.TABLESPACES.
storage/falcon/ha_falcon.cpp
Removed I_S.FALCON_TABLESPACE_FILES code.
Added code to fill I_S.FILES.
storage/falcon/ha_falcon.h
Removed I_S.FALCON_TABLESPACE_FILES code.
=== modified file 'mysql-test/suite/funcs_1/r/is_columns_is_falcon.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_is_falcon.result 2008-08-07 12:58:45 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_falcon.result 2008-08-25 10:16:17 +0000
@@ -41,10 +41,6 @@ NULL information_schema FALCON_TABLES PA
NULL information_schema FALCON_TABLES SCHEMA_NAME 1 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
NULL information_schema FALCON_TABLES TABLESPACE 4 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
NULL information_schema FALCON_TABLES TABLE_NAME 2 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
-NULL information_schema FALCON_TABLESPACE_FILES FILE_ID 3 0 NO int NULL NULL 10 0 NULL NULL int(127) select Default Default
-NULL information_schema FALCON_TABLESPACE_FILES FILE_NAME 4 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
-NULL information_schema FALCON_TABLESPACE_FILES TABLESPACE_NAME 1 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
-NULL information_schema FALCON_TABLESPACE_FILES TYPE 2 NO varchar 127 508 NULL NULL utf8 utf8_general_ci varchar(127) select Default Default
NULL information_schema FALCON_TABLESPACE_IO BUFFERS 3 0 NO int NULL NULL 10 0 NULL NULL int(4) select Default Default
NULL information_schema FALCON_TABLESPACE_IO FAKES 7 0 NO int NULL NULL 10 0 NULL NULL int(4) select Default Default
NULL information_schema FALCON_TABLESPACE_IO LOGICAL_READS 6 0 NO int NULL NULL 10 0 NULL NULL int(4) select Default Default
@@ -163,10 +159,6 @@ NULL information_schema FALCON_SYSTEM_ME
4.0000 information_schema FALCON_TABLES PARTITION varchar 127 508 utf8 utf8_general_ci varchar(127)
4.0000 information_schema FALCON_TABLES TABLESPACE varchar 127 508 utf8 utf8_general_ci varchar(127)
4.0000 information_schema FALCON_TABLES INTERNAL_NAME varchar 127 508 utf8 utf8_general_ci varchar(127)
-4.0000 information_schema FALCON_TABLESPACE_FILES TABLESPACE_NAME varchar 127 508 utf8 utf8_general_ci varchar(127)
-4.0000 information_schema FALCON_TABLESPACE_FILES TYPE varchar 127 508 utf8 utf8_general_ci varchar(127)
-NULL information_schema FALCON_TABLESPACE_FILES FILE_ID int NULL NULL NULL NULL int(127)
-4.0000 information_schema FALCON_TABLESPACE_FILES FILE_NAME varchar 127 508 utf8 utf8_general_ci varchar(127)
4.0000 information_schema FALCON_TABLESPACE_IO TABLESPACE varchar 120 480 utf8 utf8_general_ci varchar(120)
NULL information_schema FALCON_TABLESPACE_IO PAGE_SIZE int NULL NULL NULL NULL int(4)
NULL information_schema FALCON_TABLESPACE_IO BUFFERS int NULL NULL NULL NULL int(4)
=== modified file 'mysql-test/suite/funcs_1/r/is_tables_is_falcon.result'
--- a/mysql-test/suite/funcs_1/r/is_tables_is_falcon.result 2008-08-07 12:58:45 +0000
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_falcon.result 2008-08-25 10:16:17 +0000
@@ -176,29 +176,6 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
-TABLE_NAME FALCON_TABLESPACE_FILES
-TABLE_TYPE SYSTEM VIEW
-ENGINE MEMORY
-VERSION 10
-ROW_FORMAT Fixed
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION utf8_general_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-TABLE_CATALOG NULL
-TABLE_SCHEMA information_schema
TABLE_NAME FALCON_TABLESPACE_IO
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
@@ -469,29 +446,6 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG NULL
TABLE_SCHEMA information_schema
-TABLE_NAME FALCON_TABLESPACE_FILES
-TABLE_TYPE SYSTEM VIEW
-ENGINE MEMORY
-VERSION 10
-ROW_FORMAT Fixed
-TABLE_ROWS #TBLR#
-AVG_ROW_LENGTH #ARL#
-DATA_LENGTH #DL#
-MAX_DATA_LENGTH #MDL#
-INDEX_LENGTH #IL#
-DATA_FREE #DF#
-AUTO_INCREMENT NULL
-CREATE_TIME #CRT#
-UPDATE_TIME #UT#
-CHECK_TIME #CT#
-TABLE_COLLATION utf8_general_ci
-CHECKSUM NULL
-CREATE_OPTIONS #CO#
-TABLE_COMMENT #TC#
-user_comment
-Separator -----------------------------------------------------
-TABLE_CATALOG NULL
-TABLE_SCHEMA information_schema
TABLE_NAME FALCON_TABLESPACE_IO
TABLE_TYPE SYSTEM VIEW
ENGINE MEMORY
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2008-07-19 03:03:39 +0000
+++ b/sql/backup/kernel.cc 2008-08-25 10:16:17 +0000
@@ -1663,7 +1663,7 @@ int bcat_create_item(st_bstream_image_he
this and cancel restore process.
*/
- Obj *ts= obs::is_tablespace(thd, sobj->get_name());
+ Obj *ts= obs::is_tablespace(thd, sobj);
if (ts)
{
=== modified file 'sql/handler.h'
--- a/sql/handler.h 2008-08-07 12:58:45 +0000
+++ b/sql/handler.h 2008-08-25 10:16:17 +0000
@@ -612,8 +612,7 @@ enum enum_schema_tables
SCH_TRIGGERS,
SCH_USER_PRIVILEGES,
SCH_VARIABLES,
- SCH_VIEWS,
- SCH_FALCON_TABLESPACE_FILES
+ SCH_VIEWS
};
typedef struct st_table TABLE;
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2008-08-07 12:58:45 +0000
+++ b/sql/si_objects.cc 2008-08-25 10:16:17 +0000
@@ -738,17 +738,24 @@ public:
const String* get_comments()
{ return &m_comments; }
+ const String* get_engine()
+ { return &m_engine; }
+
void set_datafile(const String *df)
{ m_datafile.copy(*df); }
void set_comments(const String *c)
{ m_comments.copy(*c); }
+ void set_engine(const String *engine)
+ { m_engine.copy(*engine); }
+
private:
// These attributes are to be used only for serialization.
String m_ts_name;
String m_datafile;
String m_comments;
+ String m_engine;
// Drop is not supported by this object.
bool drop(THD *thd)
@@ -1037,32 +1044,8 @@ bool InformationSchemaIterator::prepare_
enum_schema_tables is_table_idx,
List<LEX_STRING> db_list)
{
- ST_SCHEMA_TABLE *st;
- /*
- The falcon schema table does not conform to the older SHOW
- style fill methods nor does it use a wildcard condition.
- */
- switch (is_table_idx) {
- case SCH_TABLESPACES:
- {
- st= find_schema_table(thd, "TABLESPACES");
- *is_table= open_schema_table(thd, st, NULL);
- break;
- }
- case SCH_FALCON_TABLESPACE_FILES:
- {
- st= find_schema_table(thd, "FALCON_TABLESPACE_FILES");
- *is_table= open_schema_table(thd, st, NULL);
- break;
- }
- default:
- {
- st= get_schema_table(is_table_idx);
- *is_table= open_schema_table(thd, st, &db_list);
- break;
- }
- }
- if (!*is_table)
+ ST_SCHEMA_TABLE *st= get_schema_table(is_table_idx);
+ if (!(*is_table= open_schema_table(thd, st, &db_list)))
return TRUE;
*ha= (*is_table)->file;
@@ -2463,6 +2446,7 @@ TablespaceObj::TablespaceObj(const Strin
m_ts_name.copy(*ts_name);
m_datafile.length(0);
m_comments.length(0);
+ m_engine.length(0);
}
/**
@@ -2490,6 +2474,7 @@ bool TablespaceObj::do_serialize(THD *th
Materialize the serialization string.
This method saves serialization string into a member variable.
+ Also extracts tablespace engine name from serialization string.
@param[in] serialization_version version number of this interface
@param[in] serialization the string from serialize()
@@ -2505,6 +2490,11 @@ bool TablespaceObj::materialize(uint ser
{
DBUG_ENTER("TablespaceObj::materialize()");
m_create_stmt.copy(*serialization);
+ /* Extract engine from create statement */
+ String tmp_str= String("=", 1, system_charset_info);
+ int pos= m_create_stmt.strrstr(tmp_str, m_create_stmt.length());
+ m_engine.copy(m_create_stmt.ptr() + pos + 1, m_create_stmt.length() - pos - 1,
+ system_charset_info);
DBUG_RETURN(FALSE);
}
@@ -2558,7 +2548,8 @@ const String *TablespaceObj::build_seria
m_create_stmt.append("' COMMENT = '");
m_create_stmt.append(m_comments);
}
- m_create_stmt.append("' ENGINE=FALCON");
+ m_create_stmt.append("' ENGINE=");
+ m_create_stmt.append(m_engine);
DBUG_RETURN(&m_create_stmt);
}
@@ -2750,6 +2741,7 @@ bool check_db_existence(const String *db
@param[in] thd Thread context
@param[in] is_table_idx The information schema to search
@param[in] ts_name The name of the tablespace to find
+ @param[in] ts_engine Engine of the tablespace to find
@param[out] datafile The datafile for the tablespace
@param[out] comments The comments for the tablespace
@@ -2759,16 +2751,16 @@ bool check_db_existence(const String *db
static bool find_tablespace_schema_row(THD *thd,
enum_schema_tables is_table_idx,
const String *ts_name,
+ const String *ts_engine,
String *datafile,
String *comments)
{
- int ret= 0;
TABLE *is_table;
handler *ha;
my_bitmap_map *orig_col;
LEX_STRING lex_ts_name;
- String found_ts_name;
- bool retval= FALSE;
+ String found_ts_name, found_ts_engine;
+ bool retval= TRUE;
String data;
List<LEX_STRING> ts_list;
DBUG_ENTER("obs::find_tablespace_schema_row()");
@@ -2784,66 +2776,66 @@ static bool find_tablespace_schema_row(T
thd, &is_table, &ha, &orig_col, is_table_idx, ts_list))
DBUG_RETURN(TRUE);
- /*
- Now read from the IS table.
- */
- if (ha->rnd_next(is_table->record[0]))
- {
- retval= TRUE;
- goto end;
- }
-
- /*
- Attempt to locate the row in the tablespaces table.
- If found, proceed to the retrieving the data.
- */
- is_table->field[IS_TABLESPACES_TABLESPACE_NAME]->val_str(&found_ts_name);
- while (!ret && found_ts_name.length() &&
- (strncasecmp(found_ts_name.ptr(), ts_name->ptr(),
- ts_name->length()) != 0))
- {
- ret= ha->rnd_next(is_table->record[0]);
- found_ts_name.length(0); // reset the length of the string
- if (!ret)
- is_table->field[IS_TABLESPACES_TABLESPACE_NAME]->val_str(&found_ts_name);
- }
- if (ret || (found_ts_name.length() == 0))
- {
- retval= TRUE;
- goto end;
- }
-
- /*
- TS name is in col IS_TABLESPACES_TABLESPACE_NAME in TABLESPACES
- TS comment is in col IS_TABLESPACES_TABLESPACE_COMMENT in TABLESPACES
- TS datafile is in col 3 in FALCON_TABLESPACE_FILES
- */
+ /* Locate the row in the schema table and retrive the data. */
switch (is_table_idx) {
- case SCH_TABLESPACES:
+ case SCH_TABLESPACES:
+ while (!ha->rnd_next(is_table->record[0]))
{
- is_table->field[IS_TABLESPACES_TABLESPACE_COMMENT]->val_str(&data);
- comments->copy(data);
- break;
- }
- case SCH_FALCON_TABLESPACE_FILES:
- {
- is_table->field[3]->val_str(&data);
- datafile->copy(data);
- break;
+ is_table->field[IS_TABLESPACES_TABLESPACE_NAME]->val_str(&found_ts_name);
+ is_table->field[IS_TABLESPACES_ENGINE]->val_str(&found_ts_engine);
+ if (found_ts_name.length() && found_ts_engine.length() &&
+ !my_strnncoll(system_charset_info, (const uchar*) found_ts_name.ptr(),
+ found_ts_name.length(), (const uchar*) ts_name->ptr(),
+ ts_name->length()) &&
+ !my_strnncoll(system_charset_info,
+ (const uchar*) found_ts_engine.ptr(),
+ found_ts_engine.length(),
+ (const uchar*) ts_engine->ptr(), ts_engine->length()))
+ {
+ retval= FALSE;
+ is_table->field[IS_TABLESPACES_TABLESPACE_COMMENT]->val_str(&data);
+ comments->copy(data);
+ DBUG_PRINT("find_tablespace_schema_row", (" Found tablespace %s",
+ found_ts_name.ptr()));
+ break;
+ }
+ found_ts_name.length(0);
+ found_ts_engine.length(0);
}
- default:
+ break;
+ case SCH_FILES:
+ while (!ha->rnd_next(is_table->record[0]))
{
- retval= TRUE; //error
- goto end;
+ is_table->field[IS_FILES_TABLESPACE_NAME]->val_str(&found_ts_name);
+ is_table->field[IS_FILES_ENGINE]->val_str(&found_ts_engine);
+ if (found_ts_name.length() && found_ts_engine.length() &&
+ !my_strnncoll(system_charset_info, (const uchar*) found_ts_name.ptr(),
+ found_ts_name.length(), (const uchar*) ts_name->ptr(),
+ ts_name->length()) &&
+ !my_strnncoll(system_charset_info,
+ (const uchar*) found_ts_engine.ptr(),
+ found_ts_engine.length(),
+ (const uchar*) ts_engine->ptr(), ts_engine->length()))
+ {
+ retval= FALSE;
+ is_table->field[IS_FILES_FILE_NAME]->val_str(&data);
+ datafile->copy(data);
+ DBUG_PRINT("find_tablespace_schema_row", (" Found tablespace %s",
+ found_ts_name.ptr()));
+ break;
+ }
+ found_ts_name.length(0);
+ found_ts_engine.length(0);
}
+ break;
+ default:
+ DBUG_ASSERT(0);
+ break;
}
- DBUG_PRINT("find_tablespace_schema_row", (" Found tablespace %s",
- found_ts_name.ptr()));
/*
Cleanup
*/
-end:
ha->ha_rnd_end();
dbug_tmp_restore_column_map(is_table->read_set, orig_col);
@@ -2860,6 +2852,7 @@ end:
@param[in] thd Thread context.
@param[out] TablespaceObj A pointer to a new tablespace object
@param[in] ts_name The name of the tablespace to find
+ @param[in] ts_engine Engine of the tablespace to find
@note Caller is responsible for destroying the tablespace object.
@@ -2868,7 +2861,8 @@ end:
*/
static bool get_tablespace_from_schema(THD *thd,
TablespaceObj **ts,
- const String *ts_name)
+ const String *ts_name,
+ const String *ts_engine)
{
String datafile;
String comments;
@@ -2878,14 +2872,14 @@ static bool get_tablespace_from_schema(T
Locate the row in TABLESPACES and get the comments.
*/
if (find_tablespace_schema_row(thd, SCH_TABLESPACES,
- ts_name, &datafile, &comments))
+ ts_name, ts_engine, &datafile, &comments))
DBUG_RETURN(TRUE);
/*
- Locate the row in FALCON_TABLESPACE_FILES and get the datafile.
+ Locate the row in FILES and get the datafile.
*/
- if (find_tablespace_schema_row(thd, SCH_FALCON_TABLESPACE_FILES,
- ts_name, &datafile, &comments))
+ if (find_tablespace_schema_row(thd, SCH_FILES,
+ ts_name, ts_engine, &datafile, &comments))
DBUG_RETURN(TRUE);
/*
@@ -2901,6 +2895,7 @@ static bool get_tablespace_from_schema(T
*ts= ts_local;
ts_local->set_datafile(&datafile);
ts_local->set_comments(&comments);
+ ts_local->set_engine(ts_engine);
DBUG_RETURN(FALSE);
}
@@ -2925,9 +2920,8 @@ Obj *get_tablespace_for_table(THD *thd,
{
TablespaceObj *ts= NULL;
char path[FN_REFLEN];
- String ts_name;
- bool get_ts= FALSE;
- const char *ts_name_str;
+ String ts_name, ts_engine;
+ const char *ts_name_str= NULL;
DBUG_ENTER("obs::get_tablespace_for_table()");
DBUG_PRINT("obs::get_tablespace_for_table", ("name: %s.%s",
db_name->ptr(), tbl_name->ptr()));
@@ -2937,6 +2931,7 @@ Obj *get_tablespace_for_table(THD *thd,
build_table_filename(path, sizeof(path), db, name, "", 0);
ts_name.length(0);
+ ts_engine.length(0);
TABLE *table= open_temporary_table(thd, path, db, name,
FALSE /* don't link to thd->temporary_tables */,
@@ -2944,12 +2939,12 @@ Obj *get_tablespace_for_table(THD *thd,
if (table)
{
- get_ts= (table->s->db_type()->db_type == DB_TYPE_FALCON
- && (ts_name_str= table->file->get_tablespace_name()));
- if (get_ts)
+ if ((ts_name_str= table->file->get_tablespace_name()))
{
ts_name.append(ts_name_str);
ts_name.set_charset(system_charset_info);
+ ts_engine.append(table->file->engine_name()->str);
+ ts_engine.set_charset(system_charset_info);
}
intern_close_table(table);
my_free(table, MYF(0));
@@ -2960,8 +2955,8 @@ Obj *get_tablespace_for_table(THD *thd,
/*
Now open the information_schema table and get the tablespace information.
*/
- if (get_ts)
- get_tablespace_from_schema(thd, &ts, &ts_name);
+ if (ts_name_str)
+ get_tablespace_from_schema(thd, &ts, &ts_name, &ts_engine);
end:
DBUG_RETURN(ts);
}
@@ -2982,10 +2977,11 @@ end:
bool tablespace_exists(THD *thd,
Obj *ts)
{
- TablespaceObj *other_ts= NULL;
+ TablespaceObj *other_ts= NULL, *this_ts= static_cast<TablespaceObj*>(ts);
bool retval= FALSE;
DBUG_ENTER("obs::tablespace_exists()");
- get_tablespace_from_schema(thd, &other_ts, ts->get_name());
+ get_tablespace_from_schema(thd, &other_ts, this_ts->get_name(),
+ this_ts->get_engine());
if (!other_ts)
DBUG_RETURN(retval);
retval= (my_strcasecmp(system_charset_info,
@@ -3001,18 +2997,18 @@ bool tablespace_exists(THD *thd,
This method determines if the tablespace referenced by name exists on the
system. Returns a TablespaceObj if it exists or NULL if it doesn't.
- @param[in] ts_name The Tablspace name to compare.
+ @param[in] Obj The TablspaceObj pointer to compare.
@note Caller is responsible for destroying the tablespace object.
@returns the tablespace if found or NULL if not found
*/
-Obj *is_tablespace(THD *thd,
- const String *ts_name)
+Obj *is_tablespace(THD *thd, Obj *ts)
{
- TablespaceObj *other_ts= NULL;
+ TablespaceObj *other_ts= NULL, *this_ts= static_cast<TablespaceObj*>(ts);
DBUG_ENTER("obs::is_tablespace()");
- get_tablespace_from_schema(thd, &other_ts, ts_name);
+ get_tablespace_from_schema(thd, &other_ts, this_ts->get_name(),
+ this_ts->get_engine());
DBUG_RETURN(other_ts);
}
=== modified file 'sql/si_objects.h'
--- a/sql/si_objects.h 2008-07-05 08:41:26 +0000
+++ b/sql/si_objects.h 2008-08-25 10:16:17 +0000
@@ -541,8 +541,7 @@ bool tablespace_exists(THD *thd,
This method determines if the tablespace referenced by name exists on the
system. Returns a TablespaceObj if it exists or NULL if it doesn't.
*/
-Obj *is_tablespace(THD *thd,
- const String *ts_name);
+Obj *is_tablespace(THD *thd, Obj *ts);
/*
This method returns a description of the tablespace useful for communicating
=== modified file 'storage/falcon/TableSpaceManager.cpp'
--- a/storage/falcon/TableSpaceManager.cpp 2008-08-07 12:58:45 +0000
+++ b/storage/falcon/TableSpaceManager.cpp 2008-08-25 10:16:17 +0000
@@ -518,17 +518,26 @@ void TableSpaceManager::getTableSpaceInf
while (resultSet->next())
{
- infoTable->putString(0, resultSet->getString(1)); // tablespace name
+ // TABLESPACE_NAME NOT NULL
+ infoTable->putString(0, resultSet->getString(1));
+ // ENGINE NOT NULL
infoTable->putString(1, "Falcon");
+ // TABLESPACE_TYPE (based upon name)
infoTable->setNotNull(2);
- infoTable->putString(2, tableSpaceType(resultSet->getString(1))); // type based
upon name
+ infoTable->putString(2, tableSpaceType(resultSet->getString(1)));
+ // LOGFILE_GROUP_NAME
infoTable->setNull(3);
+ // EXTENT_SIZE
infoTable->setNull(4);
+ // AUTOEXTEND_SIZE
infoTable->setNull(5);
+ // MAXIMUM_SIZE
infoTable->setNull(6);
+ // NODEGROUP_ID
infoTable->setNull(7);
+ // TABLESPACE_COMMENT
infoTable->setNotNull(8);
- infoTable->putString(8, resultSet->getString(2)); // comment
+ infoTable->putString(8, resultSet->getString(2));
infoTable->putRecord();
}
}
@@ -541,10 +550,46 @@ void TableSpaceManager::getTableSpaceFil
while (resultSet->next())
{
- infoTable->putString(0, resultSet->getString(1)); // tablespace name
- infoTable->putString(1, tableSpaceType(resultSet->getString(1))); // type based
upon name
- infoTable->putInt(2, 1); // file id (unused for now)
- infoTable->putString(3, resultSet->getString(2)); // file name
+ infoTable->putInt(0, 0); // FILE_ID NOT NULL, unused for now
+ infoTable->setNotNull(1); // FILE_NAME
+ infoTable->putString(1, resultSet->getString(2));
+ infoTable->putString(2, "DATAFILE"); // FILE_TYPE NOT NULL
+ infoTable->setNotNull(3); // TABLESPACE_NAME
+ infoTable->putString(3, resultSet->getString(1));
+ infoTable->setNull(4); // TABLE_CATALOG
+ infoTable->setNull(5); // TABLE_SCHEMA
+ infoTable->setNull(6); // TABLE_NAME
+ infoTable->setNull(7); // LOGFILE_GROUP_NAME
+ infoTable->setNull(8); // LOGFILE_GROUP_NUMBER
+ infoTable->putString(9, "Falcon"); // ENGINE NOT NULL
+ infoTable->setNull(10); // FULLTEXT_KEYS
+ infoTable->setNull(11); // DELETED_ROWS
+ infoTable->setNull(12); // UPDATE_COUNT
+ infoTable->setNull(13); // FREE_EXTENTS
+ infoTable->setNull(14); // TOTAL_EXTENTS
+ infoTable->putInt(15, 0); // EXTENT_SIZE NOT NULL
+ infoTable->setNull(16); // INITIAL_SIZE
+ infoTable->setNull(17); // MAXIMUM_SIZE
+ infoTable->setNull(18); // AUTOEXTEND_SIZE
+ infoTable->setNull(19); // CREATION_TIME
+ infoTable->setNull(20); // LAST_UPDATE_TIME
+ infoTable->setNull(21); // LAST_ACCESS_TIME
+ infoTable->setNull(22); // RECOVER_TIME
+ infoTable->setNull(23); // TRANSACTION_COUNTER
+ infoTable->setNull(24); // VERSION
+ infoTable->setNull(25); // ROW_FORMAT
+ infoTable->setNull(26); // TABLE_ROWS
+ infoTable->setNull(27); // AVG_ROW_LENGTH
+ infoTable->setNull(28); // DATA_LENGTH
+ infoTable->setNull(29); // MAX_DATA_LENGTH
+ infoTable->setNull(30); // INDEX_LENGTH
+ infoTable->setNull(31); // DATA_FREE
+ infoTable->setNull(32); // CREATE_TIME
+ infoTable->setNull(33); // UPDATE_TIME
+ infoTable->setNull(34); // CHECK_TIME
+ infoTable->setNull(35); // CHECKSUM
+ infoTable->putString(36, "NORMAL"); // STATUS NOT NULL
+ infoTable->setNull(37); // EXTRA
infoTable->putRecord();
}
}
=== modified file 'storage/falcon/ha_falcon.cpp'
--- a/storage/falcon/ha_falcon.cpp 2008-08-07 12:58:45 +0000
+++ b/storage/falcon/ha_falcon.cpp 2008-08-25 10:16:17 +0000
@@ -2104,6 +2104,9 @@ int StorageInterface::fill_is_table(hand
case SCH_TABLESPACES:
storageHandler->getTableSpaceInfo(&infoTable);
break;
+ case SCH_FILES:
+ storageHandler->getTableSpaceFilesInfo(&infoTable);
+ break;
default:
return 0;
}
@@ -3186,47 +3189,6 @@ int NfsPluginHandler::deinitTableSpaceIO
//*****************************************************************************
//
-// FALCON_TABLESPACE_FILES
-//
-//*****************************************************************************
-
-int NfsPluginHandler::getTableSpaceFilesInfo(THD *thd, TABLE_LIST *tables, COND *cond)
-{
- InfoTableImpl infoTableSpace(thd, tables, system_charset_info);
-
- if (storageHandler)
- storageHandler->getTableSpaceFilesInfo(&infoTableSpace);
-
- return infoTableSpace.error;
-}
-
-ST_FIELD_INFO tableSpaceFilesFieldInfo[]=
-{
- {"TABLESPACE_NAME", 127, MYSQL_TYPE_STRING, 0, 0, "TableSpace Name", SKIP_OPEN_TABLE},
- {"TYPE", 127, MYSQL_TYPE_STRING, 0, 0, "Type", SKIP_OPEN_TABLE},
- {"FILE_ID", 127, MYSQL_TYPE_LONG, 0, 0, "File ID", SKIP_OPEN_TABLE},
- {"FILE_NAME", 127, MYSQL_TYPE_STRING, 0, 0, "File Name", SKIP_OPEN_TABLE},
- {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
-};
-
-int NfsPluginHandler::initTableSpaceFilesInfo(void *p)
-{
- DBUG_ENTER("initTableSpaceFilesInfo");
- ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *)p;
- schema->fields_info = tableSpaceFilesFieldInfo;
- schema->fill_table = NfsPluginHandler::getTableSpaceFilesInfo;
-
- DBUG_RETURN(0);
-}
-
-int NfsPluginHandler::deinitTableSpaceFilesInfo(void *p)
-{
- DBUG_ENTER("deinitTableSpaceFilesInfo");
- DBUG_RETURN(0);
-}
-
-//*****************************************************************************
-//
// FALCON_TABLES
//
//*****************************************************************************
@@ -3679,7 +3641,6 @@ static st_mysql_information_schema falco
static st_mysql_information_schema falcon_transaction_summary = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
static st_mysql_information_schema falcon_syncobjects = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
static st_mysql_information_schema falcon_serial_log_info = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
-static st_mysql_information_schema falcon_tablespace_files = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
static st_mysql_information_schema falcon_tables = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
static st_mysql_information_schema falcon_version = {
MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION};
@@ -3851,21 +3812,6 @@ mysql_declare_plugin(falcon)
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
- &falcon_tablespace_files,
- "FALCON_TABLESPACE_FILES",
- "MySQL AB",
- "Falcon TableSpace Files.",
- PLUGIN_LICENSE_GPL,
- NfsPluginHandler::initTableSpaceFilesInfo, /* plugin init */
- NfsPluginHandler::deinitTableSpaceFilesInfo,/* plugin deinit */
- 0x0005,
- NULL, /* status variables */
- NULL, /* system variables */
- NULL /* config options */
- },
-
- {
- MYSQL_INFORMATION_SCHEMA_PLUGIN,
&falcon_tables,
"FALCON_TABLES",
"MySQL AB",
=== modified file 'storage/falcon/ha_falcon.h'
--- a/storage/falcon/ha_falcon.h 2008-08-07 12:58:45 +0000
+++ b/storage/falcon/ha_falcon.h 2008-08-25 10:16:17 +0000
@@ -247,10 +247,6 @@ public:
static int initSyncInfo(void *p);
static int deinitSyncInfo(void *p);
- static int getTableSpaceFilesInfo(THD *thd, TABLE_LIST *tables, COND *cond);
- static int initTableSpaceFilesInfo(void *p);
- static int deinitTableSpaceFilesInfo(void *p);
-
static int getTablesInfo(THD *thd, TABLE_LIST *tables, COND *cond);
static int initTablesInfo(void *p);
static int deinitTablesInfo(void *p);