1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

A fix for the bug in a SELECT with joined tables with ORDER BY and

LIMIT clause when filesort had to be used.

In that case LIMIT was applied to filesort of one of the tables, 
although it could not be.

This fix solved problems with LEFT JOIN too...
This commit is contained in:
Sinisa@sinisa.nasamreza.org
2002-12-04 15:27:08 +02:00
parent ad2be3b2b2
commit dd2012067e
3 changed files with 27 additions and 2 deletions

View File

@@ -923,7 +923,13 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
JOIN_TAB *end_table= &join.join_tab[join.tables];
for (; table < end_table ; table++)
{
if (table->select_cond)
/*
table->keyuse is set in the case there was an original WHERE clause
on the table that was optimized away.
table->on_expr tells us that it was a LEFT JOIN and there will be
at least one row generated from the table.
*/
if (table->select_cond || (table->keyuse && !table->on_expr))
{
/* We have to sort all rows */
select_limit= HA_POS_ERROR;