Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas 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.1991 05/09/07 07:56:16 jonas@eel.(none) +3 -0
ndb diskdata
wl1877 disk stored blobs
storage/ndb/tools/select_all.cpp
1.24 05/09/07 07:56:11 jonas@eel.(none) +41 -12
Add feature to dump disk_ref
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
1.45 05/09/07 07:56:11 jonas@eel.(none) +1 -1
Fix create table wrt to blobs
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
1.99 05/09/07 07:56:11 jonas@eel.(none) +6 -2
Fix create table wrt to blobs
# 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: jonas
# Host: eel.(none)
# Root: /home/jonas/src/mysql-5.1-ndb-dd
--- 1.98/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-09-06 20:02:15 +02:00
+++ 1.99/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2005-09-07 07:56:11 +02:00
@@ -1597,7 +1597,7 @@
m_error.code= 709;
DBUG_RETURN(-1);
}
- if (createBlobTables(*(info->m_table_impl)) != 0) {
+ if (createBlobTables(t, *(info->m_table_impl)) != 0) {
int save_code = m_error.code;
(void)dropTable(t);
m_error.code= save_code;
@@ -1607,15 +1607,19 @@
}
int
-NdbDictionaryImpl::createBlobTables(NdbTableImpl &t)
+NdbDictionaryImpl::createBlobTables(NdbTableImpl& org, NdbTableImpl &t)
{
DBUG_ENTER("NdbDictionaryImpl::createBlobTables");
for (unsigned i = 0; i < t.m_columns.size(); i++) {
NdbColumnImpl & c = *t.m_columns[i];
+ NdbColumnImpl & oc = *org.m_columns[i];
if (! c.getBlobType() || c.getPartSize() == 0)
continue;
NdbTableImpl bt;
+ NdbDictionary::Column::StorageType save = c.getStorageType();
+ c.setStorageType(oc.getStorageType());
NdbBlob::getBlobTable(bt, &t, &c);
+ c.setStorageType(save);
if (createTable(bt) != 0)
{
DBUG_RETURN(-1);
--- 1.44/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2005-07-21 16:15:16 +02:00
+++ 1.45/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2005-09-07 07:56:11 +02:00
@@ -484,7 +484,7 @@
bool setTransporter(class TransporterFacade * tf);
int createTable(NdbTableImpl &t);
- int createBlobTables(NdbTableImpl &);
+ int createBlobTables(NdbTableImpl& org, NdbTableImpl & created);
int addBlobTables(NdbTableImpl &);
int alterTable(NdbTableImpl &t);
int dropTable(const char * name);
--- 1.23/storage/ndb/tools/select_all.cpp 2005-04-08 02:44:34 +02:00
+++ 1.24/storage/ndb/tools/select_all.cpp 2005-09-07 07:56:11 +02:00
@@ -43,6 +43,8 @@
static int _unqualified, _header, _parallelism, _useHexFormat, _lock,
_order, _descending;
+static int _dumpDisk = 0;
+
static struct my_option my_long_options[] =
{
NDB_STD_OPTS("ndb_desc"),
@@ -70,6 +72,9 @@
{ "delimiter", 'D', "Column delimiter",
(gptr*) &_delimiter, (gptr*) &_delimiter, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
+ { "disk", 256, "Dump disk ref",
+ (gptr*) &_dumpDisk, (gptr*) &_dumpDisk, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
static void usage()
@@ -292,14 +297,24 @@
}
}
- for(int a = 0; a<pTab->getNoOfColumns(); a++){
- if((row->attributeStore(a) =
- pOp->getValue(pTab->getColumn(a)->getName())) == 0) {
+ bool disk= false;
+ for(int a = 0; a<pTab->getNoOfColumns(); a++)
+ {
+ const NdbDictionary::Column* col = pTab->getColumn(a);
+ if(col->getStorageType() == NdbDictionary::Column::StorageTypeDisk)
+ disk= true;
+
+ if((row->attributeStore(a) = pOp->getValue(col)) == 0)
+ {
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
return -1;
}
}
+
+ NdbRecAttr * disk_ref= 0;
+ if(_dumpDisk && disk)
+ disk_ref = pOp->getValue(NdbDictionary::Column::DISK_REF);
check = pTrans->execute(NdbTransaction::NoCommit);
if( check == -1 ) {
@@ -317,7 +332,12 @@
}
if (headers)
- row->header(ndbout) << endl;
+ row->header(ndbout);
+
+ if (disk_ref)
+ ndbout << "\tDISK_REF";
+
+ ndbout << endl;
int eof;
int rows = 0;
@@ -325,18 +345,27 @@
while(eof == 0){
rows++;
-
+
if (useHexFormat) {
- ndbout.setHexFormat(1) << (*row) << endl;
+ ndbout.setHexFormat(1) << (*row);
} else {
- ndbout << (*row) << endl;
+ ndbout << (*row);
}
-
+
+ if(disk_ref)
+ {
+ ndbout << "\t";
+ ndbout << "[ m_file_no: " << *(Uint16*)(disk_ref->aRef()+6)
+ << " m_page: " << disk_ref->u_32_value()
+ << " m_page_idx: " << *(Uint16*)(disk_ref->aRef() + 4) << "
]";
+ }
+
+ ndbout << endl;
eof = pOp->nextResult();
}
if (eof == -1) {
const NdbError err = pTrans->getNdbError();
-
+
if (err.status == NdbError::TemporaryError){
pNdb->closeTransaction(pTrans);
NdbSleep_MilliSleep(50);
@@ -347,11 +376,11 @@
pNdb->closeTransaction(pTrans);
return -1;
}
-
+
pNdb->closeTransaction(pTrans);
-
+
ndbout << rows << " rows returned" << endl;
-
+
return 0;
}
return -1;
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.1991) | jonas | 7 Sep |