205
205
BaseString tmp(name);
206
206
Vector<BaseString> split;
207
207
if(tmp.split(split, "/") != 3){
208
err << "Invalid table name format " << name << endl;
208
err << "Invalid table name format `" << name << "`" << endl;
231
231
if (dict->createTable(copy) == -1)
233
err << "Create table " << table.getTableName() << " failed: "
233
err << "Create table `" << table.getTableName() << "` failed: "
234
234
<< dict->getNdbError() << endl;
237
info << "Successfully restored table " << table.getTableName()<< endl ;
237
info << "Successfully restored table `"
238
<< table.getTableName() << "`" << endl;
240
241
const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
242
err << "Unable to find table: " << split[2].c_str() << endl;
243
err << "Unable to find table: `" << split[2].c_str() << "`" << endl;
245
246
const NdbDictionary::Table* null = 0;
257
258
for(size_t i = 0; i<m_indexes.size(); i++){
258
259
NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]);
260
BaseString tmp(indtab.m_primaryTable.c_str());
261
261
Vector<BaseString> split;
262
if(tmp.split(split, "/") != 3){
263
err << "Invalid table name format " << indtab.m_primaryTable.c_str()
263
BaseString tmp(indtab.m_primaryTable.c_str());
264
if (tmp.split(split, "/") != 3)
266
err << "Invalid table name format `" << indtab.m_primaryTable.c_str()
268
272
m_ndb->setDatabaseName(split[0].c_str());
271
275
const NdbDictionary::Table * prim = dict->getTable(split[2].c_str());
273
err << "Unable to find base table \"" << split[2].c_str()
275
<< indtab.getName() << endl;
277
err << "Unable to find base table `" << split[2].c_str()
279
<< indtab.getName() << "`" << endl;
278
282
NdbTableImpl& base = NdbTableImpl::getImpl(*prim);
279
283
NdbIndexImpl* idx;
281
char idxName[255], buf[255];
282
if(sscanf(indtab.getName(), "%[^/]/%[^/]/%d/%s",
283
buf, buf, &id, idxName) != 4){
284
err << "Invalid index name format " << indtab.getName() << endl;
284
Vector<BaseString> split_idx;
286
BaseString tmp(indtab.getName());
287
if (tmp.split(split_idx, "/") != 4)
289
err << "Invalid index name format `" << indtab.getName() << "`" << endl;
287
293
if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base))
289
err << "Failed to create index " << idxName
290
<< " on " << split[2].c_str() << endl;
295
err << "Failed to create index `" << split_idx[3]
296
<< "` on " << split[2].c_str() << endl;
293
idx->setName(idxName);
299
idx->setName(split_idx[3].c_str());
294
300
if(dict->createIndex(* idx) != 0)
297
err << "Failed to create index " << idxName
298
<< " on " << split[2].c_str() << endl
303
err << "Failed to create index `" << split_idx[3].c_str()
304
<< "` on `" << split[2].c_str() << "`" << endl
299
305
<< dict->getNdbError() << endl;
304
info << "Successfully created index " << idxName
305
<< " on " << split[2].c_str() << endl;
310
info << "Successfully created index `" << split_idx[3].c_str()
311
<< "` on `" << split[2].c_str() << "`" << endl;
382
388
Uint32 length = (size * arraySize) / 8;
384
390
if (j == 0 && tup.getTable()->have_auto_inc(i))
385
tup.getTable()->update_max_auto_val(dataPtr,size);
391
tup.getTable()->update_max_auto_val(dataPtr,size*arraySize);
387
393
if (attr_desc->m_column->getPrimaryKey())
596
602
const char * dataPtr = attr->Data.string_value;
598
604
if (tup.m_table->have_auto_inc(attr->Desc->attrId))
599
tup.m_table->update_max_auto_val(dataPtr,size);
605
tup.m_table->update_max_auto_val(dataPtr,size*arraySize);
601
607
const Uint32 length = (size / 8) * arraySize;
602
608
if (attr->Desc->m_column->getPrimaryKey())