1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Ported the fix for LP bug #702310 / bug #59493.

An assertion failure was triggered for a 6-way join query that used two
join buffers.
The failure happened because every call of JOIN_CACHE::join_matching_records
saved and restored status of all tables that were accessed before the table
join_tab. It must do it only for those of them that follow the last table 
using a join buffer.
This commit is contained in:
Igor Babaev
2011-01-14 22:55:56 -08:00
parent cb4fa7f401
commit 0aebdc115f
5 changed files with 276 additions and 3 deletions

View File

@@ -3171,7 +3171,8 @@ uint JOIN_CACHE_HASHED::get_next_key(uchar ** key)
int JOIN_TAB_SCAN::open()
{
for (JOIN_TAB *tab= join->join_tab; tab != join_tab ; tab++)
JOIN_TAB *bound= join_tab-cache->tables;
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
{
tab->status= tab->table->status;
tab->table->status= 0;
@@ -3246,7 +3247,8 @@ int JOIN_TAB_SCAN::next()
void JOIN_TAB_SCAN::close()
{
for (JOIN_TAB *tab= join->join_tab; tab != join_tab ; tab++)
JOIN_TAB *bound= join_tab-cache->tables;
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
tab->table->status= tab->status;
}
@@ -3647,7 +3649,8 @@ int JOIN_TAB_SCAN_MRR::open()
/* Dynamic range access is never used with BKA */
DBUG_ASSERT(join_tab->use_quick != 2);
for (JOIN_TAB *tab =join->join_tab; tab != join_tab ; tab++)
JOIN_TAB *bound= join_tab-cache->tables;
for (JOIN_TAB *tab= join_tab-1; tab != bound && !tab->cache; tab--)
{
tab->status= tab->table->status;
tab->table->status= 0;