mirror of
https://github.com/MariaDB/server.git
synced 2025-07-10 04:22:00 +03:00
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union configure.in: Auto merged include/config-win.h: Auto merged include/my_global.h: Auto merged mysql-test/r/drop.result: Auto merged mysys/default.c: Auto merged mysys/mf_keycache.c: Auto merged sql/field.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysqld.cc: Auto merged BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e: Auto merged mysql-test/r/cast.result: Merge mysql-test/t/cast.test: Merge sql/sql_insert.cc: Merge sql/sql_select.cc: Merge
This commit is contained in:
@ -2492,8 +2492,8 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
|
||||
KEY_OPTIMIZE_EXISTS) |
|
||||
((old->optimize | new_fields->optimize) &
|
||||
KEY_OPTIMIZE_REF_OR_NULL));
|
||||
old->null_rejecting= old->null_rejecting &&
|
||||
new_fields->null_rejecting;
|
||||
old->null_rejecting= (old->null_rejecting &&
|
||||
new_fields->null_rejecting);
|
||||
}
|
||||
}
|
||||
else if (old->eq_func && new_fields->eq_func &&
|
||||
@ -2505,8 +2505,8 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
|
||||
KEY_OPTIMIZE_EXISTS) |
|
||||
((old->optimize | new_fields->optimize) &
|
||||
KEY_OPTIMIZE_REF_OR_NULL));
|
||||
old->null_rejecting= old->null_rejecting &&
|
||||
new_fields->null_rejecting;
|
||||
old->null_rejecting= (old->null_rejecting &&
|
||||
new_fields->null_rejecting);
|
||||
}
|
||||
else if (old->eq_func && new_fields->eq_func &&
|
||||
(old->val->is_null() || new_fields->val->is_null()))
|
||||
@ -2518,7 +2518,7 @@ merge_key_fields(KEY_FIELD *start,KEY_FIELD *new_fields,KEY_FIELD *end,
|
||||
if (old->val->is_null())
|
||||
old->val= new_fields->val;
|
||||
/* The referred expression can be NULL: */
|
||||
old->null_rejecting= false;
|
||||
old->null_rejecting= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2680,6 +2680,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
|
||||
If the condition has form "tbl.keypart = othertbl.field" and
|
||||
othertbl.field can be NULL, there will be no matches if othertbl.field
|
||||
has NULL value.
|
||||
We use null_rejecting in add_not_null_conds() to add
|
||||
'othertbl.field IS NOT NULL' to tab->select_cond.
|
||||
*/
|
||||
(*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC) &&
|
||||
((*value)->type() == Item::FIELD_ITEM) &&
|
||||
|
Reference in New Issue
Block a user