summaryrefslogtreecommitdiff
path: root/storage/myisam/myisamdef.h
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-02-19 18:09:35 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-02-19 18:09:35 -0300
commit664bb23a30572e89da319c9d2f201a7de3828c1b (patch)
tree0efbed29d8a6efd5edc3847ce637c2a2de93289c /storage/myisam/myisamdef.h
parent8e8c5bbe7ae612eaae0b5f27e7d0a45f105fb549 (diff)
downloadmariadb-git-664bb23a30572e89da319c9d2f201a7de3828c1b.tar.gz
Bug#41098: Query Cache returns wrong result with concurrent insert
The problem is that select queries executed concurrently with a concurrent insert on a MyISAM table could be cached if the select started after the query cache invalidation but before the unlock of tables performed by the concurrent insert. This race could happen because the concurrent insert was failing to prevent cache of select queries happening at the same time. The solution is to add a 'uncacheable' status flag to signal that a concurrent insert is being performed on the table and that queries executing at the same time shouldn't cache the results. mysql-test/r/query_cache_debug.result: Add test case result for Bug#41098 mysql-test/t/disabled.def: Re-enable test case. mysql-test/t/query_cache_debug.test: Add test case for Bug#41098 sql/sql_cache.cc: Debug sync point for regression testing purposes. sql/sql_insert.cc: Remove meaningless query cache invalidate. There is already a preceding invalidate for queries that started before the concurrent insert. storage/myisam/ha_myisam.cc: Check for a active concurrent insert. storage/myisam/mi_locking.c: Signal the start of a concurrent insert. Flag is zeroed once the state is updated back. storage/myisam/myisamdef.h: Add flag to signal a active concurrent insert.
Diffstat (limited to 'storage/myisam/myisamdef.h')
-rw-r--r--storage/myisam/myisamdef.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 9af3f652c5f..b64c7f6bd7f 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -38,6 +38,7 @@ typedef struct st_mi_status_info
my_off_t key_file_length;
my_off_t data_file_length;
ha_checksum checksum;
+ my_bool uncacheable; /* Active concurrent insert */
} MI_STATUS_INFO;
typedef struct st_mi_state_info