At file:///Users/bell/maria/bzr/work-maria-5.1-querycache-merge/ ------------------------------------------------------------ revno: 2754 [merge] revision-id: sanja@askmonty.org-20091006100053-mu2ek7z8rfxap4k3 parent: knielsen@knielsen-hq.org-20091006064645-h8280o8hmtouexzi parent: sanja@askmonty.org-20091006065722-ro0p0euffbtl4j05 committer: sanja@askmonty.org branch nick: work-maria-5.1-querycache-merge timestamp: Tue 2009-10-06 13:00:53 +0300 message: merge added: BUILD/compile-pentium-debug-max-no-qc compilepentiumdebugm-20090923065542-7a3x9z3bgfxn1rac-1 modified: BUILD/SETUP.sh sp1f-setup.sh-20001218212418-itvzddls4bsqffggcsjklbawdmaxdhde sql/mysql_priv.h sp1f-mysql_priv.h-19700101030959-4fl65tqpop5zfgxaxkqotu2fa2ree5ci storage/maria/ha_maria.cc sp1f-ha_maria.cc-20060411134405-dmngb4v5x5fxlxhff527ud3etiutxuxk storage/maria/ma_state.c sp1f-ma_state.c-20080529153331-ttwxiq5ksyib6sdrdsdl2lnbbm362lwh storage/maria/maria_def.h sp1f-maria_def.h-20060411134454-urdx4joxwcwzxbmltpzejn53y2rgjs44 storage/myisam/ha_myisam.cc sp1f-ha_myisam.cc-19700101030959-7xzssylbn7zfz3nupnsw43wws6xlltsu storage/myisam/mi_locking.c sp1f-mi_locking.c-19700101030959-27f7n7juexzv4qrhkiwcoylzh4yfibbl storage/myisam/myisamdef.h sp1f-myisamdef.h-19700101030959-fzrxvpmzhzqfn5w2clasmcw7af4kanoa === modified file 'BUILD/SETUP.sh' --- a/BUILD/SETUP.sh 2009-09-29 19:02:48 +0000 +++ b/BUILD/SETUP.sh 2009-10-06 10:00:53 +0000 @@ -172,6 +172,7 @@ max_no_embedded_configs="$SSL_LIBRARY --with-plugins=max" +max_no_qc_configs="$SSL_LIBRARY --with-plugins=max --without-query-cache" max_no_ndb_configs="$SSL_LIBRARY --with-plugins=max-no-ndb --with-embedded-server --with-libevent" max_configs="$SSL_LIBRARY --with-plugins=max --with-embedded-server --with-libevent" # Disable NDB in maria max builds === added file 'BUILD/compile-pentium-debug-max-no-qc' --- a/BUILD/compile-pentium-debug-max-no-qc 1970-01-01 00:00:00 +0000 +++ b/BUILD/compile-pentium-debug-max-no-qc 2009-10-06 06:57:22 +0000 @@ -0,0 +1,9 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium_cflags $debug_cflags" +extra_configs="$pentium_configs $debug_configs $max_no_qc_configs" + +. "$path/FINISH.sh" === modified file 'sql/mysql_priv.h' --- a/sql/mysql_priv.h 2009-09-15 10:46:35 +0000 +++ b/sql/mysql_priv.h 2009-10-06 10:00:53 +0000 @@ -947,7 +947,6 @@ #define query_cache_abort(A) #define query_cache_end_of_result(A) -#define query_cache_invalidate_by_MyISAM_filename_ref NULL #define query_cache_maybe_disabled(T) 1 #define query_cache_is_cacheable_query(L) 0 #endif /*HAVE_QUERY_CACHE*/ === modified file 'storage/maria/ha_maria.cc' --- a/storage/maria/ha_maria.cc 2009-09-07 20:50:10 +0000 +++ b/storage/maria/ha_maria.cc 2009-10-06 10:00:53 +0000 @@ -28,6 +28,7 @@ #include <my_bit.h> #include "ha_maria.h" #include "trnman_public.h" +#include "trnman.h" C_MODE_START #include "maria_def.h" @@ -918,6 +919,8 @@ if (!(file= maria_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); + file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; + if (test_if_locked & (HA_OPEN_IGNORE_IF_LOCKED | HA_OPEN_TMP_TABLE)) VOID(maria_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0)); @@ -3238,6 +3241,9 @@ */ *engine_data= 0; + if (file->s->now_transactional && file->s->have_versioning) + return (file->trn->trid >= file->s->state.last_change_trn); + /* If a concurrent INSERT has happened just before the currently processed SELECT statement, the total size of the table is unknown. === modified file 'storage/maria/ma_state.c' --- a/storage/maria/ma_state.c 2008-12-27 02:05:16 +0000 +++ b/storage/maria/ma_state.c 2009-10-06 06:57:22 +0000 @@ -318,6 +318,13 @@ DBUG_ASSERT(!info->s->base.born_transactional); share->state.state= *info->state; info->state= &share->state.state; +#ifdef HAVE_QUERY_CACHE + DBUG_PRINT("info", ("invalidator... '%s' (status update)", + info->s->data_file_name.str)); + DBUG_ASSERT(info->s->chst_invalidator != NULL); + (*info->s->chst_invalidator)((const char *)info->s->data_file_name.str); +#endif + } info->append_insert_at_end= 0; } @@ -469,6 +476,8 @@ tables->state_start.checksum); history->trid= trn->commit_trid; + share->state.last_change_trn= trn->commit_trid; + if (history->next) { /* Remove not visible states */ === modified file 'storage/maria/maria_def.h' --- a/storage/maria/maria_def.h 2009-02-19 09:01:25 +0000 +++ b/storage/maria/maria_def.h 2009-10-06 06:57:22 +0000 @@ -83,6 +83,7 @@ pgcache_page_no_t first_bitmap_with_space; ulonglong auto_increment; TrID create_trid; /* Minum trid for file */ + TrID last_change_trn; /* selfdescriptive */ ulong update_count; /* Updated for each write lock */ ulong status; double *rec_per_key_part; @@ -337,7 +338,10 @@ /* Mapings to read/write the data file */ size_t (*file_read)(MARIA_HA *, uchar *, size_t, my_off_t, myf); size_t (*file_write)(MARIA_HA *, const uchar *, size_t, my_off_t, myf); - invalidator_by_filename invalidator; /* query cache invalidator */ + /* query cache invalidator for merged tables */ + invalidator_by_filename invalidator; + /* query cache invalidator for changing state */ + invalidator_by_filename chst_invalidator; my_off_t key_del_current; /* delete links for index pages */ ulong this_process; /* processid */ ulong last_process; /* For table-change-check */ === modified file 'storage/myisam/ha_myisam.cc' --- a/storage/myisam/ha_myisam.cc 2009-09-07 20:50:10 +0000 +++ b/storage/myisam/ha_myisam.cc 2009-10-06 10:00:53 +0000 @@ -690,6 +690,9 @@ if (!(file=mi_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) return (my_errno ? my_errno : -1); + + file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; + if (!table->s->tmp_table) /* No need to perform a check for tmp table */ { if ((my_errno= table2myisam(table, &keyinfo, &recinfo, &recs))) === modified file 'storage/myisam/mi_locking.c' --- a/storage/myisam/mi_locking.c 2009-09-03 14:05:38 +0000 +++ b/storage/myisam/mi_locking.c 2009-10-06 06:57:22 +0000 @@ -329,6 +329,12 @@ #endif info->s->state.state= *info->state; info->state= &info->s->state.state; +#ifdef HAVE_QUERY_CACHE + DBUG_PRINT("info", ("invalidator... '%s' (status update)", + info->filename)); + DBUG_ASSERT(info->s->chst_invalidator != NULL); + (*info->s->chst_invalidator)((const char *)info->filename); +#endif } info->append_insert_at_end= 0; === modified file 'storage/myisam/myisamdef.h' --- a/storage/myisam/myisamdef.h 2009-04-25 09:04:38 +0000 +++ b/storage/myisam/myisamdef.h 2009-10-06 06:57:22 +0000 @@ -190,7 +190,10 @@ const uchar *record, my_off_t pos); size_t (*file_read) (MI_INFO *, uchar *, size_t, my_off_t, myf); size_t (*file_write) (MI_INFO *, const uchar *, size_t, my_off_t, myf); - invalidator_by_filename invalidator; /* query cache invalidator */ + /* query cache invalidator for merged tables */ + invalidator_by_filename invalidator; + /* query cache invalidator for changing state */ + invalidator_by_filename chst_invalidator; ulong this_process; /* processid */ ulong last_process; /* For table-change-check */ ulong last_version; /* Version on start */