diff options
author | monty@mashka.mysql.fi <> | 2003-03-07 12:36:52 +0200 |
---|---|---|
committer | monty@mashka.mysql.fi <> | 2003-03-07 12:36:52 +0200 |
commit | 987f4c4d8b32e3871c2ec0c4c3acb2cd8d513041 (patch) | |
tree | b7b683cfb2aa34dc7387c8098c3d38fe143f5607 /sql/ha_myisam.cc | |
parent | d56e2acf50715327e66045366da46e5fe2ddda09 (diff) | |
download | mariadb-git-987f4c4d8b32e3871c2ec0c4c3acb2cd8d513041.tar.gz |
Fixed AUTO_INCREMENT handling in MyISAM (last auto_increment patch broke things)
Some after merge fixes
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 6e055f57c83..749a3eba5e4 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -1021,7 +1021,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, { int error; uint i,j,recpos,minpos,fieldpos,temp_length,length; - bool found_auto_increment=0, found_real_auto_increment=0; + bool found_real_auto_increment=0; enum ha_base_keytype type; char buff[FN_REFLEN]; KEY *pos; @@ -1091,12 +1091,6 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keydef[i].seg[j].null_bit=0; keydef[i].seg[j].null_pos=0; } - if (field->flags & AUTO_INCREMENT_FLAG && !found_auto_increment) - { - keydef[i].flag|=HA_AUTO_KEY; - found_auto_increment=1; - found_real_auto_increment=(j==0); - } if (field->type() == FIELD_TYPE_BLOB) { keydef[i].seg[j].flag|=HA_BLOB_PART; @@ -1108,6 +1102,12 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, keyseg+=pos->key_parts; } + 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; + } + recpos=0; recinfo_pos=recinfo; while (recpos < (uint) table_arg->reclength) { |