From 8eb16159e19b38e67728fca7c7f316f921a2c7e0 Mon Sep 17 00:00:00 2001 From: Sergey Petrunya Date: Mon, 27 Aug 2012 08:44:58 +0400 Subject: Cassandra storage engine: BKA support - We use HA_MRR_NO_ASSOC ("optimizer_switch=join_cache_hashed") mode - Not able to use BKA's buffers yet. - There is a variable to control batch size - There are status counters. - Nedeed to make some fixes in BKA code (to be checked with Igor) --- sql/sql_join_cache.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/sql_join_cache.cc') diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index f953cf4df57..d785366ae69 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -3876,8 +3876,11 @@ int JOIN_TAB_SCAN_MRR::next() If a record in in an incremental cache contains no fields then the association for the last record in cache will be equal to cache->end_pos */ + /* + psergey: this makes no sense where HA_MRR_NO_ASSOC is used. DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) && (uchar *) (*ptr) <= cache->end_pos); + */ if (join_tab->table->vfield) update_virtual_fields(join->thd, join_tab->table); } @@ -4543,7 +4546,7 @@ bool JOIN_CACHE_BKAH::prepare_look_for_matches(bool skip_last) { last_matching_rec_ref_ptr= next_matching_rec_ref_ptr= 0; if (no_association && - (curr_matching_chain= get_matching_chain_by_join_key())) + !(curr_matching_chain= get_matching_chain_by_join_key())) //psergey: added '!' return 1; last_matching_rec_ref_ptr= get_next_rec_ref(curr_matching_chain); return 0; -- cgit v1.2.1 From 40ae63dd65fb9e812f29d3520acb0ba6b64d3005 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Dec 2012 20:57:54 +0200 Subject: backport to 5.5 dyncol changes and names support --- sql/sql_join_cache.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_join_cache.cc') diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index d785366ae69..14d4d5fca6c 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -3872,10 +3872,10 @@ int JOIN_TAB_SCAN_MRR::next() int rc= join_tab->table->file->multi_range_read_next((range_id_t*)ptr) ? -1 : 0; if (!rc) { - /* + /* If a record in in an incremental cache contains no fields then the association for the last record in cache will be equal to cache->end_pos - */ + */ /* psergey: this makes no sense where HA_MRR_NO_ASSOC is used. DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) && -- cgit v1.2.1