Commit 2038b98e authored by unknown's avatar unknown

Merge ssmith@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb

into  willster.(none):/home/stewart/Documents/MySQL/5.1/bug20073


client/mysqldump.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
parents df3156a3 6434e352
......@@ -2760,6 +2760,7 @@ static int dump_all_tablespaces()
" ENGINE"
" FROM INFORMATION_SCHEMA.FILES"
" WHERE FILE_TYPE = \"UNDO LOG\""
" AND FILE_NAME IS NOT NULL"
" ORDER BY LOGFILE_GROUP_NAME"))
return 1;
......
......@@ -172,6 +172,7 @@ INITIAL_SIZE,
ENGINE
FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
lg1 NULL NULL NULL ndbcluster
lg1 undofile_lg1_01.dat 524288 2097152 ndbcluster
lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
SELECT DISTINCT
......
......@@ -10468,9 +10468,12 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
}
table->field[c++]->set_null(); // FILE_ID
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store("DATAFILE",8,system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(df.getTablespace(), strlen(df.getTablespace()),
system_charset_info);
table->field[c++]->set_null(); // TABLE_CATALOG
......@@ -10478,10 +10481,12 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // TABLE_NAME
// LOGFILE_GROUP_NAME
table->field[c]->set_notnull();
table->field[c++]->store(ts.getDefaultLogfileGroup(),
strlen(ts.getDefaultLogfileGroup()),
system_charset_info);
table->field[c++]->set_null(); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
......@@ -10489,11 +10494,16 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c]->set_notnull();
table->field[c++]->store(df.getFree() / ts.getExtentSize()); // FREE_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize() / ts.getExtentSize()); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(ts.getExtentSize()); // EXTENT_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize()); // INITIAL_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(df.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
......@@ -10503,8 +10513,10 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(df.getObjectVersion()); // VERSION
table->field[c]->set_notnull();
table->field[c++]->store("FIXED", 5, system_charset_info); // ROW_FORMAT
table->field[c++]->set_null(); // TABLE_ROWS
......@@ -10518,11 +10530,13 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
char extra[30];
int len= my_snprintf(extra, sizeof(extra), "CLUSTER_NODE=%u", id);
table->field[c]->store(extra, len, system_charset_info);
table->field[c]->set_notnull();
schema_table_store_record(thd, table);
}
}
......@@ -10563,8 +10577,10 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
int c= 0;
table->field[c++]->set_null(); // FILE_ID
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store("UNDO LOG", 8, system_charset_info);
table->field[c++]->set_null(); // TABLESPACE NAME
table->field[c++]->set_null(); // TABLE_CATALOG
......@@ -10574,10 +10590,13 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
// LOGFILE_GROUP_NAME
NdbDictionary::ObjectId objid;
uf.getLogfileGroupId(&objid);
table->field[c]->set_notnull();
table->field[c++]->store(uf.getLogfileGroup(),
strlen(uf.getLogfileGroup()),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(objid.getObjectId()); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
......@@ -10585,11 +10604,15 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS
table->field[c++]->set_null(); // FREE_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()/4); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(4); // EXTENT_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()); // INITIAL_SIZE
table->field[c]->set_notnull();
table->field[c++]->store(uf.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
......@@ -10599,6 +10622,7 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(uf.getObjectVersion()); // VERSION
table->field[c++]->set_null(); // ROW FORMAT
......@@ -10614,14 +10638,103 @@ static int ndbcluster_fill_files_table(THD *thd, TABLE_LIST *tables,
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
char extra[100];
int len= my_snprintf(extra,sizeof(extra),"CLUSTER_NODE=%u;UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
table->field[c]->set_notnull();
table->field[c]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
}
}
// now for LFGs
NdbDictionary::Dictionary::List lfglist;
dict->listObjects(lfglist, NdbDictionary::Object::LogfileGroup);
ndberr= dict->getNdbError();
if (ndberr.classification != NdbError::NoError)
ERR_RETURN(ndberr);
for (i= 0; i < lfglist.count; i++)
{
NdbDictionary::Dictionary::List::Element& elt= lfglist.elements[i];
unsigned id;
NdbDictionary::LogfileGroup lfg= dict->getLogfileGroup(elt.name);
ndberr= dict->getNdbError();
if (ndberr.classification != NdbError::NoError)
{
if (ndberr.classification == NdbError::SchemaError)
continue;
ERR_RETURN(ndberr);
}
int c= 0;
table->field[c++]->set_null(); // FILE_ID
table->field[c++]->set_null(); // name
table->field[c]->set_notnull();
table->field[c++]->store("UNDO LOG", 8, system_charset_info);
table->field[c++]->set_null(); // TABLESPACE NAME
table->field[c++]->set_null(); // TABLE_CATALOG
table->field[c++]->set_null(); // TABLE_SCHEMA
table->field[c++]->set_null(); // TABLE_NAME
// LOGFILE_GROUP_NAME
table->field[c]->set_notnull();
table->field[c++]->store(elt.name, strlen(elt.name),
system_charset_info);
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getObjectId()); // LOGFILE_GROUP_NUMBER
table->field[c]->set_notnull();
table->field[c++]->store(ndbcluster_hton_name,
ndbcluster_hton_name_length,
system_charset_info); // ENGINE
table->field[c++]->set_null(); // FULLTEXT_KEYS
table->field[c++]->set_null(); // DELETED_ROWS
table->field[c++]->set_null(); // UPDATE_COUNT
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getUndoFreeWords()); // FREE_EXTENTS
table->field[c++]->set_null(); //store(uf.getSize()/4); // TOTAL_EXTENTS
table->field[c]->set_notnull();
table->field[c++]->store(4); // EXTENT_SIZE
table->field[c++]->set_null();//store(uf.getSize()); // INITIAL_SIZE
table->field[c++]->set_null(); //store(uf.getSize()); // MAXIMUM_SIZE
table->field[c++]->set_null(); // AUTOEXTEND_SIZE
table->field[c++]->set_null(); // CREATION_TIME
table->field[c++]->set_null(); // LAST_UPDATE_TIME
table->field[c++]->set_null(); // LAST_ACCESS_TIME
table->field[c++]->set_null(); // RECOVER_TIME
table->field[c++]->set_null(); // TRANSACTION_COUNTER
table->field[c]->set_notnull();
table->field[c++]->store(lfg.getObjectVersion()); // VERSION
table->field[c++]->set_null(); // ROW FORMAT
table->field[c++]->set_null(); // TABLE_ROWS
table->field[c++]->set_null(); // AVG_ROW_LENGTH
table->field[c++]->set_null(); // DATA_LENGTH
table->field[c++]->set_null(); // MAX_DATA_LENGTH
table->field[c++]->set_null(); // INDEX_LENGTH
table->field[c++]->set_null(); // DATA_FREE
table->field[c++]->set_null(); // CREATE_TIME
table->field[c++]->set_null(); // UPDATE_TIME
table->field[c++]->set_null(); // CHECK_TIME
table->field[c++]->set_null(); // CHECKSUM
table->field[c]->set_notnull();
table->field[c++]->store("NORMAL", 6, system_charset_info);
char extra[100];
int len= my_snprintf(extra,sizeof(extra),"UNDO_BUFFER_SIZE=%lu",id,lfg.getUndoBufferSize());
table->field[c]->set_notnull();
table->field[c]->store(extra, len, system_charset_info);
schema_table_store_record(thd, table);
}
DBUG_RETURN(0);
}
......
......@@ -5378,29 +5378,29 @@ ST_FIELD_INFO plugin_fields_info[]=
ST_FIELD_INFO files_fields_info[]=
{
{"FILE_ID", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"FILE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"FILE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"FILE_TYPE", 20, MYSQL_TYPE_STRING, 0, 0, 0},
{"TABLESPACE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"TABLE_CATALOG", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"LOGFILE_GROUP_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"LOGFILE_GROUP_NUMBER", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"TABLESPACE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"TABLE_CATALOG", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"TABLE_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"TABLE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"LOGFILE_GROUP_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"LOGFILE_GROUP_NUMBER", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"ENGINE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"FULLTEXT_KEYS", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
{"DELETED_ROWS", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"UPDATE_COUNT", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"FREE_EXTENTS", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"TOTAL_EXTENTS", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"FULLTEXT_KEYS", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
{"DELETED_ROWS", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"UPDATE_COUNT", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"FREE_EXTENTS", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"TOTAL_EXTENTS", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"EXTENT_SIZE", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"INITIAL_SIZE", 21, MYSQL_TYPE_LONG, 0, 0, 0},
{"MAXIMUM_SIZE", 21, MYSQL_TYPE_LONG, 0, 0, 0},
{"AUTOEXTEND_SIZE", 21, MYSQL_TYPE_LONG, 0, 0, 0},
{"CREATION_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0},
{"LAST_UPDATE_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0},
{"LAST_ACCESS_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 0, 0},
{"RECOVER_TIME", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"TRANSACTION_COUNTER", 4, MYSQL_TYPE_LONG, 0, 0, 0},
{"INITIAL_SIZE", 21, MYSQL_TYPE_LONG, 0, 1, 0},
{"MAXIMUM_SIZE", 21, MYSQL_TYPE_LONG, 0, 1, 0},
{"AUTOEXTEND_SIZE", 21, MYSQL_TYPE_LONG, 0, 1, 0},
{"CREATION_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0},
{"LAST_UPDATE_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0},
{"LAST_ACCESS_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, 0},
{"RECOVER_TIME", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"TRANSACTION_COUNTER", 4, MYSQL_TYPE_LONG, 0, 1, 0},
{"VERSION", 21 , MYSQL_TYPE_LONG, 0, 1, "Version"},
{"ROW_FORMAT", 10, MYSQL_TYPE_STRING, 0, 1, "Row_format"},
{"TABLE_ROWS", 21 , MYSQL_TYPE_LONG, 0, 1, "Rows"},
......@@ -5414,7 +5414,7 @@ ST_FIELD_INFO files_fields_info[]=
{"CHECK_TIME", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Check_time"},
{"CHECKSUM", 21 , MYSQL_TYPE_LONG, 0, 1, "Checksum"},
{"STATUS", 20, MYSQL_TYPE_STRING, 0, 0, 0},
{"EXTRA", 255, MYSQL_TYPE_STRING, 0, 0, 0},
{"EXTRA", 255, MYSQL_TYPE_STRING, 0, 1, 0},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment