summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2002-06-10 13:34:41 +0300
committermonty@hundin.mysql.fi <>2002-06-10 13:34:41 +0300
commitdb41437a100e204e60f45d5c9a6b26f63e512659 (patch)
tree017d0c289d1d460f1bbfc14a30d2de90b4d2af7c /sql
parentc038efd877c8bda6667034c349b8b379cabe523b (diff)
parentad04b7f677ed11f08aae85d6a0a42f0c341e280a (diff)
downloadmariadb-git-db41437a100e204e60f45d5c9a6b26f63e512659.tar.gz
Merge work:/home/bk/mysql-4.0 into hundin.mysql.fi:/my/bk/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_select.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 7f194b85ab8..315211f63c5 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -4900,12 +4900,24 @@ end_send(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
JOIN_TAB *jt=join->join_tab;
if ((join->tables == 1) && !join->tmp_table && !join->sort_and_group
&& !join->send_group_parts && !join->having && !jt->select_cond &&
+ !(jt->select && jt->select->quick) &&
!(jt->table->file->table_flags() & HA_NOT_EXACT_COUNT))
{
/* Join over all rows in table; Return number of found rows */
+ TABLE *table=jt->table;
+
join->select_options ^= OPTION_FOUND_ROWS;
- jt->table->file->info(HA_STATUS_VARIABLE);
- join->send_records = jt->table->file->records;
+ if (table->record_pointers ||
+ (table->io_cache && my_b_inited(table->io_cache)))
+ {
+ /* Using filesort */
+ join->send_records= table->found_records;
+ }
+ else
+ {
+ table->file->info(HA_STATUS_VARIABLE);
+ join->send_records = table->file->records;
+ }
}
else
{