diff options
author | Anurag Shekhar <anurag.shekhar@sun.com> | 2009-02-23 15:39:08 +0530 |
---|---|---|
committer | Anurag Shekhar <anurag.shekhar@sun.com> | 2009-02-23 15:39:08 +0530 |
commit | e6babb70a6eae54f82d86adac582ba99e3475ea6 (patch) | |
tree | 3d680c826288650adba93dd427ce90fa957155f7 /storage/myisam | |
parent | dd83d6c2309a7ab320c091306dff6b1afecad62d (diff) | |
parent | 8f3f7992a02f081c2ecc1760ff0e62f44f90491b (diff) | |
download | mariadb-git-e6babb70a6eae54f82d86adac582ba99e3475ea6.tar.gz |
merging with changes in bugteam branch.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 9 | ||||
-rw-r--r-- | storage/myisam/mi_locking.c | 2 | ||||
-rw-r--r-- | storage/myisam/myisamdef.h | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index eb31c0b84cf..0585d59f53e 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -2152,6 +2152,15 @@ my_bool ha_myisam::register_query_cache_table(THD *thd, char *table_name, } } + /* + This query execution might have started after the query cache was flushed + by a concurrent INSERT. In this case, don't cache this statement as the + data file length difference might not be visible yet if the tables haven't + been unlocked by the concurrent insert thread. + */ + if (file->state->uncacheable) + DBUG_RETURN(FALSE); + /* It is ok to try to cache current statement. */ DBUG_RETURN(TRUE); } diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c index ec359d13a14..6a4c21160f4 100644 --- a/storage/myisam/mi_locking.c +++ b/storage/myisam/mi_locking.c @@ -293,6 +293,8 @@ void mi_get_status(void* param, int concurrent_insert) info->save_state=info->s->state.state; info->state= &info->save_state; info->append_insert_at_end= concurrent_insert; + if (concurrent_insert) + info->s->state.state.uncacheable= TRUE; DBUG_VOID_RETURN; } 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 |