mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into mysql.com:/d2/hf/mrg/mysql-5.1-opt
This commit is contained in:
@ -5615,8 +5615,9 @@ static void add_not_null_conds(JOIN *join)
|
||||
for (uint i=join->const_tables ; i < join->tables ; i++)
|
||||
{
|
||||
JOIN_TAB *tab=join->join_tab+i;
|
||||
if ((tab->type == JT_REF || tab->type == JT_REF_OR_NULL) &&
|
||||
!tab->table->maybe_null)
|
||||
if ((tab->type == JT_REF || tab->type == JT_EQ_REF ||
|
||||
tab->type == JT_REF_OR_NULL) &&
|
||||
!tab->table->maybe_null)
|
||||
{
|
||||
for (uint keypart= 0; keypart < tab->ref.key_parts; keypart++)
|
||||
{
|
||||
@ -8857,17 +8858,13 @@ static bool
|
||||
test_if_equality_guarantees_uniqueness(Item *l, Item *r)
|
||||
{
|
||||
return r->const_item() &&
|
||||
/* elements must be of the same result type */
|
||||
(r->result_type() == l->result_type() ||
|
||||
/* or dates compared to longs */
|
||||
(((l->type() == Item::FIELD_ITEM &&
|
||||
((Item_field *)l)->field->can_be_compared_as_longlong()) ||
|
||||
(l->type() == Item::FUNC_ITEM &&
|
||||
((Item_func *)l)->result_as_longlong())) &&
|
||||
r->result_type() == INT_RESULT))
|
||||
/* and must have the same collation if compared as strings */
|
||||
&& (l->result_type() != STRING_RESULT ||
|
||||
l->collation.collation == r->collation.collation);
|
||||
/* elements must be compared as dates */
|
||||
(Arg_comparator::can_compare_as_dates(l, r, 0) ||
|
||||
/* or of the same result type */
|
||||
(r->result_type() == l->result_type() &&
|
||||
/* and must have the same collation if compared as strings */
|
||||
(l->result_type() != STRING_RESULT ||
|
||||
l->collation.collation == r->collation.collation)));
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user