1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
BitKeeper/etc/logging_ok:
  auto-union
acinclude.m4:
  Auto merged
mysql-test/r/null_key.result:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/udf_example.cc:
  Auto merged
This commit is contained in:
unknown
2001-09-28 06:28:04 +02:00
12 changed files with 78 additions and 35 deletions

View File

@ -2332,7 +2332,20 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
JOIN_TAB *tab=join->join_tab+i;
table_map current_map= tab->table->map;
bool use_quick_range=0;
used_tables|=current_map;
if (tab->type == JT_REF && tab->quick &&
tab->ref.key_length < tab->quick->max_used_key_length)
{
/* Range uses longer key; Use this instead of ref on key */
tab->type=JT_ALL;
use_quick_range=1;
tab->use_quick=1;
tab->ref.key_parts=0; // Don't use ref key.
join->best_positions[i].records_read=tab->quick->records;
}
COND *tmp=make_cond_for_table(cond,used_tables,current_map);
if (!tmp && tab->quick)
{ // Outer join
@ -2375,7 +2388,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
if (tab->const_keys && tab->table->reginfo.impossible_range)
DBUG_RETURN(1);
}
else if (tab->type == JT_ALL)
else if (tab->type == JT_ALL && ! use_quick_range)
{
if (tab->const_keys &&
tab->table->reginfo.impossible_range)
@ -2434,15 +2447,6 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
}
}
if (tab->type == JT_REF && sel->quick &&
tab->ref.key_length < sel->quick->max_used_key_length)
{
/* Range uses longer key; Use this instead of ref on key */
tab->type=JT_ALL;
tab->use_quick=1;
tab->ref.key_parts=0; // Don't use ref key.
join->best_positions[i].records_read=sel->quick->records;
}
}
}
}