1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

merge with mysql-5.1.63

This commit is contained in:
Sergei Golubchik
2012-05-17 12:12:33 +02:00
102 changed files with 2496 additions and 316 deletions

View File

@ -5859,6 +5859,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
}
keyuse++;
} while (keyuse->table == table && keyuse->key == key);
DBUG_ASSERT(length > 0 && keyparts != 0);
} /* not ftkey */
/* set up fieldref */
@ -8631,10 +8632,10 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
left_item->collation.collation == value->collation.collation))
{
Item *tmp=value->clone_item();
tmp->collation.set(right_item->collation);
if (tmp)
{
tmp->collation.set(right_item->collation);
thd->change_item_tree(args + 1, tmp);
func->update_used_tables();
if ((functype == Item_func::EQ_FUNC || functype == Item_func::EQUAL_FUNC)
@ -8655,10 +8656,10 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
right_item->collation.collation == value->collation.collation))
{
Item *tmp= value->clone_item();
tmp->collation.set(left_item->collation);
if (tmp)
{
tmp->collation.set(left_item->collation);
thd->change_item_tree(args, tmp);
value= tmp;
func->update_used_tables();
@ -13763,6 +13764,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
DBUG_ENTER("test_if_skip_sort_order");
LINT_INIT(ref_key_parts);
/* Check that we are always called with first non-const table */
DBUG_ASSERT(tab == tab->join->join_tab + tab->join->const_tables);
/*
Keys disabled by ALTER TABLE ... DISABLE KEYS should have already
been taken into account.
@ -13844,7 +13848,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
while (keyuse->key != new_ref_key && keyuse->table == tab->table)
keyuse++;
if (create_ref_for_key(tab->join, tab, keyuse,
tab->join->const_table_map))
(tab->join->const_table_map |
OUTER_REF_TABLE_BIT)))
DBUG_RETURN(0);
pick_table_access_method(tab);