mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into mysql.com:/d2/hf/mrg/mysql-5.1-opt mysql-test/r/alter_table.result: Auto merged mysql-test/r/distinct.result: Auto merged mysql-test/r/heap.result: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged mysql-test/r/query_cache.result: Auto merged BitKeeper/deleted/.del-CMakeLists.txt~1: Auto merged BitKeeper/deleted/.del-ps_6bdb.result: Auto merged mysql-test/t/alter_table.test: Auto merged mysys/my_error.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_sum.cc: Auto merged sql/key.cc: Auto merged sql/sql_select.cc: Auto merged sql/table.cc: Auto merged tests/mysql_client_test.c: Auto merged mysql-test/include/mix1.inc: merging mysql-test/r/group_by.result: SCCS merged mysql-test/r/innodb_mysql.result: merging mysql-test/r/join.result: merging mysql-test/r/subselect.result: merging mysql-test/r/type_datetime.result: SCCS merged mysql-test/r/windows.result: SCCS merged mysql-test/t/group_by.test: SCCS merged mysql-test/t/join.test: merging mysql-test/t/subselect.test: merging mysql-test/t/type_datetime.test: merging mysql-test/t/windows.test: SCCS merged sql/item_timefunc.cc: merging sql/sql_base.cc: SCCS merged storage/innobase/handler/ha_innodb.cc: merging
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