diff options
author | svoj@mysql.com/april.(none) <> | 2006-12-05 18:44:14 +0400 |
---|---|---|
committer | svoj@mysql.com/april.(none) <> | 2006-12-05 18:44:14 +0400 |
commit | 3cfd578ea7efa50805d2a069e6e180331ba41358 (patch) | |
tree | 9bfaf90b766af893236c8c1d47c5bc549205eab2 /myisam/mi_locking.c | |
parent | 763fdea487e690ba9332e50397e93f32d2a54a43 (diff) | |
download | mariadb-git-3cfd578ea7efa50805d2a069e6e180331ba41358.tar.gz |
BUG#23526 - show table status reports incorrect values for MyISAM tables
This problem could happen when show table status get outdated copy
of TABLE object from table cache.
MyISAM updates state info when external_lock() method is called. Though
I_S does not lock a table to avoid deadlocks. If I_S opens a table which
is in a table cache it will likely get outdated state info copy.
In this case shared state copy is more recent than local copy. This problem
is fixed by correctly restoring myisam state info pointer back to original
value, that is to shared state.
Affects MyISAM only. No good deterministic test case for this fix.
Diffstat (limited to 'myisam/mi_locking.c')
-rw-r--r-- | myisam/mi_locking.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c index 36b793363c5..ee776128eb8 100644 --- a/myisam/mi_locking.c +++ b/myisam/mi_locking.c @@ -326,6 +326,15 @@ void mi_update_status(void* param) } } + +void mi_restore_status(void *param) +{ + MI_INFO *info= (MI_INFO*) param; + info->state= &info->s->state.state; + info->append_insert_at_end= 0; +} + + void mi_copy_status(void* to,void *from) { ((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state; |