diff options
author | unknown <ingo@mysql.com> | 2006-05-31 10:22:44 +0200 |
---|---|---|
committer | unknown <ingo@mysql.com> | 2006-05-31 10:22:44 +0200 |
commit | 4a1d076342fff6e6afe6054d48f33453c9ec5bb8 (patch) | |
tree | f67511920e1e2be1d9e959bf82d1dc47b4792b90 /myisam/mi_update.c | |
parent | 47302570e639927b258e10a7c009e6d585ba8adf (diff) | |
download | mariadb-git-4a1d076342fff6e6afe6054d48f33453c9ec5bb8.tar.gz |
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
CHECK TABLE did temporarily clear the auto_increment value.
It runs with a read lock, allowing other readers and
conurrent INSERTs. The latter could grab the wrong value
in this moment.
CHECK TABLE does no longer modify the auto_increment value.
Not even for a short moment.
myisam/mi_check.c:
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
In chk_key() and update_auto_increment_key() in the repair_only
case, do not touch info->s->state.auto_increment. Especially
chk_key() can be called from CHECK TABLE with a read lock.
Concurrent inserts could grab a temporarily changed value.
Added minor style fixes.
myisam/mi_key.c:
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
Changed update_auto_increment() to retrieve_auto_increment()
to reflect that it does not change the auto_increment by
itself any more. This must now be done externally if needed.
myisam/mi_update.c:
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
Added explicit update of info->s->state.auto_increment
after the change from update_auto_increment() to
retrieve_auto_increment().
myisam/mi_write.c:
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
Added explicit update of info->s->state.auto_increment
after the change from update_auto_increment() to
retrieve_auto_increment().
myisam/myisamdef.h:
Bug#19604 - CHECK TABLE with concurrent INSERT can reset auto_increment
Changed update_auto_increment() to retrieve_auto_increment()
to reflect that it does not change the auto_increment by
itself any more. This must now be done externally if needed.
Diffstat (limited to 'myisam/mi_update.c')
-rw-r--r-- | myisam/mi_update.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/myisam/mi_update.c b/myisam/mi_update.c index 937c9983b45..f8b5cf55406 100644 --- a/myisam/mi_update.c +++ b/myisam/mi_update.c @@ -164,7 +164,8 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec) key_changed|= HA_STATE_CHANGED; /* Must update index file */ } if (auto_key_changed) - update_auto_increment(info,newrec); + set_if_bigger(info->s->state.auto_increment, + retrieve_auto_increment(info, newrec)); if (share->calc_checksum) info->state->checksum+=(info->checksum - old_checksum); |