~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/ha_heap.cc

  • Committer: Brian Aker
  • Date: 2009-11-20 19:07:14 UTC
  • mfrom: (1223.1.5 push)
  • Revision ID: brian@gaz-20091120190714-dhr3lgqxrt7dq1fc
Collected Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
  int doCreateTable(Session *session, 
69
69
                    const char *table_name,
70
70
                    Table& table_arg, 
71
 
                    HA_CREATE_INFO& create_info,
72
 
                    drizzled::message::Table&);
 
71
                    drizzled::message::Table &create_proto);
73
72
 
74
73
  /* For whatever reason, internal tables can be created by Cursor::open()
75
74
     for HEAP.
77
76
     at night with this odd hackish workaround.
78
77
   */
79
78
  int heap_create_table(Session *session, const char *table_name,
80
 
                        Table *table_arg, HA_CREATE_INFO& create_info,
 
79
                        Table *table_arg,
81
80
                        bool internal_table,
 
81
                        drizzled::message::Table &create_proto,
82
82
                        HP_SHARE **internal_share);
83
83
 
84
84
  int doRenameTable(Session*, const char * from, const char * to);
194
194
    memset(&create_info, 0, sizeof(create_info));
195
195
    file= 0;
196
196
    HP_SHARE *internal_share= NULL;
 
197
    drizzled::message::Table create_proto;
 
198
 
197
199
    if (!heap_storage_engine->heap_create_table(ha_session(), name, table,
198
 
                                                create_info,
199
 
                                                internal_table,&internal_share))
 
200
                                                internal_table,
 
201
                                                create_proto,
 
202
                                                &internal_share))
200
203
    {
201
204
        file= internal_table ?
202
205
          heap_open_from_share(internal_share, mode) :
696
699
int HeapEngine::doCreateTable(Session *session,
697
700
                              const char *table_name,
698
701
                              Table &table_arg,
699
 
                              HA_CREATE_INFO& create_info,
700
702
                              drizzled::message::Table& create_proto)
701
703
{
702
704
  int error;
703
705
  HP_SHARE *internal_share;
704
706
 
705
 
  error= heap_create_table(session, table_name, &table_arg, create_info,
706
 
                           false, &internal_share);
 
707
  error= heap_create_table(session, table_name, &table_arg,
 
708
                           false, 
 
709
                           create_proto,
 
710
                           &internal_share);
707
711
 
708
712
  if (error == 0)
709
713
  {
717
721
 
718
722
 
719
723
int HeapEngine::heap_create_table(Session *session, const char *table_name,
720
 
                                  Table *table_arg, HA_CREATE_INFO& create_info,
721
 
                                  bool internal_table, HP_SHARE **internal_share)
 
724
                                  Table *table_arg,
 
725
                                  bool internal_table, 
 
726
                                  drizzled::message::Table &create_proto,
 
727
                                  HP_SHARE **internal_share)
722
728
{
723
729
  uint32_t key, parts, mem_per_row_keys= 0, keys= table_arg->s->keys;
724
730
  uint32_t auto_key= 0, auto_key_type= 0;
887
893
  HP_CREATE_INFO hp_create_info;
888
894
  hp_create_info.auto_key= auto_key;
889
895
  hp_create_info.auto_key_type= auto_key_type;
890
 
  hp_create_info.auto_increment= (create_info.auto_increment_value ?
891
 
                                  create_info.auto_increment_value - 1 : 0);
 
896
  hp_create_info.auto_increment= (create_proto.options().has_auto_increment_value() ?
 
897
                                  create_proto.options().auto_increment_value() - 1 : 0);
892
898
  hp_create_info.max_table_size=session->variables.max_heap_table_size;
893
899
  hp_create_info.with_auto_increment= found_real_auto_increment;
894
900
  hp_create_info.internal_table= internal_table;