diff options
author | unknown <marko@hundin.mysql.fi> | 2005-03-15 14:48:09 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-03-15 14:48:09 +0200 |
commit | e656fba7788dcb42c2c74a6f5a575f28e284aa03 (patch) | |
tree | d1b447e4dac76038a0be86428308f274f19cb614 /sql/ha_heap.cc | |
parent | bcabdc22bf0aaad9b93112936ba1264070339663 (diff) | |
parent | be26b499695adfb6c02f0131e0016613433cc28c (diff) | |
download | mariadb-git-e656fba7788dcb42c2c74a6f5a575f28e284aa03.tar.gz |
Merge marko@bk-internal.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/marko/mysql-4.1
Diffstat (limited to 'sql/ha_heap.cc')
-rw-r--r-- | sql/ha_heap.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 3c2249ce281..c483ab8fffa 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -446,6 +446,7 @@ int ha_heap::create(const char *name, TABLE *table_arg, HA_KEYSEG *seg; char buff[FN_REFLEN]; int error; + bool found_real_auto_increment= 0; for (key= parts= 0; key < table_arg->keys; key++) parts+= table_arg->key_info[key].key_parts; @@ -506,17 +507,20 @@ int ha_heap::create(const char *name, TABLE *table_arg, seg->null_bit= 0; seg->null_pos= 0; } + // We have to store field->key_type() as seg->type can differ from it if (field->flags & AUTO_INCREMENT_FLAG) - { - auto_key= key + 1; auto_key_type= field->key_type(); - } } } + if (table_arg->found_next_number_field) + { + keydef[table_arg->next_number_index].flag|= HA_AUTO_KEY; + found_real_auto_increment= table_arg->next_number_key_offset == 0; + } mem_per_row+= MY_ALIGN(table_arg->reclength + 1, sizeof(char*)); HP_CREATE_INFO hp_create_info; - hp_create_info.auto_key= auto_key; hp_create_info.auto_key_type= auto_key_type; + hp_create_info.with_auto_increment= found_real_auto_increment; hp_create_info.auto_increment= (create_info->auto_increment_value ? create_info->auto_increment_value - 1 : 0); hp_create_info.max_table_size=current_thd->variables.max_heap_table_size; |