1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug #46159: simple query that never returns

The external 'for' loop in remove_dup_with_compare() handled 
HA_ERR_RECORD_DELETED by just starting over without advancing 
to the next record which caused an infinite loop. 
 
This condition could be triggered on certain data by a SELECT 
query containing DISTINCT, GROUP BY and HAVING clauses. 

Fixed remove_dup_with_compare() so that we always advance to 
the next record when receiving HA_ERR_RECORD_DELETED from 
rnd_next().
This commit is contained in:
Alexey Kopytov
2009-09-06 00:42:17 +04:00
parent c21fbff338
commit f161723821
3 changed files with 74 additions and 1 deletions

View File

@ -13665,7 +13665,10 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
if (error)
{
if (error == HA_ERR_RECORD_DELETED)
continue;
{
error= file->rnd_next(record);
continue;
}
if (error == HA_ERR_END_OF_FILE)
break;
goto err;