summaryrefslogtreecommitdiff
path: root/sql/sql_join_cache.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2010-07-01 22:13:19 -0700
committerIgor Babaev <igor@askmonty.org>2010-07-01 22:13:19 -0700
commit0d734037ccabdb612e358db3fc91c7aaebf1c5ea (patch)
tree857364575cfa9ffb4d5332d2dfae6e19ce667a13 /sql/sql_join_cache.cc
parent16053e66b6daaf0b7902003ffab80c9ba51a2ffe (diff)
downloadmariadb-git-0d734037ccabdb612e358db3fc91c7aaebf1c5ea.tar.gz
Added missing calls of update_virtual_fields() in the
join cache module. Without these calls SELECTs over tables with virtual columns that used join cache could return wrong results. This could be seen with the test case added into vcol_misc.test
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r--sql/sql_join_cache.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc
index 321297c2b49..e9923c3c983 100644
--- a/sql/sql_join_cache.cc
+++ b/sql/sql_join_cache.cc
@@ -1799,11 +1799,8 @@ enum_nested_loop_state JOIN_CACHE_BNL::join_matching_records(bool skip_last)
}
int err= 0;
- /*
- psergey3-merge: should we have this here by any chance:
if (rc == NESTED_LOOP_OK)
- update_virtual_fields(join_tab->table);
- */
+ update_virtual_fields(join_tab->table);
/*
Do not look for matches if the last read record of the joined table
@@ -2324,6 +2321,7 @@ enum_nested_loop_state JOIN_CACHE_BKA::join_matching_records(bool skip_last)
(!check_only_first_match || !get_match_flag_by_pos(rec_ptr)))
{
get_record_by_pos(rec_ptr);
+ update_virtual_fields(join_tab->table);
rc= generate_full_extensions(rec_ptr);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
goto finish;
@@ -3211,6 +3209,7 @@ JOIN_CACHE_BKA_UNIQUE::join_matching_records(bool skip_last)
(!check_only_first_match || !get_match_flag_by_pos(rec_ptr)))
{
get_record_by_pos(rec_ptr);
+ update_virtual_fields(join_tab->table);
rc= generate_full_extensions(rec_ptr);
if (rc != NESTED_LOOP_OK && rc != NESTED_LOOP_NO_MORE_ROWS)
goto finish;