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.2021 05/09/27 11:30:40 jonas@stripped +6 -0
ndb diskdata
fix bit fields (wrt null_pos)
Add disk tables to HUGO
Fix Bug_11133 for disk tables
storage/ndb/test/src/NDBT_Tables.cpp
1.21 05/09/27 11:30:37 jonas@stripped +120 -3
Add disk tables to HUGO
storage/ndb/test/run-test/daily-basic-tests.txt
1.35 05/09/27 11:30:37 jonas@stripped +90 -74
Add disk tables to HUGO
storage/ndb/test/include/NDBT_Table.hpp
1.12 05/09/27 11:30:37 jonas@stripped +3 -1
Add disk tables to HUGO
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp
1.45 05/09/27 11:30:37 jonas@stripped +1 -2
Fix bit field handling
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
1.79 05/09/27 11:30:37 jonas@stripped +44 -30
Fix testNdbApi -n Bug_11133
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp
1.32 05/09/27 11:30:37 jonas@stripped +19 -7
Fix another case of SR undo with table dropped....
# 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: perch.ndb.mysql.com
# Root: /home/jonas/src/mysql-5.1-ndb-dd
--- 1.31/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2005-09-08 13:19:54 +02:00
+++ 1.32/storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp 2005-09-27 11:30:37 +02:00
@@ -1253,6 +1253,7 @@
Uint32 id,
Uint32 page_id)
{
+ jamEntry();
Ptr<GlobalPage> page;
m_global_page_pool.getPtr(page, page_id);
@@ -1268,6 +1269,24 @@
pageP->nextList = pageP->prevList = RNIL;
}
+ Ptr<Tablerec> tabPtr;
+ tabPtr.i= pageP->m_table_id;
+ ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
+
+ if (tabPtr.p->tableStatus != DEFINED)
+ {
+ disk_restart_undo_next(signal);
+ return;
+ }
+
+ Ptr<Fragrecord> fragPtr;
+ getFragmentrec(fragPtr, pageP->m_fragment_id, tabPtr.p);
+ if(fragPtr.isNull())
+ {
+ disk_restart_undo_next(signal);
+ return;
+ }
+
Local_key key;
key.m_page_no = pageP->m_page_no;
key.m_file_no = pageP->m_file_no;
@@ -1299,13 +1318,6 @@
update= true;
pageP->m_restart_seq = globalData.m_restart_seq;
pageP->uncommitted_used_space = 0;
-
- Ptr<Tablerec> tabPtr;
- tabPtr.i= pageP->m_table_id;
- ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
-
- Ptr<Fragrecord> fragPtr;
- getFragmentrec(fragPtr, pageP->m_fragment_id, tabPtr.p);
Disk_alloc_info& alloc= fragPtr.p->m_disk_alloc_info;
Uint32 idx= alloc.calc_page_free_bits(pageP->free_space);
--- 1.34/storage/ndb/test/run-test/daily-basic-tests.txt 2005-07-22 15:27:09 +02:00
+++ 1.35/storage/ndb/test/run-test/daily-basic-tests.txt 2005-09-27 11:30:37 +02:00
@@ -81,23 +81,23 @@
max-time: 500
cmd: testBasic
-args: -n PkReadAndLocker T6
+args: -n PkReadAndLocker T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n PkReadAndLocker2 T6
+args: -n PkReadAndLocker2 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n PkReadUpdateAndLocker T6
+args: -n PkReadUpdateAndLocker T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n ReadWithLocksAndInserts T6
+args: -n ReadWithLocksAndInserts T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n PkInsertTwice T1 T6 T10
+args: -n PkInsertTwice T1 T6 T10 D1 D2
max-time: 1500
cmd: testBasic
@@ -109,79 +109,79 @@
max-time: 500
cmd: testBasic
-args: -n NoCommitSleep T6
+args: -n NoCommitSleep T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommit626 T6
+args: -n NoCommit626 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommitAndClose T6
+args: -n NoCommitAndClose T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n Commit626 T6
+args: -n Commit626 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n CommitTry626 T6
+args: -n CommitTry626 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n CommitAsMuch626 T6
+args: -n CommitAsMuch626 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommit626 T6
+args: -n NoCommit626 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommitRollback626 T1 T6
+args: -n NoCommitRollback626 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n Commit630 T1 T6
+args: -n Commit630 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n CommitTry630 T1 T6
+args: -n CommitTry630 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n CommitAsMuch630 T1 T6
+args: -n CommitAsMuch630 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommit630 T1 T6
+args: -n NoCommit630 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommitRollback630 T1 T6
+args: -n NoCommitRollback630 T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n NoCommitAndClose T1 T6
+args: -n NoCommitAndClose T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n RollbackUpdate T1 T6
+args: -n RollbackUpdate T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n RollbackDeleteMultiple T1 T6
+args: -n RollbackDeleteMultiple T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n ImplicitRollbackDelete T1 T6
+args: -n ImplicitRollbackDelete T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n CommitDelete T1 T6
+args: -n CommitDelete T1 T6 D1 D2
max-time: 500
cmd: testBasic
-args: -n RollbackNothing T1 T6
+args: -n RollbackNothing T1 T6 D1 D2
max-time: 500
cmd: testBasicAsynch
@@ -201,11 +201,11 @@
max-time: 500
cmd: testBasic
-args: -n MassiveRollback T1 T6 T13
+args: -n MassiveRollback T1 T6 T13 D1 D2
max-time: 500
cmd: testBasic
-args: -n MassiveRollback2 T1 T6 T13
+args: -n MassiveRollback2 T1 T6 T13 D1 D2
max-time: 500
cmd: testTimeout
@@ -231,7 +231,7 @@
max-time: 500
cmd: testScan
-args: -n ScanUpdate2 T6
+args: -n ScanUpdate2 T6 D1 D2
max-time: 500
cmd: testScan
@@ -239,47 +239,47 @@
max-time: 500
cmd: testScan
-args: -n ScanDelete2 T10
+args: -n ScanDelete2 T10 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanUpdateAndScanRead T6
+args: -n ScanUpdateAndScanRead T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadAndLocker T6
+args: -n ScanReadAndLocker T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadAndPkRead T6
+args: -n ScanReadAndPkRead T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanRead488 -l 10 T6
+args: -n ScanRead488 -l 10 T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanRead488O -l 10 T6
+args: -n ScanRead488O -l 10 T6 D1 D2
max-time: 1000
cmd: testScan
-args: -n ScanRead488_Mixed -l 10 T6
+args: -n ScanRead488_Mixed -l 10 T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanRead488Timeout -l 10 T6
+args: -n ScanRead488Timeout -l 10 T6 D1 D2
max-time: 600
cmd: testScan
-args: -n ScanRead40 -l 100 T2
+args: -n ScanRead40 -l 100 T2 D1 D2
max-time: 1800
cmd: testScan
-args: -n ScanRead100 -l 100 T1
+args: -n ScanRead100 -l 100 T1 D1 D2
max-time: 600
cmd: testScan
-args: -n ScanRead40 -l 100 T1
+args: -n ScanRead40 -l 100 T1 D1 D2
max-time: 1800
cmd: testScan
@@ -291,123 +291,123 @@
max-time: 500
cmd: testScan
-args: -n ScanWithLocksAndInserts T6
+args: -n ScanWithLocksAndInserts T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadAbort T6
+args: -n ScanReadAbort T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadAbort15 T6
+args: -n ScanReadAbort15 T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadAbort240 T6
+args: -n ScanReadAbort240 T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanUpdateAbort16 T6
+args: -n ScanUpdateAbort16 T6 D1 D2
max-time: 3600
cmd: testScan
-args: -n ScanReadRestart T1 T6 T13
+args: -n ScanReadRestart T1 T6 T13 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanUpdateRestart T6
+args: -n ScanUpdateRestart T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CheckGetValue T6
+args: -n CheckGetValue T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CloseWithoutStop T6
+args: -n CloseWithoutStop T6 D1 D2
max-time: 500
cmd: testScan
-args: -n NextScanWhenNoMore T6
+args: -n NextScanWhenNoMore T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ExecuteScanWithoutOpenScan T6
+args: -n ExecuteScanWithoutOpenScan T6 D1 D2
max-time: 500
cmd: testScan
-args: -n OnlyOpenScanOnce T6
+args: -n OnlyOpenScanOnce T6 D1 D2
max-time: 500
cmd: testScan
-args: -n OnlyOneOpInScanTrans T6
+args: -n OnlyOneOpInScanTrans T6 D1 D2
max-time: 500
cmd: testScan
-args: -n OnlyOneOpBeforeOpenScan T6
+args: -n OnlyOneOpBeforeOpenScan T6 D1 D2
max-time: 500
cmd: testScan
-args: -n OnlyOneScanPerTrans T6
+args: -n OnlyOneScanPerTrans T6 D1 D2
max-time: 500
cmd: testScan
-args: -n NoCloseTransaction T6
+args: -n NoCloseTransaction T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CheckInactivityTimeOut T6
+args: -n CheckInactivityTimeOut T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CheckInactivityBeforeClose T6
+args: -n CheckInactivityBeforeClose T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CheckAfterTerror T6
+args: -n CheckAfterTerror T6 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadError5021 T1
+args: -n ScanReadError5021 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReaderror5022 T1
+args: -n ScanReaderror5022 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadError5023 T1
+args: -n ScanReadError5023 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadError5024 T1
+args: -n ScanReadError5024 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadError5025 T1
+args: -n ScanReadError5025 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadError5030 T1
+args: -n ScanReadError5030 T1 D1 D2
max-time: 500
cmd: testScan
-args: -n InsertDelete T1 T6
+args: -n InsertDelete T1 T6 D1 D2
max-time: 500
cmd: testScan
-args: -n CheckAfterTerror T1
+args: -n CheckAfterTerror T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanReadWhileNodeIsDown T1
+args: -n ScanReadWhileNodeIsDown T1 D1 D2
max-time: 500
cmd: testScan
-args: -n ScanRestart T1
+args: -n ScanRestart T1 D1 D2
max-time: 500
cmd: testScan
-args: -l 100 -n Scan-bug8262 T7
+args: -l 100 -n Scan-bug8262 T7 D1 D2
max-time: 500
cmd: testScan
@@ -425,7 +425,7 @@
max-time: 1500
cmd: testDict
-args: -n CreateAndDropDuring T6 T10
+args: -n CreateAndDropDuring T6 T10 D1 D2
max-time: 1500
cmd: testDict
@@ -510,23 +510,23 @@
max-time: 500
cmd: testNdbApi
-args: -n UpdateWithoutKeys T6
+args: -n UpdateWithoutKeys T6 D1 D2
max-time: 500
cmd: testNdbApi
-args: -n UpdateWithoutValues T6
+args: -n UpdateWithoutValues T6 D1 D2
max-time: 500
cmd: testNdbApi
-args: -n ReadWithoutGetValue
+args: -n ReadWithoutGetValue D1 D2
max-time: 500
cmd: testNdbApi
-args: -n Bug_11133 T1
+args: -n Bug_11133 T1 D1 D2
max-time: 500
cmd: testNdbApi
-args: -n Scan_4006 T1
+args: -n Scan_4006 T1 D1 D2
#max-time: 500
#cmd: testInterpreter
@@ -582,6 +582,14 @@
max-time: 1500
cmd: testSystemRestart
+args: -n SR1 D1
+
+max-time: 1500
+cmd: testSystemRestart
+args: -n SR1 D2
+
+max-time: 1500
+cmd: testSystemRestart
args: -n SR2 T1
max-time: 1500
@@ -591,6 +599,14 @@
max-time: 1500
cmd: testSystemRestart
args: -n SR2 T7
+
+max-time: 1500
+cmd: testSystemRestart
+args: -n SR2 D1
+
+max-time: 1500
+cmd: testSystemRestart
+args: -n SR2 D2
max-time: 1500
cmd: testSystemRestart
--- 1.78/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2005-09-20 15:03:42 +02:00
+++ 1.79/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2005-09-27 11:30:37 +02:00
@@ -1353,7 +1353,8 @@
if (checkNullAttributes(req_struct, regTabPtr) == false)
{
- return -1;
+
+ goto null_check_error;
}
if (regTabPtr->need_shrink())
@@ -1366,27 +1367,43 @@
*/
if(regOperPtr.p->is_first_operation())
{
- Uint32 frag_page_id;
- if (!regTabPtr->m_attributes[MM].m_no_of_varsize)
- {
- jam();
- if ((ptr= alloc_fix_rec(regFragPtr,
- regTabPtr,
- ®OperPtr.p->m_tuple_location,
- &frag_page_id)) == 0)
- goto mem_error;
- }
- else
+ Uint32 frag_page_id = req_struct->frag_page_id;
+ Uint32 real_page_id = regOperPtr.p->m_tuple_location.m_page_no;
+ regOperPtr.p->m_tuple_location.m_page_no = frag_page_id;
+ if (likely(get_tuple_state(regOperPtr.p) == TUPLE_INITIAL_INSERT))
{
- jam();
- regOperPtr.p->m_tuple_location.m_file_no= sizes[2+MM];
- if ((ptr= alloc_var_rec(regFragPtr, regTabPtr,
- sizes[2+MM],
- ®OperPtr.p->m_tuple_location,
- &frag_page_id, 0)) == 0)
- goto mem_error;
- }
+ if (!regTabPtr->m_attributes[MM].m_no_of_varsize)
+ {
+ jam();
+ if ((ptr= alloc_fix_rec(regFragPtr,
+ regTabPtr,
+ ®OperPtr.p->m_tuple_location,
+ &frag_page_id)) == 0)
+ {
+ goto mem_error;
+ }
+ }
+ else
+ {
+ jam();
+ regOperPtr.p->m_tuple_location.m_file_no= sizes[2+MM];
+ if ((ptr= alloc_var_rec(regFragPtr, regTabPtr,
+ sizes[2+MM],
+ ®OperPtr.p->m_tuple_location,
+ &frag_page_id, 0)) == 0)
+ goto mem_error;
+ }
+ real_page_id = regOperPtr.p->m_tuple_location.m_page_no;
+ regOperPtr.p->m_tuple_location.m_page_no= frag_page_id;
+ c_lqh->accminupdate(signal,
+ regOperPtr.p->userpointer,
+ ®OperPtr.p->m_tuple_location);
+
+ ((Tuple_header*)ptr)->m_operation_ptr_i= regOperPtr.i;
+ ((Tuple_header*)ptr)->m_header_bits= Tuple_header::ALLOC;
+ }
+
if (regTabPtr->m_no_of_disk_attributes)
{
Local_key tmp;
@@ -1408,17 +1425,9 @@
disk_ptr->m_base_record_ref= regOperPtr.p->m_tuple_location.ref();
}
- ((Tuple_header*)ptr)->m_operation_ptr_i= regOperPtr.i;
- ((Tuple_header*)ptr)->m_header_bits= Tuple_header::ALLOC;
+ regOperPtr.p->m_tuple_location.m_page_no = real_page_id;
tuple_ptr->m_header_bits |= Tuple_header::ALLOC;
-
- Uint32 tmp= regOperPtr.p->m_tuple_location.m_page_no;
- regOperPtr.p->m_tuple_location.m_page_no= frag_page_id;
- c_lqh->accminupdate(signal,
- regOperPtr.p->userpointer,
- ®OperPtr.p->m_tuple_location);
- regOperPtr.p->m_tuple_location.m_page_no= tmp;
-
+
if (regTabPtr->checksumIndicator) {
jam();
setChecksum(req_struct->m_tuple_ptr, regTabPtr);
@@ -1449,6 +1458,10 @@
mem_error:
terrorCode= ZMEM_NOMEM_ERROR;
goto error;
+
+null_check_error:
+ terrorCode= ZNO_ILLEGAL_NULL_ATTR;
+ goto error;
error:
tupkeyErrorLab(signal);
@@ -2515,6 +2528,7 @@
{
sizes[MM]= 1;
dst_ptr -= Tuple_header::HeaderSize;
+ src_ptr -= Tuple_header::HeaderSize;
memcpy(ptr, src, 4*fix_size);
}
--- 1.44/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2005-09-16 17:44:30 +02:00
+++ 1.45/storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp 2005-09-27 11:30:37 +02:00
@@ -343,16 +343,15 @@
Uint32 words= (bytes + 3) / 4;
Uint32 ind= AttributeDescriptor::getDiskBased(attrDescriptor);
ndbrequire(ind <= 1);
+ null_pos= fragOperPtr.p->m_null_bits[ind];
if (AttributeDescriptor::getNullable(attrDescriptor))
{
ljam();
- null_pos= fragOperPtr.p->m_null_bits[ind];
fragOperPtr.p->m_null_bits[ind]++;
}
else
{
- null_pos= 0;
regTabPtr.p->notNullAttributeMask.set(attrId);
}
--- 1.11/storage/ndb/test/include/NDBT_Table.hpp 2005-09-15 10:42:05 +02:00
+++ 1.12/storage/ndb/test/include/NDBT_Table.hpp 2005-09-27 11:30:37 +02:00
@@ -29,7 +29,8 @@
int _length = 1,
bool _pk = false,
bool _nullable = false,
- CHARSET_INFO *cs= 0):
+ CHARSET_INFO *cs= 0,
+ NdbDictionary::Column::StorageType storage = NdbDictionary::Column::StorageTypeMemory):
NdbDictionary::Column(_name)
{
assert(_name != 0);
@@ -42,6 +43,7 @@
{
setCharset(cs);
}
+ setStorageType(storage);
}
};
--- 1.20/storage/ndb/test/src/NDBT_Tables.cpp 2005-09-16 17:06:46 +02:00
+++ 1.21/storage/ndb/test/src/NDBT_Tables.cpp 2005-09-27 11:30:37 +02:00
@@ -383,6 +383,35 @@
NDBT_Table I3("I3", sizeof(I3_Cols)/sizeof(NDBT_Attribute), I3_Cols
); // ,I3_Indexes);
+/* D1 */
+static
+const
+NDBT_Attribute D1Attribs[] = {
+ NDBT_Attribute("KOL1", NdbDictionary::Column::Unsigned, 1, true),
+ NDBT_Attribute("KOL2", NdbDictionary::Column::Unsigned, 1, false, false, 0, NdbDictionary::Column::StorageTypeDisk),
+ NDBT_Attribute("KOL3", NdbDictionary::Column::Unsigned),
+ NDBT_Attribute("KOL4", NdbDictionary::Column::Char, 233, false, true, 0, NdbDictionary::Column::StorageTypeDisk),
+ NDBT_Attribute("KOL5", NdbDictionary::Column::Unsigned),
+};
+static
+const
+NDBT_Table D1("D1", sizeof(D1Attribs)/sizeof(NDBT_Attribute), D1Attribs);
+
+static
+const
+NDBT_Attribute D2Attribs[] = {
+ NDBT_Attribute("KOL1", NdbDictionary::Column::Varbinary, 127, true),
+ NDBT_Attribute("KOL2", NdbDictionary::Column::Unsigned, 1, false, false, 0, NdbDictionary::Column::StorageTypeDisk),
+ NDBT_Attribute("KOL3", NdbDictionary::Column::Unsigned),
+ NDBT_Attribute("KOL4", NdbDictionary::Column::Varbinary, 133),
+ NDBT_Attribute("KOL5", NdbDictionary::Column::Char, 199, false, true, 0, NdbDictionary::Column::StorageTypeDisk),
+ NDBT_Attribute("KOL6", NdbDictionary::Column::Bit, 21, false, false, 0, NdbDictionary::Column::StorageTypeDisk),
+};
+static
+const
+NDBT_Table D2("D2", sizeof(D2Attribs)/sizeof(NDBT_Attribute), D2Attribs);
+
+
// Define array with pointer to all tables
static
const
@@ -404,7 +433,8 @@
&T14,
&I1,
&I2,
- &I3
+ &I3,
+ &D1, &D2
};
struct NDBT_IndexList {
@@ -818,6 +848,83 @@
return createAllTables(pNdb, false);
}
+static
+int
+create_default_tablespace(Ndb* pNdb)
+{
+ NdbDictionary::LogfileGroup lg;
+ lg.setName("DEFAULT-LG");
+ lg.setUndoBufferSize(8*1024*1024);
+
+ int res;
+ res = pNdb->getDictionary()->createLogfileGroup(lg);
+ if(res != 0){
+ g_err << "Failed to create logfilegroup:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ NdbDictionary::Undofile uf;
+ uf.setPath("undofile01.dat");
+ uf.setSize(32*1024*1024);
+ uf.setLogfileGroup("DEFAULT-LG");
+
+ res = pNdb->getDictionary()->createUndofile(uf);
+ if(res != 0){
+ g_err << "Failed to create undofile:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ uf.setPath("undofile02.dat");
+ uf.setSize(32*1024*1024);
+ uf.setLogfileGroup("DEFAULT-LG");
+
+ res = pNdb->getDictionary()->createUndofile(uf);
+ if(res != 0){
+ g_err << "Failed to create undofile:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ NdbDictionary::Tablespace ts;
+ ts.setName("DEFAULT-TS");
+ ts.setExtentSize(1024*1024);
+ ts.setDefaultLogfileGroup("DEFAULT-LG");
+
+ res = pNdb->getDictionary()->createTablespace(ts);
+ if(res != 0){
+ g_err << "Failed to create tablespace:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ NdbDictionary::Datafile df;
+ df.setPath("datafile01.dat");
+ df.setSize(64*1024*1024);
+ df.setTablespace("DEFAULT-TS");
+
+ res = pNdb->getDictionary()->createDatafile(df);
+ if(res != 0){
+ g_err << "Failed to create datafile:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ df.setPath("datafile02.dat");
+ df.setSize(64*1024*1024);
+ df.setTablespace("DEFAULT-TS");
+
+ res = pNdb->getDictionary()->createDatafile(df);
+ if(res != 0){
+ g_err << "Failed to create datafile:"
+ << endl << pNdb->getDictionary()->getNdbError() << endl;
+ return NDBT_FAILED;
+ }
+
+ return NDBT_OK;
+}
+
int
NDBT_Tables::createTable(Ndb* pNdb, const char* _name, bool _temp,
bool existsOk, NDBT_CreateTableHook f, void* arg)
@@ -838,17 +945,27 @@
{
ndbout << "Failed to create table" << endl;
return NDBT_FAILED;
- }
+ }
+loop:
r = pNdb->getDictionary()->createTable(tmpTab);
if(r == -1){
+ if(pNdb->getDictionary()->getNdbError().code == 723)
+ {
+ if (create_default_tablespace(pNdb) == 0)
+ {
+ goto loop;
+ }
+ }
if(!existsOk){
- ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl;
+ ndbout << "Error0: " << pNdb->getDictionary()->getNdbError() << endl;
+
break;
}
if(pNdb->getDictionary()->getNdbError().code != 721){
ndbout << "Error: " << pNdb->getDictionary()->getNdbError() << endl;
break;
}
+
r = 0;
}
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2021) | jonas | 27 Sep |