Below is the list of changes that have just been committed into a local
5.1 repository of stewart. When stewart does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2035 05/10/06 21:16:36 stewart@stripped +2 -0
WL#2076 Add extra ndbd statistics
Report Tablespace for datafiles and loggroup for undofiles.
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
1.52 05/10/06 21:16:32 stewart@stripped +7 -7
make parseFile(group)Info not static
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
1.111 05/10/06 21:16:31 stewart@stripped +73 -9
Add get_filegroup by id.
Get filegroup name for Undofile and Datafile
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: stewart
# Host: willster.(none)
# Root: /home/stewart/Documents/MySQL/5.1/ndb-dd
--- 1.110/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-10-05 18:58:36 +10:00
+++ 1.111/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-10-06 21:16:31 +10:00
@@ -3776,10 +3776,10 @@
NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst,
NdbDictionary::Object::Type type,
const char * name){
- DBUG_ENTER("NdbDictInterface::get_filegroup");
+ DBUG_ENTER("NdbDictInterface::get_filegroup");
NdbApiSignal tSignal(m_reference);
GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend());
-
+
size_t strLen = strlen(name) + 1;
req->senderRef = m_reference;
@@ -3794,7 +3794,7 @@
LinearSectionPtr ptr[1];
ptr[0].p = (Uint32*)name;
ptr[0].sz = (strLen + 3)/4;
-
+
int r = dictSignal(&tSignal, ptr, 1,
-1, // any node
WAIT_GET_TAB_INFO_REQ,
@@ -3804,18 +3804,17 @@
DBUG_PRINT("info", ("get_filegroup failed dictSignal"));
DBUG_RETURN(-1);
}
-
- m_error.code = parseFilegroupInfo(dst,
- (Uint32*)m_buffer.get_data(),
+
+ m_error.code = parseFilegroupInfo(dst,
+ (Uint32*)m_buffer.get_data(),
m_buffer.length() / 4);
-
+
if(m_error.code)
{
DBUG_PRINT("info", ("get_filegroup failed parseFilegroupInfo %d",
m_error.code));
DBUG_RETURN(m_error.code);
}
-
if(dst.m_type == type)
{
DBUG_RETURN(0);
@@ -3858,6 +3857,52 @@
}
int
+NdbDictInterface::get_filegroup(NdbFilegroupImpl & dst,
+ NdbDictionary::Object::Type type,
+ Uint32 id){
+ DBUG_ENTER("NdbDictInterface::get_filegroup");
+ NdbApiSignal tSignal(m_reference);
+ GetTabInfoReq * req = CAST_PTR(GetTabInfoReq, tSignal.getDataPtrSend());
+
+ req->senderRef = m_reference;
+ req->senderData = 0;
+ req->requestType =
+ GetTabInfoReq::RequestById | GetTabInfoReq::LongSignalConf;
+ req->tableId = id;
+ tSignal.theReceiversBlockNumber = DBDICT;
+ tSignal.theVerId_signalNumber = GSN_GET_TABINFOREQ;
+ tSignal.theLength = GetTabInfoReq::SignalLength;
+
+ int r = dictSignal(&tSignal, NULL, 1,
+ -1, // any node
+ WAIT_GET_TAB_INFO_REQ,
+ WAITFOR_RESPONSE_TIMEOUT, 100);
+ if (r)
+ {
+ DBUG_PRINT("info", ("get_filegroup failed dictSignal"));
+ DBUG_RETURN(-1);
+ }
+
+ m_error.code = parseFilegroupInfo(dst,
+ (Uint32*)m_buffer.get_data(),
+ m_buffer.length() / 4);
+
+ if(m_error.code)
+ {
+ DBUG_PRINT("info", ("get_filegroup failed parseFilegroupInfo %d",
+ m_error.code));
+ DBUG_RETURN(m_error.code);
+ }
+
+ if(dst.m_type == type)
+ {
+ DBUG_RETURN(0);
+ }
+ DBUG_PRINT("info", ("get_filegroup failed no such filegroup"));
+ DBUG_RETURN(m_error.code = GetTabInfoRef::TableNotDefined);
+}
+
+int
NdbDictInterface::get_file(NdbFileImpl & dst,
NdbDictionary::Object::Type type,
int node,
@@ -3933,7 +3978,26 @@
dst.m_size= ((Uint64)f.FileSizeHi << 32) | (f.FileSizeLo);
dst.m_free= f.FileFreeExtents;
dst.m_path.assign(f.FileName);
- //dst.m_filegroup_name
+
+ if(dst.m_type==NdbDictionary::Object::Undofile)
+ {
+ NdbDictionary::LogfileGroup tmp;
+ get_filegroup(NdbLogfileGroupImpl::getImpl(tmp),
+ NdbDictionary::Object::LogfileGroup,
+ f.FilegroupId);
+ dst.m_filegroup_name.assign(tmp.getName());
+ }
+ else if(dst.m_type==NdbDictionary::Object::Datafile)
+ {
+ NdbDictionary::Tablespace tmp;
+ get_filegroup(NdbTablespaceImpl::getImpl(tmp),
+ NdbDictionary::Object::Tablespace,
+ f.FilegroupId);
+ dst.m_filegroup_name.assign(tmp.getName());
+ }
+ else
+ dst.m_filegroup_name.assign("Not Yet Implemented");
+
dst.m_filegroup_id= f.FilegroupId;
dst.m_filegroup_version= f.FilegroupVersion;
--- 1.51/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2005-10-05 18:58:36 +10:00
+++ 1.52/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2005-10-06 21:16:32 +10:00
@@ -403,18 +403,18 @@
const Uint32 * data, Uint32 len,
bool fullyQualifiedNames);
- static int parseFileInfo(NdbFileImpl &dst,
- const Uint32 * data, Uint32 len);
-
- static int parseFilegroupInfo(NdbFilegroupImpl &dst,
- const Uint32 * data, Uint32 len);
-
+ int parseFileInfo(NdbFileImpl &dst,
+ const Uint32 * data, Uint32 len);
+
+ int parseFilegroupInfo(NdbFilegroupImpl &dst,
+ const Uint32 * data, Uint32 len);
+
int create_file(const NdbFileImpl &, const NdbFilegroupImpl&, bool overwrite =
false);
int drop_file(const NdbFileImpl &);
int create_filegroup(const NdbFilegroupImpl &);
int drop_filegroup(const NdbFilegroupImpl &);
- int get_filegroup(NdbFilegroupImpl&, NdbDictionary::Object::Type, int);
+ int get_filegroup(NdbFilegroupImpl&, NdbDictionary::Object::Type, Uint32);
int get_filegroup(NdbFilegroupImpl&,NdbDictionary::Object::Type,const char*);
int get_file(NdbFileImpl&, NdbDictionary::Object::Type, int, int);
int get_file(NdbFileImpl&, NdbDictionary::Object::Type, int, const char *);
| Thread |
|---|
| • bk commit into 5.1 tree (stewart:1.2035) | Stewart Smith | 6 Oct |