From 2b0c4476835c31f37b93aa96a905cdf1917766cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Dec 2006 18:44:14 +0400 Subject: 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. include/thr_lock.h: Added restore_status, that will be called prior to release a read lock. myisam/mi_locking.c: Added mi_restore_status, that will be called prior to release a read lock. This function is intended to set myisam state pointer back to original value, that is to shared state. myisam/mi_open.c: Added restore_status, that will be called prior to release a read lock. myisam/myisamdef.h: Added mi_restore_status, that will be called prior to release a read lock. mysys/thr_lock.c: Call restore_status if we have lock with priority lower than TL_WRITE_CONCURRENT_INSERT. --- include/thr_lock.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/thr_lock.h') diff --git a/include/thr_lock.h b/include/thr_lock.h index 251d8e7c9cf..d34358d5a6b 100644 --- a/include/thr_lock.h +++ b/include/thr_lock.h @@ -122,6 +122,7 @@ typedef struct st_thr_lock { void (*get_status)(void*, int); /* When one gets a lock */ void (*copy_status)(void*,void*); void (*update_status)(void*); /* Before release of write */ + void (*restore_status)(void*); /* Before release of read */ my_bool (*check_status)(void *); } THR_LOCK; -- cgit v1.2.1