~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to storage/ndb/src/ndbapi/NdbDictionary.cpp

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include <NdbDictionary.hpp>
 
17
#include "NdbDictionaryImpl.hpp"
 
18
#include <NdbOut.hpp>
 
19
 
 
20
NdbDictionary::ObjectId::ObjectId()
 
21
  : m_impl(* new NdbDictObjectImpl(NdbDictionary::Object::TypeUndefined))
 
22
{
 
23
}
 
24
 
 
25
NdbDictionary::ObjectId::~ObjectId()
 
26
{
 
27
  NdbDictObjectImpl * tmp = &m_impl;  
 
28
  delete tmp;
 
29
}
 
30
 
 
31
NdbDictionary::Object::Status
 
32
NdbDictionary::ObjectId::getObjectStatus() const {
 
33
  return m_impl.m_status;
 
34
}
 
35
 
 
36
int 
 
37
NdbDictionary::ObjectId::getObjectVersion() const {
 
38
  return m_impl.m_version;
 
39
}
 
40
 
 
41
int 
 
42
NdbDictionary::ObjectId::getObjectId() const {
 
43
  return m_impl.m_id;
 
44
}
 
45
 
 
46
/*****************************************************************
 
47
 * Column facade
 
48
 */
 
49
NdbDictionary::Column::Column(const char * name) 
 
50
  : m_impl(* new NdbColumnImpl(* this))
 
51
{
 
52
  setName(name);
 
53
}
 
54
 
 
55
NdbDictionary::Column::Column(const NdbDictionary::Column & org)
 
56
  : m_impl(* new NdbColumnImpl(* this))
 
57
{
 
58
  m_impl = org.m_impl;
 
59
}
 
60
 
 
61
NdbDictionary::Column::Column(NdbColumnImpl& impl)
 
62
  : m_impl(impl)
 
63
{
 
64
}
 
65
 
 
66
NdbDictionary::Column::~Column(){
 
67
  NdbColumnImpl * tmp = &m_impl;  
 
68
  if(this != tmp){
 
69
    delete tmp;
 
70
  }
 
71
}
 
72
 
 
73
NdbDictionary::Column&
 
74
NdbDictionary::Column::operator=(const NdbDictionary::Column& column)
 
75
{
 
76
  m_impl = column.m_impl;
 
77
  
 
78
  return *this;
 
79
}
 
80
 
 
81
int
 
82
NdbDictionary::Column::setName(const char * name){
 
83
  return !m_impl.m_name.assign(name);
 
84
}
 
85
 
 
86
const char* 
 
87
NdbDictionary::Column::getName() const {
 
88
  return m_impl.m_name.c_str();
 
89
}
 
90
 
 
91
void
 
92
NdbDictionary::Column::setType(Type t){
 
93
  m_impl.init(t);
 
94
}
 
95
 
 
96
NdbDictionary::Column::Type 
 
97
NdbDictionary::Column::getType() const {
 
98
  return m_impl.m_type;
 
99
}
 
100
 
 
101
void 
 
102
NdbDictionary::Column::setPrecision(int val){
 
103
  m_impl.m_precision = val;
 
104
}
 
105
 
 
106
int 
 
107
NdbDictionary::Column::getPrecision() const {
 
108
  return m_impl.m_precision;
 
109
}
 
110
 
 
111
void 
 
112
NdbDictionary::Column::setScale(int val){
 
113
  m_impl.m_scale = val;
 
114
}
 
115
 
 
116
int 
 
117
NdbDictionary::Column::getScale() const{
 
118
  return m_impl.m_scale;
 
119
}
 
120
 
 
121
void
 
122
NdbDictionary::Column::setLength(int length){
 
123
  m_impl.m_length = length;
 
124
}
 
125
 
 
126
int 
 
127
NdbDictionary::Column::getLength() const{
 
128
  return m_impl.m_length;
 
129
}
 
130
 
 
131
void
 
132
NdbDictionary::Column::setInlineSize(int size)
 
133
{
 
134
  m_impl.m_precision = size;
 
135
}
 
136
 
 
137
void
 
138
NdbDictionary::Column::setCharset(CHARSET_INFO* cs)
 
139
{
 
140
  m_impl.m_cs = cs;
 
141
}
 
142
 
 
143
CHARSET_INFO*
 
144
NdbDictionary::Column::getCharset() const
 
145
{
 
146
  return m_impl.m_cs;
 
147
}
 
148
 
 
149
int
 
150
NdbDictionary::Column::getInlineSize() const
 
151
{
 
152
  return m_impl.m_precision;
 
153
}
 
154
 
 
155
void
 
156
NdbDictionary::Column::setPartSize(int size)
 
157
{
 
158
  m_impl.m_scale = size;
 
159
}
 
160
 
 
161
int
 
162
NdbDictionary::Column::getPartSize() const
 
163
{
 
164
  return m_impl.m_scale;
 
165
}
 
166
 
 
167
void
 
168
NdbDictionary::Column::setStripeSize(int size)
 
169
{
 
170
  m_impl.m_length = size;
 
171
}
 
172
 
 
173
int
 
174
NdbDictionary::Column::getStripeSize() const
 
175
{
 
176
  return m_impl.m_length;
 
177
}
 
178
 
 
179
int 
 
180
NdbDictionary::Column::getSize() const{
 
181
  return m_impl.m_attrSize;
 
182
}
 
183
 
 
184
void 
 
185
NdbDictionary::Column::setNullable(bool val){
 
186
  m_impl.m_nullable = val;
 
187
}
 
188
 
 
189
bool 
 
190
NdbDictionary::Column::getNullable() const {
 
191
  return m_impl.m_nullable;
 
192
}
 
193
 
 
194
void 
 
195
NdbDictionary::Column::setPrimaryKey(bool val){
 
196
  m_impl.m_pk = val;
 
197
}
 
198
 
 
199
bool 
 
200
NdbDictionary::Column::getPrimaryKey() const {
 
201
  return m_impl.m_pk;
 
202
}
 
203
 
 
204
void 
 
205
NdbDictionary::Column::setPartitionKey(bool val){
 
206
  m_impl.m_distributionKey = val;
 
207
}
 
208
 
 
209
bool 
 
210
NdbDictionary::Column::getPartitionKey() const{
 
211
  return m_impl.m_distributionKey;
 
212
}
 
213
 
 
214
const NdbDictionary::Table * 
 
215
NdbDictionary::Column::getBlobTable() const {
 
216
  NdbTableImpl * t = m_impl.m_blobTable;
 
217
  if (t)
 
218
    return t->m_facade;
 
219
  return 0;
 
220
}
 
221
 
 
222
void 
 
223
NdbDictionary::Column::setAutoIncrement(bool val){
 
224
  m_impl.m_autoIncrement = val;
 
225
}
 
226
 
 
227
bool 
 
228
NdbDictionary::Column::getAutoIncrement() const {
 
229
  return m_impl.m_autoIncrement;
 
230
}
 
231
 
 
232
void
 
233
NdbDictionary::Column::setAutoIncrementInitialValue(Uint64 val){
 
234
  m_impl.m_autoIncrementInitialValue = val;
 
235
}
 
236
 
 
237
int
 
238
NdbDictionary::Column::setDefaultValue(const char* defaultValue)
 
239
{
 
240
  return !m_impl.m_defaultValue.assign(defaultValue);
 
241
}
 
242
 
 
243
const char*
 
244
NdbDictionary::Column::getDefaultValue() const
 
245
{
 
246
  return m_impl.m_defaultValue.c_str();
 
247
}
 
248
 
 
249
int
 
250
NdbDictionary::Column::getColumnNo() const {
 
251
  return m_impl.m_column_no;
 
252
}
 
253
 
 
254
int
 
255
NdbDictionary::Column::getAttrId() const {
 
256
  return m_impl.m_attrId;;
 
257
}
 
258
 
 
259
bool
 
260
NdbDictionary::Column::equal(const NdbDictionary::Column & col) const {
 
261
  return m_impl.equal(col.m_impl);
 
262
}
 
263
 
 
264
int
 
265
NdbDictionary::Column::getSizeInBytes() const 
 
266
{
 
267
  return m_impl.m_attrSize * m_impl.m_arraySize;
 
268
}
 
269
 
 
270
void
 
271
NdbDictionary::Column::setArrayType(ArrayType type)
 
272
{
 
273
  m_impl.m_arrayType = type;
 
274
}
 
275
 
 
276
NdbDictionary::Column::ArrayType
 
277
NdbDictionary::Column::getArrayType() const
 
278
{
 
279
  return (ArrayType)m_impl.m_arrayType;
 
280
}
 
281
 
 
282
void
 
283
NdbDictionary::Column::setStorageType(StorageType type)
 
284
{
 
285
  m_impl.m_storageType = type;
 
286
}
 
287
 
 
288
NdbDictionary::Column::StorageType
 
289
NdbDictionary::Column::getStorageType() const
 
290
{
 
291
  return (StorageType)m_impl.m_storageType;
 
292
}
 
293
 
 
294
/*****************************************************************
 
295
 * Table facade
 
296
 */
 
297
NdbDictionary::Table::Table(const char * name)
 
298
  : m_impl(* new NdbTableImpl(* this)) 
 
299
{
 
300
  setName(name);
 
301
}
 
302
 
 
303
NdbDictionary::Table::Table(const NdbDictionary::Table & org)
 
304
  : Object(org), m_impl(* new NdbTableImpl(* this))
 
305
{
 
306
  m_impl.assign(org.m_impl);
 
307
}
 
308
 
 
309
NdbDictionary::Table::Table(NdbTableImpl & impl)
 
310
  : m_impl(impl)
 
311
{
 
312
}
 
313
 
 
314
NdbDictionary::Table::~Table(){
 
315
  NdbTableImpl * tmp = &m_impl;  
 
316
  if(this != tmp){
 
317
    delete tmp;
 
318
  }
 
319
}
 
320
 
 
321
NdbDictionary::Table&
 
322
NdbDictionary::Table::operator=(const NdbDictionary::Table& table)
 
323
{
 
324
  m_impl.assign(table.m_impl);
 
325
  
 
326
  m_impl.m_facade = this;
 
327
  return *this;
 
328
}
 
329
 
 
330
int
 
331
NdbDictionary::Table::setName(const char * name){
 
332
  return m_impl.setName(name);
 
333
}
 
334
 
 
335
const char * 
 
336
NdbDictionary::Table::getName() const {
 
337
  return m_impl.getName();
 
338
}
 
339
 
 
340
const char *
 
341
NdbDictionary::Table::getMysqlName() const {
 
342
  return m_impl.getMysqlName();
 
343
}
 
344
 
 
345
int
 
346
NdbDictionary::Table::getTableId() const {
 
347
  return m_impl.m_id;
 
348
}
 
349
 
 
350
int
 
351
NdbDictionary::Table::addColumn(const Column & c){
 
352
  NdbColumnImpl* col = new NdbColumnImpl;
 
353
  if (col ==  NULL)
 
354
  {
 
355
    errno = ENOMEM;
 
356
    return -1;
 
357
  }
 
358
  (* col) = NdbColumnImpl::getImpl(c);
 
359
  if (m_impl.m_columns.push_back(col))
 
360
  {
 
361
    return -1;
 
362
  }
 
363
  if (m_impl.buildColumnHash())
 
364
  {
 
365
    return -1;
 
366
  }
 
367
  return 0;
 
368
}
 
369
 
 
370
const NdbDictionary::Column*
 
371
NdbDictionary::Table::getColumn(const char * name) const {
 
372
  return m_impl.getColumn(name);
 
373
}
 
374
 
 
375
const NdbDictionary::Column* 
 
376
NdbDictionary::Table::getColumn(const int attrId) const {
 
377
  return m_impl.getColumn(attrId);
 
378
}
 
379
 
 
380
NdbDictionary::Column*
 
381
NdbDictionary::Table::getColumn(const char * name) 
 
382
{
 
383
  return m_impl.getColumn(name);
 
384
}
 
385
 
 
386
NdbDictionary::Column* 
 
387
NdbDictionary::Table::getColumn(const int attrId)
 
388
{
 
389
  return m_impl.getColumn(attrId);
 
390
}
 
391
 
 
392
void
 
393
NdbDictionary::Table::setLogging(bool val){
 
394
  m_impl.m_logging = val;
 
395
}
 
396
 
 
397
bool 
 
398
NdbDictionary::Table::getLogging() const {
 
399
  return m_impl.m_logging;
 
400
}
 
401
 
 
402
void
 
403
NdbDictionary::Table::setFragmentType(FragmentType ft){
 
404
  m_impl.m_fragmentType = ft;
 
405
}
 
406
 
 
407
NdbDictionary::Object::FragmentType 
 
408
NdbDictionary::Table::getFragmentType() const {
 
409
  return m_impl.m_fragmentType;
 
410
}
 
411
 
 
412
void 
 
413
NdbDictionary::Table::setKValue(int kValue){
 
414
  m_impl.m_kvalue = kValue;
 
415
}
 
416
 
 
417
int
 
418
NdbDictionary::Table::getKValue() const {
 
419
  return m_impl.m_kvalue;
 
420
}
 
421
 
 
422
void 
 
423
NdbDictionary::Table::setMinLoadFactor(int lf){
 
424
  m_impl.m_minLoadFactor = lf;
 
425
}
 
426
 
 
427
int 
 
428
NdbDictionary::Table::getMinLoadFactor() const {
 
429
  return m_impl.m_minLoadFactor;
 
430
}
 
431
 
 
432
void 
 
433
NdbDictionary::Table::setMaxLoadFactor(int lf){
 
434
  m_impl.m_maxLoadFactor = lf;  
 
435
}
 
436
 
 
437
int 
 
438
NdbDictionary::Table::getMaxLoadFactor() const {
 
439
  return m_impl.m_maxLoadFactor;
 
440
}
 
441
 
 
442
int
 
443
NdbDictionary::Table::getNoOfColumns() const {
 
444
  return m_impl.m_columns.size();
 
445
}
 
446
 
 
447
int
 
448
NdbDictionary::Table::getNoOfPrimaryKeys() const {
 
449
  return m_impl.m_noOfKeys;
 
450
}
 
451
 
 
452
void
 
453
NdbDictionary::Table::setMaxRows(Uint64 maxRows)
 
454
{
 
455
  m_impl.m_max_rows = maxRows;
 
456
}
 
457
 
 
458
Uint64
 
459
NdbDictionary::Table::getMaxRows() const
 
460
{
 
461
  return m_impl.m_max_rows;
 
462
}
 
463
 
 
464
void
 
465
NdbDictionary::Table::setMinRows(Uint64 minRows)
 
466
{
 
467
  m_impl.m_min_rows = minRows;
 
468
}
 
469
 
 
470
Uint64
 
471
NdbDictionary::Table::getMinRows() const
 
472
{
 
473
  return m_impl.m_min_rows;
 
474
}
 
475
 
 
476
void
 
477
NdbDictionary::Table::setDefaultNoPartitionsFlag(Uint32 flag)
 
478
{
 
479
  m_impl.m_default_no_part_flag = flag;;
 
480
}
 
481
 
 
482
Uint32
 
483
NdbDictionary::Table::getDefaultNoPartitionsFlag() const
 
484
{
 
485
  return m_impl.m_default_no_part_flag;
 
486
}
 
487
 
 
488
const char*
 
489
NdbDictionary::Table::getPrimaryKey(int no) const {
 
490
  int count = 0;
 
491
  for (unsigned i = 0; i < m_impl.m_columns.size(); i++) {
 
492
    if (m_impl.m_columns[i]->m_pk) {
 
493
      if (count++ == no)
 
494
        return m_impl.m_columns[i]->m_name.c_str();
 
495
    }
 
496
  }
 
497
  return 0;
 
498
}
 
499
 
 
500
const void* 
 
501
NdbDictionary::Table::getFrmData() const {
 
502
  return m_impl.getFrmData();
 
503
}
 
504
 
 
505
Uint32
 
506
NdbDictionary::Table::getFrmLength() const {
 
507
  return m_impl.getFrmLength();
 
508
}
 
509
 
 
510
enum NdbDictionary::Table::SingleUserMode
 
511
NdbDictionary::Table::getSingleUserMode() const
 
512
{
 
513
  return (enum SingleUserMode)m_impl.m_single_user_mode;
 
514
}
 
515
 
 
516
void
 
517
NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMode mode)
 
518
{
 
519
  m_impl.m_single_user_mode = (Uint8)mode;
 
520
}
 
521
 
 
522
int
 
523
NdbDictionary::Table::setTablespaceNames(const void *data, Uint32 len)
 
524
{
 
525
  return m_impl.setTablespaceNames(data, len);
 
526
}
 
527
 
 
528
const void*
 
529
NdbDictionary::Table::getTablespaceNames()
 
530
{
 
531
  return m_impl.getTablespaceNames();
 
532
}
 
533
 
 
534
Uint32
 
535
NdbDictionary::Table::getTablespaceNamesLen() const
 
536
{
 
537
  return m_impl.getTablespaceNamesLen();
 
538
}
 
539
 
 
540
void
 
541
NdbDictionary::Table::setLinearFlag(Uint32 flag)
 
542
{
 
543
  m_impl.m_linear_flag = flag;
 
544
}
 
545
 
 
546
bool
 
547
NdbDictionary::Table::getLinearFlag() const
 
548
{
 
549
  return m_impl.m_linear_flag;
 
550
}
 
551
 
 
552
void
 
553
NdbDictionary::Table::setFragmentCount(Uint32 count)
 
554
{
 
555
  m_impl.setFragmentCount(count);
 
556
}
 
557
 
 
558
Uint32
 
559
NdbDictionary::Table::getFragmentCount() const
 
560
{
 
561
  return m_impl.getFragmentCount();
 
562
}
 
563
 
 
564
int
 
565
NdbDictionary::Table::setFrm(const void* data, Uint32 len){
 
566
  return m_impl.setFrm(data, len);
 
567
}
 
568
 
 
569
const void* 
 
570
NdbDictionary::Table::getFragmentData() const {
 
571
  return m_impl.getFragmentData();
 
572
}
 
573
 
 
574
Uint32
 
575
NdbDictionary::Table::getFragmentDataLen() const {
 
576
  return m_impl.getFragmentDataLen();
 
577
}
 
578
 
 
579
int
 
580
NdbDictionary::Table::setFragmentData(const void* data, Uint32 len)
 
581
{
 
582
  return m_impl.setFragmentData(data, len);
 
583
}
 
584
 
 
585
const void* 
 
586
NdbDictionary::Table::getTablespaceData() const {
 
587
  return m_impl.getTablespaceData();
 
588
}
 
589
 
 
590
Uint32
 
591
NdbDictionary::Table::getTablespaceDataLen() const {
 
592
  return m_impl.getTablespaceDataLen();
 
593
}
 
594
 
 
595
int
 
596
NdbDictionary::Table::setTablespaceData(const void* data, Uint32 len)
 
597
{
 
598
  return m_impl.setTablespaceData(data, len);
 
599
}
 
600
 
 
601
const void* 
 
602
NdbDictionary::Table::getRangeListData() const {
 
603
  return m_impl.getRangeListData();
 
604
}
 
605
 
 
606
Uint32
 
607
NdbDictionary::Table::getRangeListDataLen() const {
 
608
  return m_impl.getRangeListDataLen();
 
609
}
 
610
 
 
611
int
 
612
NdbDictionary::Table::setRangeListData(const void* data, Uint32 len)
 
613
{
 
614
  return m_impl.setRangeListData(data, len);
 
615
}
 
616
 
 
617
NdbDictionary::Object::Status
 
618
NdbDictionary::Table::getObjectStatus() const {
 
619
  return m_impl.m_status;
 
620
}
 
621
 
 
622
void
 
623
NdbDictionary::Table::setStatusInvalid() const {
 
624
  m_impl.m_status = NdbDictionary::Object::Invalid;
 
625
}
 
626
 
 
627
int 
 
628
NdbDictionary::Table::getObjectVersion() const {
 
629
  return m_impl.m_version;
 
630
}
 
631
 
 
632
int 
 
633
NdbDictionary::Table::getObjectId() const {
 
634
  return m_impl.m_id;
 
635
}
 
636
 
 
637
bool
 
638
NdbDictionary::Table::equal(const NdbDictionary::Table & col) const {
 
639
  return m_impl.equal(col.m_impl);
 
640
}
 
641
 
 
642
int
 
643
NdbDictionary::Table::getRowSizeInBytes() const {  
 
644
  int sz = 0;
 
645
  for(int i = 0; i<getNoOfColumns(); i++){
 
646
    const NdbDictionary::Column * c = getColumn(i);
 
647
    sz += (c->getSizeInBytes()+ 3) / 4;
 
648
  }
 
649
  return sz * 4;
 
650
}
 
651
 
 
652
int
 
653
NdbDictionary::Table::getReplicaCount() const {  
 
654
  return m_impl.m_replicaCount;
 
655
}
 
656
 
 
657
bool
 
658
NdbDictionary::Table::getTemporary() {
 
659
  return m_impl.m_temporary;
 
660
}
 
661
 
 
662
void
 
663
NdbDictionary::Table::setTemporary(bool val) {
 
664
  m_impl.m_temporary = val;
 
665
}
 
666
 
 
667
int
 
668
NdbDictionary::Table::createTableInDb(Ndb* pNdb, bool equalOk) const {  
 
669
  const NdbDictionary::Table * pTab = 
 
670
    pNdb->getDictionary()->getTable(getName());
 
671
  if(pTab != 0 && equal(* pTab))
 
672
    return 0;
 
673
  if(pTab != 0 && !equal(* pTab))
 
674
    return -1;
 
675
  return pNdb->getDictionary()->createTable(* this);
 
676
}
 
677
 
 
678
bool
 
679
NdbDictionary::Table::getTablespace(Uint32 *id, Uint32 *version) const 
 
680
{
 
681
  if (m_impl.m_tablespace_id == RNIL)
 
682
    return false;
 
683
  if (id)
 
684
    *id= m_impl.m_tablespace_id;
 
685
  if (version)
 
686
    *version= m_impl.m_version;
 
687
  return true;
 
688
}
 
689
 
 
690
const char *
 
691
NdbDictionary::Table::getTablespaceName() const 
 
692
{
 
693
  return m_impl.m_tablespace_name.c_str();
 
694
}
 
695
 
 
696
int
 
697
NdbDictionary::Table::setTablespaceName(const char * name){
 
698
  m_impl.m_tablespace_id = ~0;
 
699
  m_impl.m_tablespace_version = ~0;
 
700
  return !m_impl.m_tablespace_name.assign(name);
 
701
}
 
702
 
 
703
int
 
704
NdbDictionary::Table::setTablespace(const NdbDictionary::Tablespace & ts){
 
705
  m_impl.m_tablespace_id = NdbTablespaceImpl::getImpl(ts).m_id;
 
706
  m_impl.m_tablespace_version = ts.getObjectVersion();
 
707
  return !m_impl.m_tablespace_name.assign(ts.getName());
 
708
}
 
709
 
 
710
void
 
711
NdbDictionary::Table::setRowChecksumIndicator(bool val){
 
712
  m_impl.m_row_checksum = val;
 
713
}
 
714
 
 
715
bool 
 
716
NdbDictionary::Table::getRowChecksumIndicator() const {
 
717
  return m_impl.m_row_checksum;
 
718
}
 
719
 
 
720
void
 
721
NdbDictionary::Table::setRowGCIIndicator(bool val){
 
722
  m_impl.m_row_gci = val;
 
723
}
 
724
 
 
725
bool 
 
726
NdbDictionary::Table::getRowGCIIndicator() const {
 
727
  return m_impl.m_row_gci;
 
728
}
 
729
 
 
730
void
 
731
NdbDictionary::Table::setForceVarPart(bool val){
 
732
  m_impl.m_force_var_part = val;
 
733
}
 
734
 
 
735
bool 
 
736
NdbDictionary::Table::getForceVarPart() const {
 
737
  return m_impl.m_force_var_part;
 
738
}
 
739
 
 
740
int
 
741
NdbDictionary::Table::aggregate(NdbError& error)
 
742
{
 
743
  return m_impl.aggregate(error);
 
744
}
 
745
 
 
746
int
 
747
NdbDictionary::Table::validate(NdbError& error)
 
748
{
 
749
  return m_impl.validate(error);
 
750
}
 
751
 
 
752
 
 
753
/*****************************************************************
 
754
 * Index facade
 
755
 */
 
756
 
 
757
NdbDictionary::Index::Index(const char * name)
 
758
  : m_impl(* new NdbIndexImpl(* this))
 
759
{
 
760
  setName(name);
 
761
}
 
762
 
 
763
NdbDictionary::Index::Index(NdbIndexImpl & impl)
 
764
  : m_impl(impl) 
 
765
{
 
766
}
 
767
 
 
768
NdbDictionary::Index::~Index(){
 
769
  NdbIndexImpl * tmp = &m_impl;  
 
770
  if(this != tmp){
 
771
    delete tmp;
 
772
  }
 
773
}
 
774
 
 
775
int
 
776
NdbDictionary::Index::setName(const char * name){
 
777
  return m_impl.setName(name);
 
778
}
 
779
 
 
780
const char * 
 
781
NdbDictionary::Index::getName() const {
 
782
  return m_impl.getName();
 
783
}
 
784
 
 
785
int
 
786
NdbDictionary::Index::setTable(const char * table){
 
787
  return m_impl.setTable(table);
 
788
}
 
789
 
 
790
const char * 
 
791
NdbDictionary::Index::getTable() const {
 
792
  return m_impl.getTable();
 
793
}
 
794
 
 
795
unsigned
 
796
NdbDictionary::Index::getNoOfColumns() const {
 
797
  return m_impl.m_columns.size();
 
798
}
 
799
 
 
800
int
 
801
NdbDictionary::Index::getNoOfIndexColumns() const {
 
802
  return m_impl.m_columns.size();
 
803
}
 
804
 
 
805
const NdbDictionary::Column *
 
806
NdbDictionary::Index::getColumn(unsigned no) const {
 
807
  if(no < m_impl.m_columns.size())
 
808
    return m_impl.m_columns[no];
 
809
  return NULL;
 
810
}
 
811
 
 
812
const char *
 
813
NdbDictionary::Index::getIndexColumn(int no) const {
 
814
  const NdbDictionary::Column* col = getColumn(no);
 
815
 
 
816
  if (col)
 
817
    return col->getName();
 
818
  else
 
819
    return NULL;
 
820
}
 
821
 
 
822
int
 
823
NdbDictionary::Index::addColumn(const Column & c){
 
824
  NdbColumnImpl* col = new NdbColumnImpl;
 
825
  if (col == NULL)
 
826
  {
 
827
    errno = ENOMEM;
 
828
    return -1;
 
829
  }
 
830
  (* col) = NdbColumnImpl::getImpl(c);
 
831
  if (m_impl.m_columns.push_back(col))
 
832
  {
 
833
    return -1;
 
834
  }
 
835
  return 0;
 
836
}
 
837
 
 
838
int
 
839
NdbDictionary::Index::addColumnName(const char * name){
 
840
  const Column c(name);
 
841
  return addColumn(c);
 
842
}
 
843
 
 
844
int
 
845
NdbDictionary::Index::addIndexColumn(const char * name){
 
846
  const Column c(name);
 
847
  return addColumn(c);
 
848
}
 
849
 
 
850
int
 
851
NdbDictionary::Index::addColumnNames(unsigned noOfNames, const char ** names){
 
852
  for(unsigned i = 0; i < noOfNames; i++) {
 
853
    const Column c(names[i]);
 
854
    if (addColumn(c))
 
855
    {
 
856
      return -1;
 
857
    }
 
858
  }
 
859
  return 0;
 
860
}
 
861
 
 
862
int
 
863
NdbDictionary::Index::addIndexColumns(int noOfNames, const char ** names){
 
864
  for(int i = 0; i < noOfNames; i++) {
 
865
    const Column c(names[i]);
 
866
    if (addColumn(c))
 
867
    {
 
868
      return -1;
 
869
    }
 
870
  }
 
871
  return 0;
 
872
}
 
873
 
 
874
void
 
875
NdbDictionary::Index::setType(NdbDictionary::Index::Type t){
 
876
  m_impl.m_type = (NdbDictionary::Object::Type)t;
 
877
}
 
878
 
 
879
NdbDictionary::Index::Type
 
880
NdbDictionary::Index::getType() const {
 
881
  return (NdbDictionary::Index::Type)m_impl.m_type;
 
882
}
 
883
 
 
884
void
 
885
NdbDictionary::Index::setLogging(bool val){
 
886
  m_impl.m_logging = val;
 
887
}
 
888
 
 
889
bool
 
890
NdbDictionary::Index::getTemporary(){
 
891
  return m_impl.m_temporary;
 
892
}
 
893
 
 
894
void
 
895
NdbDictionary::Index::setTemporary(bool val){
 
896
  m_impl.m_temporary = val;
 
897
}
 
898
 
 
899
bool 
 
900
NdbDictionary::Index::getLogging() const {
 
901
  return m_impl.m_logging;
 
902
}
 
903
 
 
904
NdbDictionary::Object::Status
 
905
NdbDictionary::Index::getObjectStatus() const {
 
906
  return m_impl.m_table->m_status;
 
907
}
 
908
 
 
909
int 
 
910
NdbDictionary::Index::getObjectVersion() const {
 
911
  return m_impl.m_table->m_version;
 
912
}
 
913
 
 
914
int 
 
915
NdbDictionary::Index::getObjectId() const {
 
916
  return m_impl.m_table->m_id;
 
917
}
 
918
 
 
919
 
 
920
/*****************************************************************
 
921
 * Event facade
 
922
 */
 
923
NdbDictionary::Event::Event(const char * name)
 
924
  : m_impl(* new NdbEventImpl(* this))
 
925
{
 
926
  setName(name);
 
927
}
 
928
 
 
929
NdbDictionary::Event::Event(const char * name, const Table& table)
 
930
  : m_impl(* new NdbEventImpl(* this))
 
931
{
 
932
  setName(name);
 
933
  setTable(table);
 
934
}
 
935
 
 
936
NdbDictionary::Event::Event(NdbEventImpl & impl)
 
937
  : m_impl(impl) 
 
938
{
 
939
}
 
940
 
 
941
NdbDictionary::Event::~Event()
 
942
{
 
943
  NdbEventImpl * tmp = &m_impl;
 
944
  if(this != tmp){
 
945
    delete tmp;
 
946
  }
 
947
}
 
948
 
 
949
int
 
950
NdbDictionary::Event::setName(const char * name)
 
951
{
 
952
  return m_impl.setName(name);
 
953
}
 
954
 
 
955
const char *
 
956
NdbDictionary::Event::getName() const
 
957
{
 
958
  return m_impl.getName();
 
959
}
 
960
 
 
961
void 
 
962
NdbDictionary::Event::setTable(const Table& table)
 
963
{
 
964
  m_impl.setTable(table);
 
965
}
 
966
 
 
967
const NdbDictionary::Table *
 
968
NdbDictionary::Event::getTable() const
 
969
{
 
970
  return m_impl.getTable();
 
971
}
 
972
 
 
973
int
 
974
NdbDictionary::Event::setTable(const char * table)
 
975
{
 
976
  return m_impl.setTable(table);
 
977
}
 
978
 
 
979
const char*
 
980
NdbDictionary::Event::getTableName() const
 
981
{
 
982
  return m_impl.getTableName();
 
983
}
 
984
 
 
985
void
 
986
NdbDictionary::Event::addTableEvent(const TableEvent t)
 
987
{
 
988
  m_impl.addTableEvent(t);
 
989
}
 
990
 
 
991
bool
 
992
NdbDictionary::Event::getTableEvent(const TableEvent t) const
 
993
{
 
994
  return m_impl.getTableEvent(t);
 
995
}
 
996
 
 
997
void
 
998
NdbDictionary::Event::setDurability(EventDurability d)
 
999
{
 
1000
  m_impl.setDurability(d);
 
1001
}
 
1002
 
 
1003
NdbDictionary::Event::EventDurability
 
1004
NdbDictionary::Event::getDurability() const
 
1005
{
 
1006
  return m_impl.getDurability();
 
1007
}
 
1008
 
 
1009
void
 
1010
NdbDictionary::Event::setReport(EventReport r)
 
1011
{
 
1012
  m_impl.setReport(r);
 
1013
}
 
1014
 
 
1015
NdbDictionary::Event::EventReport
 
1016
NdbDictionary::Event::getReport() const
 
1017
{
 
1018
  return m_impl.getReport();
 
1019
}
 
1020
 
 
1021
void
 
1022
NdbDictionary::Event::addColumn(const Column & c){
 
1023
  NdbColumnImpl* col = new NdbColumnImpl;
 
1024
  (* col) = NdbColumnImpl::getImpl(c);
 
1025
  m_impl.m_columns.push_back(col);
 
1026
}
 
1027
 
 
1028
void
 
1029
NdbDictionary::Event::addEventColumn(unsigned attrId)
 
1030
{
 
1031
  m_impl.m_attrIds.push_back(attrId);
 
1032
}
 
1033
 
 
1034
void
 
1035
NdbDictionary::Event::addEventColumn(const char * name)
 
1036
{
 
1037
  const Column c(name);
 
1038
  addColumn(c);
 
1039
}
 
1040
 
 
1041
void
 
1042
NdbDictionary::Event::addEventColumns(int n, const char ** names)
 
1043
{
 
1044
  for (int i = 0; i < n; i++)
 
1045
    addEventColumn(names[i]);
 
1046
}
 
1047
 
 
1048
int NdbDictionary::Event::getNoOfEventColumns() const
 
1049
{
 
1050
  return m_impl.getNoOfEventColumns();
 
1051
}
 
1052
 
 
1053
const NdbDictionary::Column *
 
1054
NdbDictionary::Event::getEventColumn(unsigned no) const
 
1055
{
 
1056
  return m_impl.getEventColumn(no);
 
1057
}
 
1058
 
 
1059
void NdbDictionary::Event::mergeEvents(bool flag)
 
1060
{
 
1061
  m_impl.m_mergeEvents = flag;
 
1062
}
 
1063
 
 
1064
NdbDictionary::Object::Status
 
1065
NdbDictionary::Event::getObjectStatus() const
 
1066
{
 
1067
  return m_impl.m_status;
 
1068
}
 
1069
 
 
1070
int 
 
1071
NdbDictionary::Event::getObjectVersion() const
 
1072
{
 
1073
  return m_impl.m_version;
 
1074
}
 
1075
 
 
1076
int 
 
1077
NdbDictionary::Event::getObjectId() const {
 
1078
  return m_impl.m_id;
 
1079
}
 
1080
 
 
1081
void NdbDictionary::Event::print()
 
1082
{
 
1083
  m_impl.print();
 
1084
}
 
1085
 
 
1086
/*****************************************************************
 
1087
 * Tablespace facade
 
1088
 */
 
1089
NdbDictionary::Tablespace::Tablespace()
 
1090
  : m_impl(* new NdbTablespaceImpl(* this))
 
1091
{
 
1092
}
 
1093
 
 
1094
NdbDictionary::Tablespace::Tablespace(NdbTablespaceImpl & impl)
 
1095
  : m_impl(impl) 
 
1096
{
 
1097
}
 
1098
 
 
1099
NdbDictionary::Tablespace::Tablespace(const NdbDictionary::Tablespace & org)
 
1100
  : Object(org), m_impl(* new NdbTablespaceImpl(* this))
 
1101
{
 
1102
  m_impl.assign(org.m_impl);
 
1103
}
 
1104
 
 
1105
NdbDictionary::Tablespace::~Tablespace(){
 
1106
  NdbTablespaceImpl * tmp = &m_impl;  
 
1107
  if(this != tmp){
 
1108
    delete tmp;
 
1109
  }
 
1110
}
 
1111
 
 
1112
void 
 
1113
NdbDictionary::Tablespace::setName(const char * name){
 
1114
  m_impl.m_name.assign(name);
 
1115
}
 
1116
 
 
1117
const char * 
 
1118
NdbDictionary::Tablespace::getName() const {
 
1119
  return m_impl.m_name.c_str();
 
1120
}
 
1121
 
 
1122
void
 
1123
NdbDictionary::Tablespace::setAutoGrowSpecification
 
1124
(const NdbDictionary::AutoGrowSpecification& spec){
 
1125
  m_impl.m_grow_spec = spec;
 
1126
}
 
1127
const NdbDictionary::AutoGrowSpecification& 
 
1128
NdbDictionary::Tablespace::getAutoGrowSpecification() const {
 
1129
  return m_impl.m_grow_spec;
 
1130
}
 
1131
 
 
1132
void
 
1133
NdbDictionary::Tablespace::setExtentSize(Uint32 sz){
 
1134
  m_impl.m_extent_size = sz;
 
1135
}
 
1136
 
 
1137
Uint32
 
1138
NdbDictionary::Tablespace::getExtentSize() const {
 
1139
  return m_impl.m_extent_size;
 
1140
}
 
1141
 
 
1142
void
 
1143
NdbDictionary::Tablespace::setDefaultLogfileGroup(const char * name){
 
1144
  m_impl.m_logfile_group_id = ~0;
 
1145
  m_impl.m_logfile_group_version = ~0;
 
1146
  m_impl.m_logfile_group_name.assign(name);
 
1147
}
 
1148
 
 
1149
void
 
1150
NdbDictionary::Tablespace::setDefaultLogfileGroup
 
1151
(const NdbDictionary::LogfileGroup & lg){
 
1152
  m_impl.m_logfile_group_id = NdbLogfileGroupImpl::getImpl(lg).m_id;
 
1153
  m_impl.m_logfile_group_version = lg.getObjectVersion();
 
1154
  m_impl.m_logfile_group_name.assign(lg.getName());
 
1155
}
 
1156
 
 
1157
const char * 
 
1158
NdbDictionary::Tablespace::getDefaultLogfileGroup() const {
 
1159
  return m_impl.m_logfile_group_name.c_str();
 
1160
}
 
1161
 
 
1162
Uint32
 
1163
NdbDictionary::Tablespace::getDefaultLogfileGroupId() const {
 
1164
  return m_impl.m_logfile_group_id;
 
1165
}
 
1166
 
 
1167
NdbDictionary::Object::Status
 
1168
NdbDictionary::Tablespace::getObjectStatus() const {
 
1169
  return m_impl.m_status;
 
1170
}
 
1171
 
 
1172
int 
 
1173
NdbDictionary::Tablespace::getObjectVersion() const {
 
1174
  return m_impl.m_version;
 
1175
}
 
1176
 
 
1177
int 
 
1178
NdbDictionary::Tablespace::getObjectId() const {
 
1179
  return m_impl.m_id;
 
1180
}
 
1181
 
 
1182
/*****************************************************************
 
1183
 * LogfileGroup facade
 
1184
 */
 
1185
NdbDictionary::LogfileGroup::LogfileGroup()
 
1186
  : m_impl(* new NdbLogfileGroupImpl(* this))
 
1187
{
 
1188
}
 
1189
 
 
1190
NdbDictionary::LogfileGroup::LogfileGroup(NdbLogfileGroupImpl & impl)
 
1191
  : m_impl(impl) 
 
1192
{
 
1193
}
 
1194
 
 
1195
NdbDictionary::LogfileGroup::LogfileGroup(const NdbDictionary::LogfileGroup & org)
 
1196
  : Object(org), m_impl(* new NdbLogfileGroupImpl(* this)) 
 
1197
{
 
1198
  m_impl.assign(org.m_impl);
 
1199
}
 
1200
 
 
1201
NdbDictionary::LogfileGroup::~LogfileGroup(){
 
1202
  NdbLogfileGroupImpl * tmp = &m_impl;  
 
1203
  if(this != tmp){
 
1204
    delete tmp;
 
1205
  }
 
1206
}
 
1207
 
 
1208
void 
 
1209
NdbDictionary::LogfileGroup::setName(const char * name){
 
1210
  m_impl.m_name.assign(name);
 
1211
}
 
1212
 
 
1213
const char * 
 
1214
NdbDictionary::LogfileGroup::getName() const {
 
1215
  return m_impl.m_name.c_str();
 
1216
}
 
1217
 
 
1218
void
 
1219
NdbDictionary::LogfileGroup::setUndoBufferSize(Uint32 sz){
 
1220
  m_impl.m_undo_buffer_size = sz;
 
1221
}
 
1222
 
 
1223
Uint32
 
1224
NdbDictionary::LogfileGroup::getUndoBufferSize() const {
 
1225
  return m_impl.m_undo_buffer_size;
 
1226
}
 
1227
 
 
1228
void
 
1229
NdbDictionary::LogfileGroup::setAutoGrowSpecification
 
1230
(const NdbDictionary::AutoGrowSpecification& spec){
 
1231
  m_impl.m_grow_spec = spec;
 
1232
}
 
1233
const NdbDictionary::AutoGrowSpecification& 
 
1234
NdbDictionary::LogfileGroup::getAutoGrowSpecification() const {
 
1235
  return m_impl.m_grow_spec;
 
1236
}
 
1237
 
 
1238
Uint64 NdbDictionary::LogfileGroup::getUndoFreeWords() const {
 
1239
  return m_impl.m_undo_free_words;
 
1240
}
 
1241
 
 
1242
NdbDictionary::Object::Status
 
1243
NdbDictionary::LogfileGroup::getObjectStatus() const {
 
1244
  return m_impl.m_status;
 
1245
}
 
1246
 
 
1247
int 
 
1248
NdbDictionary::LogfileGroup::getObjectVersion() const {
 
1249
  return m_impl.m_version;
 
1250
}
 
1251
 
 
1252
int 
 
1253
NdbDictionary::LogfileGroup::getObjectId() const {
 
1254
  return m_impl.m_id;
 
1255
}
 
1256
 
 
1257
/*****************************************************************
 
1258
 * Datafile facade
 
1259
 */
 
1260
NdbDictionary::Datafile::Datafile()
 
1261
  : m_impl(* new NdbDatafileImpl(* this))
 
1262
{
 
1263
}
 
1264
 
 
1265
NdbDictionary::Datafile::Datafile(NdbDatafileImpl & impl)
 
1266
  : m_impl(impl) 
 
1267
{
 
1268
}
 
1269
 
 
1270
NdbDictionary::Datafile::Datafile(const NdbDictionary::Datafile & org)
 
1271
  : Object(org), m_impl(* new NdbDatafileImpl(* this)) 
 
1272
{
 
1273
  m_impl.assign(org.m_impl);
 
1274
}
 
1275
 
 
1276
NdbDictionary::Datafile::~Datafile(){
 
1277
  NdbDatafileImpl * tmp = &m_impl;  
 
1278
  if(this != tmp){
 
1279
    delete tmp;
 
1280
  }
 
1281
}
 
1282
 
 
1283
void 
 
1284
NdbDictionary::Datafile::setPath(const char * path){
 
1285
  m_impl.m_path.assign(path);
 
1286
}
 
1287
 
 
1288
const char * 
 
1289
NdbDictionary::Datafile::getPath() const {
 
1290
  return m_impl.m_path.c_str();
 
1291
}
 
1292
 
 
1293
void 
 
1294
NdbDictionary::Datafile::setSize(Uint64 sz){
 
1295
  m_impl.m_size = sz;
 
1296
}
 
1297
 
 
1298
Uint64
 
1299
NdbDictionary::Datafile::getSize() const {
 
1300
  return m_impl.m_size;
 
1301
}
 
1302
 
 
1303
Uint64
 
1304
NdbDictionary::Datafile::getFree() const {
 
1305
  return m_impl.m_free;
 
1306
}
 
1307
 
 
1308
int
 
1309
NdbDictionary::Datafile::setTablespace(const char * tablespace){
 
1310
  m_impl.m_filegroup_id = ~0;
 
1311
  m_impl.m_filegroup_version = ~0;
 
1312
  return !m_impl.m_filegroup_name.assign(tablespace);
 
1313
}
 
1314
 
 
1315
int
 
1316
NdbDictionary::Datafile::setTablespace(const NdbDictionary::Tablespace & ts){
 
1317
  m_impl.m_filegroup_id = NdbTablespaceImpl::getImpl(ts).m_id;
 
1318
  m_impl.m_filegroup_version = ts.getObjectVersion();
 
1319
  return !m_impl.m_filegroup_name.assign(ts.getName());
 
1320
}
 
1321
 
 
1322
const char *
 
1323
NdbDictionary::Datafile::getTablespace() const {
 
1324
  return m_impl.m_filegroup_name.c_str();
 
1325
}
 
1326
 
 
1327
void
 
1328
NdbDictionary::Datafile::getTablespaceId(NdbDictionary::ObjectId* dst) const 
 
1329
{
 
1330
  if (dst)
 
1331
  {
 
1332
    NdbDictObjectImpl::getImpl(* dst).m_id = m_impl.m_filegroup_id;
 
1333
    NdbDictObjectImpl::getImpl(* dst).m_version = m_impl.m_filegroup_version;
 
1334
  }
 
1335
}
 
1336
 
 
1337
NdbDictionary::Object::Status
 
1338
NdbDictionary::Datafile::getObjectStatus() const {
 
1339
  return m_impl.m_status;
 
1340
}
 
1341
 
 
1342
int 
 
1343
NdbDictionary::Datafile::getObjectVersion() const {
 
1344
  return m_impl.m_version;
 
1345
}
 
1346
 
 
1347
int 
 
1348
NdbDictionary::Datafile::getObjectId() const {
 
1349
  return m_impl.m_id;
 
1350
}
 
1351
 
 
1352
/*****************************************************************
 
1353
 * Undofile facade
 
1354
 */
 
1355
NdbDictionary::Undofile::Undofile()
 
1356
  : m_impl(* new NdbUndofileImpl(* this))
 
1357
{
 
1358
}
 
1359
 
 
1360
NdbDictionary::Undofile::Undofile(NdbUndofileImpl & impl)
 
1361
  : m_impl(impl) 
 
1362
{
 
1363
}
 
1364
 
 
1365
NdbDictionary::Undofile::Undofile(const NdbDictionary::Undofile & org)
 
1366
  : Object(org), m_impl(* new NdbUndofileImpl(* this))
 
1367
{
 
1368
  m_impl.assign(org.m_impl);
 
1369
}
 
1370
 
 
1371
NdbDictionary::Undofile::~Undofile(){
 
1372
  NdbUndofileImpl * tmp = &m_impl;  
 
1373
  if(this != tmp){
 
1374
    delete tmp;
 
1375
  }
 
1376
}
 
1377
 
 
1378
void 
 
1379
NdbDictionary::Undofile::setPath(const char * path){
 
1380
  m_impl.m_path.assign(path);
 
1381
}
 
1382
 
 
1383
const char * 
 
1384
NdbDictionary::Undofile::getPath() const {
 
1385
  return m_impl.m_path.c_str();
 
1386
}
 
1387
 
 
1388
void 
 
1389
NdbDictionary::Undofile::setSize(Uint64 sz){
 
1390
  m_impl.m_size = sz;
 
1391
}
 
1392
 
 
1393
Uint64
 
1394
NdbDictionary::Undofile::getSize() const {
 
1395
  return m_impl.m_size;
 
1396
}
 
1397
 
 
1398
void 
 
1399
NdbDictionary::Undofile::setLogfileGroup(const char * logfileGroup){
 
1400
  m_impl.m_filegroup_id = ~0;
 
1401
  m_impl.m_filegroup_version = ~0;
 
1402
  m_impl.m_filegroup_name.assign(logfileGroup);
 
1403
}
 
1404
 
 
1405
void 
 
1406
NdbDictionary::Undofile::setLogfileGroup
 
1407
(const NdbDictionary::LogfileGroup & ts){
 
1408
  m_impl.m_filegroup_id = NdbLogfileGroupImpl::getImpl(ts).m_id;
 
1409
  m_impl.m_filegroup_version = ts.getObjectVersion();
 
1410
  m_impl.m_filegroup_name.assign(ts.getName());
 
1411
}
 
1412
 
 
1413
const char *
 
1414
NdbDictionary::Undofile::getLogfileGroup() const {
 
1415
  return m_impl.m_filegroup_name.c_str();
 
1416
}
 
1417
 
 
1418
void
 
1419
NdbDictionary::Undofile::getLogfileGroupId(NdbDictionary::ObjectId * dst)const 
 
1420
{
 
1421
  if (dst)
 
1422
  {
 
1423
    NdbDictObjectImpl::getImpl(* dst).m_id = m_impl.m_filegroup_id;
 
1424
    NdbDictObjectImpl::getImpl(* dst).m_version = m_impl.m_filegroup_version;
 
1425
  }
 
1426
}
 
1427
 
 
1428
NdbDictionary::Object::Status
 
1429
NdbDictionary::Undofile::getObjectStatus() const {
 
1430
  return m_impl.m_status;
 
1431
}
 
1432
 
 
1433
int 
 
1434
NdbDictionary::Undofile::getObjectVersion() const {
 
1435
  return m_impl.m_version;
 
1436
}
 
1437
 
 
1438
int 
 
1439
NdbDictionary::Undofile::getObjectId() const {
 
1440
  return m_impl.m_id;
 
1441
}
 
1442
 
 
1443
/*****************************************************************
 
1444
 * Dictionary facade
 
1445
 */
 
1446
NdbDictionary::Dictionary::Dictionary(Ndb & ndb)
 
1447
  : m_impl(* new NdbDictionaryImpl(ndb, *this))
 
1448
{
 
1449
}
 
1450
 
 
1451
NdbDictionary::Dictionary::Dictionary(NdbDictionaryImpl & impl)
 
1452
  : m_impl(impl) 
 
1453
{
 
1454
}
 
1455
NdbDictionary::Dictionary::~Dictionary(){
 
1456
  NdbDictionaryImpl * tmp = &m_impl;  
 
1457
  if(this != tmp){
 
1458
    delete tmp;
 
1459
  }
 
1460
}
 
1461
 
 
1462
int 
 
1463
NdbDictionary::Dictionary::createTable(const Table & t)
 
1464
{
 
1465
  DBUG_ENTER("NdbDictionary::Dictionary::createTable");
 
1466
  DBUG_RETURN(m_impl.createTable(NdbTableImpl::getImpl(t)));
 
1467
}
 
1468
 
 
1469
int
 
1470
NdbDictionary::Dictionary::dropTable(Table & t){
 
1471
  return m_impl.dropTable(NdbTableImpl::getImpl(t));
 
1472
}
 
1473
 
 
1474
int
 
1475
NdbDictionary::Dictionary::dropTableGlobal(const Table & t){
 
1476
  return m_impl.dropTableGlobal(NdbTableImpl::getImpl(t));
 
1477
}
 
1478
 
 
1479
int
 
1480
NdbDictionary::Dictionary::dropTable(const char * name){
 
1481
  return m_impl.dropTable(name);
 
1482
}
 
1483
 
 
1484
int
 
1485
NdbDictionary::Dictionary::alterTable(const Table & t){
 
1486
  return m_impl.alterTable(NdbTableImpl::getImpl(t));
 
1487
}
 
1488
 
 
1489
int
 
1490
NdbDictionary::Dictionary::alterTableGlobal(const Table & f,
 
1491
                                            const Table & t)
 
1492
{
 
1493
  return m_impl.alterTableGlobal(NdbTableImpl::getImpl(f),
 
1494
                                 NdbTableImpl::getImpl(t));
 
1495
}
 
1496
 
 
1497
const NdbDictionary::Table * 
 
1498
NdbDictionary::Dictionary::getTable(const char * name, void **data) const
 
1499
{
 
1500
  NdbTableImpl * t = m_impl.getTable(name, data);
 
1501
  if(t)
 
1502
    return t->m_facade;
 
1503
  return 0;
 
1504
}
 
1505
 
 
1506
const NdbDictionary::Index * 
 
1507
NdbDictionary::Dictionary::getIndexGlobal(const char * indexName,
 
1508
                                          const Table &ndbtab) const
 
1509
{
 
1510
  NdbIndexImpl * i = m_impl.getIndexGlobal(indexName,
 
1511
                                           NdbTableImpl::getImpl(ndbtab));
 
1512
  if(i)
 
1513
    return i->m_facade;
 
1514
  return 0;
 
1515
}
 
1516
 
 
1517
const NdbDictionary::Table * 
 
1518
NdbDictionary::Dictionary::getTableGlobal(const char * name) const
 
1519
{
 
1520
  NdbTableImpl * t = m_impl.getTableGlobal(name);
 
1521
  if(t)
 
1522
    return t->m_facade;
 
1523
  return 0;
 
1524
}
 
1525
 
 
1526
int
 
1527
NdbDictionary::Dictionary::removeIndexGlobal(const Index &ndbidx,
 
1528
                                             int invalidate) const
 
1529
{
 
1530
  return m_impl.releaseIndexGlobal(NdbIndexImpl::getImpl(ndbidx), invalidate);
 
1531
}
 
1532
 
 
1533
int
 
1534
NdbDictionary::Dictionary::removeTableGlobal(const Table &ndbtab,
 
1535
                                             int invalidate) const
 
1536
{
 
1537
  return m_impl.releaseTableGlobal(NdbTableImpl::getImpl(ndbtab), invalidate);
 
1538
}
 
1539
 
 
1540
void NdbDictionary::Dictionary::putTable(const NdbDictionary::Table * table)
 
1541
{
 
1542
 NdbDictionary::Table  *copy_table = new NdbDictionary::Table;
 
1543
  *copy_table = *table;
 
1544
  m_impl.putTable(&NdbTableImpl::getImpl(*copy_table));
 
1545
}
 
1546
 
 
1547
void NdbDictionary::Dictionary::set_local_table_data_size(unsigned sz)
 
1548
{
 
1549
  m_impl.m_local_table_data_size= sz;
 
1550
}
 
1551
 
 
1552
const NdbDictionary::Table * 
 
1553
NdbDictionary::Dictionary::getTable(const char * name) const
 
1554
{
 
1555
  return getTable(name, 0);
 
1556
}
 
1557
 
 
1558
const NdbDictionary::Table *
 
1559
NdbDictionary::Dictionary::getBlobTable(const NdbDictionary::Table* table,
 
1560
                                        const char* col_name)
 
1561
{
 
1562
  const NdbDictionary::Column* col = table->getColumn(col_name);
 
1563
  if (col == NULL) {
 
1564
    m_impl.m_error.code = 4318;
 
1565
    return NULL;
 
1566
  }
 
1567
  return getBlobTable(table, col->getColumnNo());
 
1568
}
 
1569
 
 
1570
const NdbDictionary::Table *
 
1571
NdbDictionary::Dictionary::getBlobTable(const NdbDictionary::Table* table,
 
1572
                                        Uint32 col_no)
 
1573
{
 
1574
  return m_impl.getBlobTable(NdbTableImpl::getImpl(*table), col_no);
 
1575
}
 
1576
 
 
1577
void
 
1578
NdbDictionary::Dictionary::invalidateTable(const char * name){
 
1579
  DBUG_ENTER("NdbDictionaryImpl::invalidateTable");
 
1580
  NdbTableImpl * t = m_impl.getTable(name);
 
1581
  if(t)
 
1582
    m_impl.invalidateObject(* t);
 
1583
  DBUG_VOID_RETURN;
 
1584
}
 
1585
 
 
1586
void
 
1587
NdbDictionary::Dictionary::invalidateTable(const Table *table){
 
1588
  NdbTableImpl &t = NdbTableImpl::getImpl(*table);
 
1589
  m_impl.invalidateObject(t);
 
1590
}
 
1591
 
 
1592
void
 
1593
NdbDictionary::Dictionary::removeCachedTable(const char * name){
 
1594
  NdbTableImpl * t = m_impl.getTable(name);
 
1595
  if(t)
 
1596
    m_impl.removeCachedObject(* t);
 
1597
}
 
1598
 
 
1599
void
 
1600
NdbDictionary::Dictionary::removeCachedTable(const Table *table){
 
1601
  NdbTableImpl &t = NdbTableImpl::getImpl(*table);
 
1602
  m_impl.removeCachedObject(t);
 
1603
}
 
1604
 
 
1605
int
 
1606
NdbDictionary::Dictionary::createIndex(const Index & ind)
 
1607
{
 
1608
  return m_impl.createIndex(NdbIndexImpl::getImpl(ind));
 
1609
}
 
1610
 
 
1611
int
 
1612
NdbDictionary::Dictionary::createIndex(const Index & ind, const Table & tab)
 
1613
{
 
1614
  return m_impl.createIndex(NdbIndexImpl::getImpl(ind),
 
1615
                            NdbTableImpl::getImpl(tab));
 
1616
}
 
1617
 
 
1618
int 
 
1619
NdbDictionary::Dictionary::dropIndex(const char * indexName,
 
1620
                                     const char * tableName)
 
1621
{
 
1622
  return m_impl.dropIndex(indexName, tableName);
 
1623
}
 
1624
 
 
1625
int 
 
1626
NdbDictionary::Dictionary::dropIndexGlobal(const Index &ind)
 
1627
{
 
1628
  return m_impl.dropIndexGlobal(NdbIndexImpl::getImpl(ind));
 
1629
}
 
1630
 
 
1631
const NdbDictionary::Index * 
 
1632
NdbDictionary::Dictionary::getIndex(const char * indexName,
 
1633
                                    const char * tableName) const
 
1634
{
 
1635
  NdbIndexImpl * i = m_impl.getIndex(indexName, tableName);
 
1636
  if(i)
 
1637
    return i->m_facade;
 
1638
  return 0;
 
1639
}
 
1640
 
 
1641
void
 
1642
NdbDictionary::Dictionary::invalidateIndex(const Index *index){
 
1643
  DBUG_ENTER("NdbDictionary::Dictionary::invalidateIndex");
 
1644
  NdbIndexImpl &i = NdbIndexImpl::getImpl(*index);
 
1645
  assert(i.m_table != 0);
 
1646
  m_impl.invalidateObject(* i.m_table);
 
1647
  DBUG_VOID_RETURN;
 
1648
}
 
1649
 
 
1650
void
 
1651
NdbDictionary::Dictionary::invalidateIndex(const char * indexName,
 
1652
                                           const char * tableName){
 
1653
  DBUG_ENTER("NdbDictionaryImpl::invalidateIndex");
 
1654
  NdbIndexImpl * i = m_impl.getIndex(indexName, tableName);
 
1655
  if(i) {
 
1656
    assert(i->m_table != 0);
 
1657
    m_impl.invalidateObject(* i->m_table);
 
1658
  }
 
1659
  DBUG_VOID_RETURN;
 
1660
}
 
1661
 
 
1662
int
 
1663
NdbDictionary::Dictionary::forceGCPWait()
 
1664
{
 
1665
  return m_impl.forceGCPWait();
 
1666
}
 
1667
 
 
1668
void
 
1669
NdbDictionary::Dictionary::removeCachedIndex(const Index *index){
 
1670
  DBUG_ENTER("NdbDictionary::Dictionary::removeCachedIndex");
 
1671
  NdbIndexImpl &i = NdbIndexImpl::getImpl(*index);
 
1672
  assert(i.m_table != 0);
 
1673
  m_impl.removeCachedObject(* i.m_table);
 
1674
  DBUG_VOID_RETURN;
 
1675
}
 
1676
 
 
1677
void
 
1678
NdbDictionary::Dictionary::removeCachedIndex(const char * indexName,
 
1679
                                             const char * tableName){
 
1680
  NdbIndexImpl * i = m_impl.getIndex(indexName, tableName);
 
1681
  if(i) {
 
1682
    assert(i->m_table != 0);
 
1683
    m_impl.removeCachedObject(* i->m_table);
 
1684
  }
 
1685
}
 
1686
 
 
1687
const NdbDictionary::Table *
 
1688
NdbDictionary::Dictionary::getIndexTable(const char * indexName, 
 
1689
                                         const char * tableName) const
 
1690
{
 
1691
  NdbIndexImpl * i = m_impl.getIndex(indexName, tableName);
 
1692
  NdbTableImpl * t = m_impl.getTable(tableName);
 
1693
  if(i && t) {
 
1694
    NdbTableImpl * it = m_impl.getIndexTable(i, t);
 
1695
    return it->m_facade;
 
1696
  }
 
1697
  return 0;
 
1698
}
 
1699
 
 
1700
 
 
1701
int
 
1702
NdbDictionary::Dictionary::createEvent(const Event & ev)
 
1703
{
 
1704
  return m_impl.createEvent(NdbEventImpl::getImpl(ev));
 
1705
}
 
1706
 
 
1707
int 
 
1708
NdbDictionary::Dictionary::dropEvent(const char * eventName)
 
1709
{
 
1710
  return m_impl.dropEvent(eventName);
 
1711
}
 
1712
 
 
1713
const NdbDictionary::Event *
 
1714
NdbDictionary::Dictionary::getEvent(const char * eventName)
 
1715
{
 
1716
  NdbEventImpl * t = m_impl.getEvent(eventName);
 
1717
  if(t)
 
1718
    return t->m_facade;
 
1719
  return 0;
 
1720
}
 
1721
 
 
1722
int
 
1723
NdbDictionary::Dictionary::listObjects(List& list, Object::Type type)
 
1724
{
 
1725
  return m_impl.listObjects(list, type);
 
1726
}
 
1727
 
 
1728
int
 
1729
NdbDictionary::Dictionary::listObjects(List& list, Object::Type type) const
 
1730
{
 
1731
  return m_impl.listObjects(list, type);
 
1732
}
 
1733
 
 
1734
int
 
1735
NdbDictionary::Dictionary::listIndexes(List& list, const char * tableName)
 
1736
{
 
1737
  const NdbDictionary::Table* tab= getTable(tableName);
 
1738
  if(tab == 0)
 
1739
  {
 
1740
    return -1;
 
1741
  }
 
1742
  return m_impl.listIndexes(list, tab->getTableId());
 
1743
}
 
1744
 
 
1745
int
 
1746
NdbDictionary::Dictionary::listIndexes(List& list,
 
1747
                                       const char * tableName) const
 
1748
{
 
1749
  const NdbDictionary::Table* tab= getTable(tableName);
 
1750
  if(tab == 0)
 
1751
  {
 
1752
    return -1;
 
1753
  }
 
1754
  return m_impl.listIndexes(list, tab->getTableId());
 
1755
}
 
1756
 
 
1757
int
 
1758
NdbDictionary::Dictionary::listIndexes(List& list,
 
1759
                                       const NdbDictionary::Table &table) const
 
1760
{
 
1761
  return m_impl.listIndexes(list, table.getTableId());
 
1762
}
 
1763
 
 
1764
 
 
1765
const struct NdbError & 
 
1766
NdbDictionary::Dictionary::getNdbError() const {
 
1767
  return m_impl.getNdbError();
 
1768
}
 
1769
 
 
1770
// printers
 
1771
 
 
1772
NdbOut&
 
1773
operator<<(NdbOut& out, const NdbDictionary::Column& col)
 
1774
{
 
1775
  const CHARSET_INFO *cs = col.getCharset();
 
1776
  const char *csname = cs ? cs->name : "?";
 
1777
  out << col.getName() << " ";
 
1778
  switch (col.getType()) {
 
1779
  case NdbDictionary::Column::Tinyint:
 
1780
    out << "Tinyint";
 
1781
    break;
 
1782
  case NdbDictionary::Column::Tinyunsigned:
 
1783
    out << "Tinyunsigned";
 
1784
    break;
 
1785
  case NdbDictionary::Column::Smallint:
 
1786
    out << "Smallint";
 
1787
    break;
 
1788
  case NdbDictionary::Column::Smallunsigned:
 
1789
    out << "Smallunsigned";
 
1790
    break;
 
1791
  case NdbDictionary::Column::Mediumint:
 
1792
    out << "Mediumint";
 
1793
    break;
 
1794
  case NdbDictionary::Column::Mediumunsigned:
 
1795
    out << "Mediumunsigned";
 
1796
    break;
 
1797
  case NdbDictionary::Column::Int:
 
1798
    out << "Int";
 
1799
    break;
 
1800
  case NdbDictionary::Column::Unsigned:
 
1801
    out << "Unsigned";
 
1802
    break;
 
1803
  case NdbDictionary::Column::Bigint:
 
1804
    out << "Bigint";
 
1805
    break;
 
1806
  case NdbDictionary::Column::Bigunsigned:
 
1807
    out << "Bigunsigned";
 
1808
    break;
 
1809
  case NdbDictionary::Column::Float:
 
1810
    out << "Float";
 
1811
    break;
 
1812
  case NdbDictionary::Column::Double:
 
1813
    out << "Double";
 
1814
    break;
 
1815
  case NdbDictionary::Column::Olddecimal:
 
1816
    out << "Olddecimal(" << col.getPrecision() << "," << col.getScale() << ")";
 
1817
    break;
 
1818
  case NdbDictionary::Column::Olddecimalunsigned:
 
1819
    out << "Olddecimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")";
 
1820
    break;
 
1821
  case NdbDictionary::Column::Decimal:
 
1822
    out << "Decimal(" << col.getPrecision() << "," << col.getScale() << ")";
 
1823
    break;
 
1824
  case NdbDictionary::Column::Decimalunsigned:
 
1825
    out << "Decimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")";
 
1826
    break;
 
1827
  case NdbDictionary::Column::Char:
 
1828
    out << "Char(" << col.getLength() << ";" << csname << ")";
 
1829
    break;
 
1830
  case NdbDictionary::Column::Varchar:
 
1831
    out << "Varchar(" << col.getLength() << ";" << csname << ")";
 
1832
    break;
 
1833
  case NdbDictionary::Column::Binary:
 
1834
    out << "Binary(" << col.getLength() << ")";
 
1835
    break;
 
1836
  case NdbDictionary::Column::Varbinary:
 
1837
    out << "Varbinary(" << col.getLength() << ")";
 
1838
    break;
 
1839
  case NdbDictionary::Column::Datetime:
 
1840
    out << "Datetime";
 
1841
    break;
 
1842
  case NdbDictionary::Column::Date:
 
1843
    out << "Date";
 
1844
    break;
 
1845
  case NdbDictionary::Column::Blob:
 
1846
    out << "Blob(" << col.getInlineSize() << "," << col.getPartSize()
 
1847
        << ";" << col.getStripeSize() << ")";
 
1848
    break;
 
1849
  case NdbDictionary::Column::Text:
 
1850
    out << "Text(" << col.getInlineSize() << "," << col.getPartSize()
 
1851
        << ";" << col.getStripeSize() << ";" << csname << ")";
 
1852
    break;
 
1853
  case NdbDictionary::Column::Time:
 
1854
    out << "Time";
 
1855
    break;
 
1856
  case NdbDictionary::Column::Year:
 
1857
    out << "Year";
 
1858
    break;
 
1859
  case NdbDictionary::Column::Timestamp:
 
1860
    out << "Timestamp";
 
1861
    break;
 
1862
  case NdbDictionary::Column::Undefined:
 
1863
    out << "Undefined";
 
1864
    break;
 
1865
  case NdbDictionary::Column::Bit:
 
1866
    out << "Bit(" << col.getLength() << ")";
 
1867
    break;
 
1868
  case NdbDictionary::Column::Longvarchar:
 
1869
    out << "Longvarchar(" << col.getLength() << ";" << csname << ")";
 
1870
    break;
 
1871
  case NdbDictionary::Column::Longvarbinary:
 
1872
    out << "Longvarbinary(" << col.getLength() << ")";
 
1873
    break;
 
1874
  default:
 
1875
    out << "Type" << (Uint32)col.getType();
 
1876
    break;
 
1877
  }
 
1878
  // show unusual (non-MySQL) array size
 
1879
  if (col.getLength() != 1) {
 
1880
    switch (col.getType()) {
 
1881
    case NdbDictionary::Column::Char:
 
1882
    case NdbDictionary::Column::Varchar:
 
1883
    case NdbDictionary::Column::Binary:
 
1884
    case NdbDictionary::Column::Varbinary:
 
1885
    case NdbDictionary::Column::Blob:
 
1886
    case NdbDictionary::Column::Text:
 
1887
    case NdbDictionary::Column::Bit:
 
1888
    case NdbDictionary::Column::Longvarchar:
 
1889
    case NdbDictionary::Column::Longvarbinary:
 
1890
      break;
 
1891
    default:
 
1892
      out << " [" << col.getLength() << "]";
 
1893
      break;
 
1894
    }
 
1895
  }
 
1896
 
 
1897
  if (col.getPrimaryKey())
 
1898
    out << " PRIMARY KEY";
 
1899
  else if (! col.getNullable())
 
1900
    out << " NOT NULL";
 
1901
  else
 
1902
    out << " NULL";
 
1903
 
 
1904
  if(col.getDistributionKey())
 
1905
    out << " DISTRIBUTION KEY";
 
1906
 
 
1907
  switch (col.getArrayType()) {
 
1908
  case NDB_ARRAYTYPE_FIXED:
 
1909
    out << " AT=FIXED";
 
1910
    break;
 
1911
  case NDB_ARRAYTYPE_SHORT_VAR:
 
1912
    out << " AT=SHORT_VAR";
 
1913
    break;
 
1914
  case NDB_ARRAYTYPE_MEDIUM_VAR:
 
1915
    out << " AT=MEDIUM_VAR";
 
1916
    break;
 
1917
  default:
 
1918
    out << " AT=" << (int)col.getArrayType() << "?";
 
1919
    break;
 
1920
  }
 
1921
 
 
1922
  switch (col.getStorageType()) {
 
1923
  case NDB_STORAGETYPE_MEMORY:
 
1924
    out << " ST=MEMORY";
 
1925
    break;
 
1926
  case NDB_STORAGETYPE_DISK:
 
1927
    out << " ST=DISK";
 
1928
    break;
 
1929
  default:
 
1930
    out << " ST=" << (int)col.getStorageType() << "?";
 
1931
    break;
 
1932
  }
 
1933
 
 
1934
  return out;
 
1935
}
 
1936
 
 
1937
int
 
1938
NdbDictionary::Dictionary::createLogfileGroup(const LogfileGroup & lg,
 
1939
                                              ObjectId * obj)
 
1940
{
 
1941
  return m_impl.createLogfileGroup(NdbLogfileGroupImpl::getImpl(lg),
 
1942
                                   obj ? 
 
1943
                                   & NdbDictObjectImpl::getImpl(* obj) : 0);
 
1944
}
 
1945
 
 
1946
int
 
1947
NdbDictionary::Dictionary::dropLogfileGroup(const LogfileGroup & lg)
 
1948
{
 
1949
  return m_impl.dropLogfileGroup(NdbLogfileGroupImpl::getImpl(lg));
 
1950
}
 
1951
 
 
1952
NdbDictionary::LogfileGroup
 
1953
NdbDictionary::Dictionary::getLogfileGroup(const char * name)
 
1954
{
 
1955
  NdbDictionary::LogfileGroup tmp;
 
1956
  m_impl.m_receiver.get_filegroup(NdbLogfileGroupImpl::getImpl(tmp), 
 
1957
                                  NdbDictionary::Object::LogfileGroup, name);
 
1958
  return tmp;
 
1959
}
 
1960
 
 
1961
int
 
1962
NdbDictionary::Dictionary::createTablespace(const Tablespace & lg,
 
1963
                                            ObjectId * obj)
 
1964
{
 
1965
  return m_impl.createTablespace(NdbTablespaceImpl::getImpl(lg),
 
1966
                                 obj ? 
 
1967
                                 & NdbDictObjectImpl::getImpl(* obj) : 0);
 
1968
}
 
1969
 
 
1970
int
 
1971
NdbDictionary::Dictionary::dropTablespace(const Tablespace & lg)
 
1972
{
 
1973
  return m_impl.dropTablespace(NdbTablespaceImpl::getImpl(lg));
 
1974
}
 
1975
 
 
1976
NdbDictionary::Tablespace
 
1977
NdbDictionary::Dictionary::getTablespace(const char * name)
 
1978
{
 
1979
  NdbDictionary::Tablespace tmp;
 
1980
  m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp), 
 
1981
                                  NdbDictionary::Object::Tablespace, name);
 
1982
  return tmp;
 
1983
}
 
1984
 
 
1985
NdbDictionary::Tablespace
 
1986
NdbDictionary::Dictionary::getTablespace(Uint32 tablespaceId)
 
1987
{
 
1988
  NdbDictionary::Tablespace tmp;
 
1989
  m_impl.m_receiver.get_filegroup(NdbTablespaceImpl::getImpl(tmp), 
 
1990
                                  NdbDictionary::Object::Tablespace,
 
1991
                                  tablespaceId);
 
1992
  return tmp;
 
1993
}
 
1994
 
 
1995
int
 
1996
NdbDictionary::Dictionary::createDatafile(const Datafile & df, 
 
1997
                                          bool force,
 
1998
                                          ObjectId * obj)
 
1999
{
 
2000
  return m_impl.createDatafile(NdbDatafileImpl::getImpl(df), 
 
2001
                               force,
 
2002
                               obj ? & NdbDictObjectImpl::getImpl(* obj) : 0);
 
2003
}
 
2004
 
 
2005
int
 
2006
NdbDictionary::Dictionary::dropDatafile(const Datafile& df)
 
2007
{
 
2008
  return m_impl.dropDatafile(NdbDatafileImpl::getImpl(df));
 
2009
}
 
2010
 
 
2011
NdbDictionary::Datafile
 
2012
NdbDictionary::Dictionary::getDatafile(Uint32 node, const char * path)
 
2013
{
 
2014
  NdbDictionary::Datafile tmp;
 
2015
  m_impl.m_receiver.get_file(NdbDatafileImpl::getImpl(tmp),
 
2016
                             NdbDictionary::Object::Datafile,
 
2017
                             node ? (int)node : -1, path);
 
2018
  return tmp;
 
2019
}
 
2020
 
 
2021
int
 
2022
NdbDictionary::Dictionary::createUndofile(const Undofile & df, 
 
2023
                                          bool force,
 
2024
                                          ObjectId * obj)
 
2025
{
 
2026
  return m_impl.createUndofile(NdbUndofileImpl::getImpl(df), 
 
2027
                               force,
 
2028
                               obj ? & NdbDictObjectImpl::getImpl(* obj) : 0);
 
2029
}
 
2030
 
 
2031
int
 
2032
NdbDictionary::Dictionary::dropUndofile(const Undofile& df)
 
2033
{
 
2034
  return m_impl.dropUndofile(NdbUndofileImpl::getImpl(df));
 
2035
}
 
2036
 
 
2037
NdbDictionary::Undofile
 
2038
NdbDictionary::Dictionary::getUndofile(Uint32 node, const char * path)
 
2039
{
 
2040
  NdbDictionary::Undofile tmp;
 
2041
  m_impl.m_receiver.get_file(NdbUndofileImpl::getImpl(tmp),
 
2042
                             NdbDictionary::Object::Undofile,
 
2043
                             node ? (int)node : -1, path);
 
2044
  return tmp;
 
2045
}
 
2046