1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Manual merge

configure.in:
  Auto merged
mysql-test/r/null_key.result:
  Auto merged
mysql-test/t/null_key.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
This commit is contained in:
unknown
2005-07-28 21:28:20 -07:00
6 changed files with 181 additions and 11 deletions

View File

@ -2759,7 +2759,9 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
*/
(*key_fields)->null_rejecting= (cond->functype() == Item_func::EQ_FUNC) &&
((*value)->type() == Item::FIELD_ITEM) &&
((Item_field*)*value)->field->maybe_null();
(((Item_field*)*value)->field->maybe_null() ||
((Item_field *)*value)->field->table->maybe_null);
(*key_fields)++;
}
@ -8256,7 +8258,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
param->using_indirect_summary_function=1;
continue;
}
if (item->const_item() && (int) hidden_field_count <= 0)
if (item->const_item() && (int) hidden_field_count <= 0 &&
!param->need_const)
continue; // We don't have to store this
}
if (type == Item::SUM_FUNC_ITEM && !group && !save_sum_fields)
@ -9857,6 +9860,11 @@ join_read_always_key(JOIN_TAB *tab)
int error;
TABLE *table= tab->table;
for (uint i= 0 ; i < tab->ref.key_parts ; i++)
{
if ((tab->ref.null_rejecting & 1 << i) && tab->ref.items[i]->is_null())
return -1;
}
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key);
if (cp_buffer_from_ref(tab->join->thd, &tab->ref))