diff options
author | unknown <brian@zim.(none)> | 2007-01-26 14:17:45 -0800 |
---|---|---|
committer | unknown <brian@zim.(none)> | 2007-01-26 14:17:45 -0800 |
commit | c95bc8dcdbe50614bcd00051424d388fed42f999 (patch) | |
tree | 3da125d6fec077faefad6e7cd699a550a5c5b1a0 /storage/archive | |
parent | f69cfbf857475d416e549ff1403947d61396201f (diff) | |
download | mariadb-git-c95bc8dcdbe50614bcd00051424d388fed42f999.tar.gz |
For performance reasons we remove the ability in unique indexes on autoincrements to remove the ability to insert key lower then the current autoincrement value.
mysql-test/r/archive.result:
Modified error output
mysql-test/t/archive.test:
Fix for the change in behavior
storage/archive/ha_archive.cc:
ifdef of the search record code
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/ha_archive.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 6a03783ac3f..584de61ca10 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -784,23 +784,22 @@ int ha_archive::write_row(byte *buf) temp_auto= table->next_number_field->val_int(); /* - Simple optimization to see if we fail for duplicate key immediatly - because we have just given out this value. + We don't support decremening auto_increment. They make the performance + just cry. */ - if (temp_auto == share->archive_write.auto_increment && + if (temp_auto <= share->archive_write.auto_increment && mkey->flags & HA_NOSAME) { rc= HA_ERR_FOUND_DUPP_KEY; goto error; } +#ifdef DEAD_CODE /* Bad news, this will cause a search for the unique value which is very expensive since we will have to do a table scan which will lock up all other writers during this period. This could perhaps be optimized in the future. */ - if (temp_auto < share->archive_write.auto_increment && - mkey->flags & HA_NOSAME) { /* First we create a buffer that we can use for reading rows, and can pass @@ -838,6 +837,7 @@ int ha_archive::write_row(byte *buf) } } } +#endif else { if (temp_auto > share->archive_write.auto_increment) |