diff options
author | gluh@gluh.mysql.r18.ru <> | 2005-03-17 16:51:07 +0300 |
---|---|---|
committer | gluh@gluh.mysql.r18.ru <> | 2005-03-17 16:51:07 +0300 |
commit | b435d6e8624800e63f7b1b3e49f181c186db7c21 (patch) | |
tree | 7107fca24e8d8dd39be0300a9e1e64d7ad8921a2 /sql/ha_heap.cc | |
parent | 08b2c7ecca7ba3fd3d55267bcf4ce900fa9ce595 (diff) | |
parent | 261105a0077dff19d0f6e38dc3a225ad19ba4a1b (diff) | |
download | mariadb-git-b435d6e8624800e63f7b1b3e49f181c186db7c21.tar.gz |
Merge 4.1 -> 5.0
Diffstat (limited to 'sql/ha_heap.cc')
-rw-r--r-- | sql/ha_heap.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index c8d0e5c1c18..24f21718b8c 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -521,9 +521,17 @@ 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) + if (field->flags & AUTO_INCREMENT_FLAG && + table_arg->found_next_number_field && + key == table_arg->next_number_index) + { + /* + Store key number and type for found auto_increment key + We have to store type as seg->type can differ from it + */ + auto_key= key+ 1; auto_key_type= field->key_type(); + } } } mem_per_row+= MY_ALIGN(share->reclength + 1, sizeof(char*)); @@ -535,8 +543,8 @@ int ha_heap::create(const char *name, TABLE *table_arg, found_real_auto_increment= share->next_number_key_offset == 0; } 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; |