diff options
author | unknown <ramil@mysql.com> | 2005-03-15 19:31:52 +0400 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2005-03-15 19:31:52 +0400 |
commit | 3c42daa9a371e7900f10d2bfb2cf20e46cfba122 (patch) | |
tree | 38d287295dc7d362de78330407519219d297132a /sql/ha_heap.cc | |
parent | 9af776c8cbad88bf4d42686c91a6aa8a67484d56 (diff) | |
parent | 0ba3164e0e0fa7217059413440f7ab2f844efce7 (diff) | |
download | mariadb-git-3c42daa9a371e7900f10d2bfb2cf20e46cfba122.tar.gz |
merging
heap/hp_create.c:
Auto merged
sql/filesort.cc:
Auto merged
mysql-test/r/heap.result:
manual merging
mysql-test/t/heap.test:
manual merging
sql/ha_heap.cc:
manual merging
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 7dc7da4dad6..28a7b5529c9 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -457,6 +457,7 @@ int ha_heap::create(const char *name, TABLE *table_arg, char buff[FN_REFLEN]; int error; TABLE_SHARE *share= table_arg->s; + bool found_real_auto_increment= 0; for (key= parts= 0; key < keys; key++) parts+= table_arg->key_info[key].key_parts; @@ -520,19 +521,22 @@ 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(); - } } } mem_per_row+= MY_ALIGN(share->reclength + 1, sizeof(char*)); max_rows = (ha_rows) (table->in_use->variables.max_heap_table_size / mem_per_row); + 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; + } 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; |