summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-08-28 13:51:01 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-08-28 13:51:01 +0400
commitda3a1c815689d81bd0ef720202536d7180825435 (patch)
tree1a0a2787335e4640247b2ec245a8935037e54bea /sql/sql_join_cache.cc
parente988c4dde6c1b88523b1d4e748cbd4f5025b128d (diff)
downloadmariadb-git-da3a1c815689d81bd0ef720202536d7180825435.tar.gz
Fix bugs in BatchedKeyAccess that show up when working with a
storage engine in HA_MRR_NO_ASSOCIATION mode. (there is no testcase because we don't ship any such engines currently)
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index d49be2e446c..5c803f85c49 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -3875,8 +3875,9 @@ 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
*/
- DBUG_ASSERT(cache->buff <= (uchar *) (*ptr) &&
- (uchar *) (*ptr) <= cache->end_pos);
+ DBUG_ASSERT((!(mrr_mode & HA_MRR_NO_ASSOCIATION))?
+ (cache->buff <= (uchar *) (*ptr) &&
+ (uchar *) (*ptr) <= cache->end_pos): TRUE);
if (join_tab->table->vfield)
update_virtual_fields(join->thd, join_tab->table);
}
@@ -4542,7 +4543,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()))
return 1;
last_matching_rec_ref_ptr= get_next_rec_ref(curr_matching_chain);
return 0;