~thomir-deactivatedaccount/drizzle/drizzle-fix-bug653747

« back to all changes in this revision

Viewing changes to plugin/haildb/datadict_table_message.cc

  • Committer: Brian Aker
  • Date: 2010-10-10 02:07:52 UTC
  • mfrom: (1827.2.3 staging)
  • Revision ID: brian@tangent.org-20101010020752-ktv73isay5dxtvp3
Merge in switch on table_share_instance inheritance.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include "config.h"
20
20
 
21
 
#include <haildb.h>
 
21
#if defined(HAVE_HAILDB_H)
 
22
# include <haildb.h>
 
23
#else
 
24
# include <embedded_innodb-1.0/innodb.h>
 
25
#endif /* HAVE_HAILDB_H */
22
26
 
23
27
#include "haildb_engine.h"
24
28
 
87
91
    field->set_name("SPACE");
88
92
    field->set_type(message::Table::Field::INTEGER);
89
93
 
 
94
 
90
95
    message::Table::Index *index= table_message->add_indexes();
91
96
    index->set_name("PRIMARY");
92
97
    index->set_is_primary(true);
151
156
    index->set_is_primary(true);
152
157
    index->set_is_unique(true);
153
158
    index->set_type(message::Table::Index::BTREE);
154
 
    index->set_key_length(sizeof(uint64_t) + sizeof(uint32_t));
 
159
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
155
160
    message::Table::Index::IndexPart *part= index->add_index_part();
156
161
    part->set_fieldnr(0);
157
 
    part->set_compare_length(sizeof(uint64_t));
158
162
    part= index->add_index_part();
159
163
    part->set_fieldnr(1);
160
 
    part->set_compare_length(sizeof(uint32_t));
161
164
 
162
165
    return 0;
163
166
  }
213
216
    index->set_is_primary(true);
214
217
    index->set_is_unique(true);
215
218
    index->set_type(message::Table::Index::BTREE);
216
 
    index->set_key_length(sizeof(uint64_t) + sizeof(uint32_t));
 
219
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
217
220
    message::Table::Index::IndexPart *part= index->add_index_part();
218
221
    part->set_fieldnr(0);
219
 
    part->set_compare_length(sizeof(uint64_t));
220
222
    part= index->add_index_part();
221
223
    part->set_fieldnr(1);
222
 
    part->set_compare_length(sizeof(uint32_t));
223
224
 
224
225
    return 0;
225
226
  }
259
260
    index->set_is_primary(true);
260
261
    index->set_is_unique(true);
261
262
    index->set_type(message::Table::Index::BTREE);
262
 
    index->set_key_length(sizeof(uint64_t) + sizeof(uint32_t));
 
263
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
263
264
    message::Table::Index::IndexPart *part= index->add_index_part();
264
265
    part->set_fieldnr(0);
265
 
    part->set_compare_length(sizeof(uint64_t));
266
266
    part= index->add_index_part();
267
267
    part->set_fieldnr(1);
268
 
    part->set_compare_length(sizeof(uint32_t));
269
268
 
270
269
    return 0;
271
270
  }
313
312
    index->set_is_primary(true);
314
313
    index->set_is_unique(true);
315
314
    index->set_type(message::Table::Index::BTREE);
316
 
    index->set_key_length(sizeof(uint64_t));
 
315
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
317
316
    message::Table::Index::IndexPart *part= index->add_index_part();
318
317
    part->set_fieldnr(0);
319
 
    part->set_compare_length(sizeof(uint64_t));
320
318
 
321
319
    index= table_message->add_indexes();
322
320
    index->set_name("FOR_IND");
326
324
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
327
325
    part= index->add_index_part();
328
326
    part->set_fieldnr(1);
329
 
    part->set_compare_length(IB_MAX_TABLE_NAME_LEN);
330
327
 
331
328
    index= table_message->add_indexes();
332
329
    index->set_name("REF_IND");
336
333
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
337
334
    part= index->add_index_part();
338
335
    part->set_fieldnr(2);
339
 
    part->set_compare_length(IB_MAX_TABLE_NAME_LEN);
 
336
 
340
337
    return 0;
341
338
  }
342
339
  else if (strcmp(table_name, "SYS_FOREIGN_COLS") == 0)
383
380
    index->set_is_primary(true);
384
381
    index->set_is_unique(true);
385
382
    index->set_type(message::Table::Index::BTREE);
386
 
    index->set_key_length(sizeof(uint64_t) + sizeof(uint32_t));
 
383
    index->set_key_length(IB_MAX_TABLE_NAME_LEN);
387
384
    message::Table::Index::IndexPart *part= index->add_index_part();
388
385
    part->set_fieldnr(0);
389
 
    part->set_compare_length(sizeof(uint64_t));
390
386
    part= index->add_index_part();
391
387
    part->set_fieldnr(1);
392
 
    part->set_compare_length(sizeof(uint32_t));
393
388
 
394
389
    return 0;
395
390
  }