1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Merge bk-internal.mysql.com:/home/bk/mysql-5.0

into  mysql.com:/home/my/mysql-5.0


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
Makefile.am:
  Auto merged
client/mysql.cc:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
configure.in:
  Auto merged
extra/yassl/include/buffer.hpp:
  Auto merged
extra/yassl/include/crypto_wrapper.hpp:
  Auto merged
extra/yassl/include/yassl_imp.hpp:
  Auto merged
extra/yassl/include/yassl_int.hpp:
  Auto merged
extra/yassl/src/crypto_wrapper.cpp:
  Auto merged
extra/yassl/taocrypt/include/algebra.hpp:
  Auto merged
extra/yassl/taocrypt/include/des.hpp:
  Auto merged
extra/yassl/taocrypt/include/hash.hpp:
  Auto merged
extra/yassl/taocrypt/include/hmac.hpp:
  Auto merged
extra/yassl/taocrypt/include/modarith.hpp:
  Auto merged
extra/yassl/taocrypt/include/modes.hpp:
  Auto merged
extra/yassl/taocrypt/include/rsa.hpp:
  Auto merged
extra/yassl/taocrypt/include/type_traits.hpp:
  Auto merged
extra/yassl/taocrypt/mySTL/list.hpp:
  Auto merged
extra/yassl/taocrypt/src/aes.cpp:
  Auto merged
extra/yassl/taocrypt/src/algebra.cpp:
  Auto merged
extra/yassl/testsuite/testsuite.cpp:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysys/default.c:
  Auto merged
ndb/src/common/transporter/Transporter.cpp:
  Auto merged
ndb/src/common/util/File.cpp:
  Auto merged
ndb/src/common/util/SocketClient.cpp:
  Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
  Auto merged
ndb/src/ndbapi/Ndb.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
extra/yassl/taocrypt/src/asn.cpp:
  Manual merge (Fix shadowed variable name)
extra/yassl/taocrypt/test/test.cpp:
  No changes
ndb/src/common/util/ConfigValues.cpp:
  Manual merge (Fix shadowed variable name)
sql/field.h:
  manual merge
sql/ha_myisam.cc:
  manual merge
sql/ha_ndbcluster.cc:
  manual merge
sql/item_cmpfunc.cc:
  manual merge
sql/item_subselect.cc:
  Manual merge (Fix shadowed variable name)
sql/mysqld.cc:
  no changes
This commit is contained in:
unknown
2007-02-21 14:07:08 +02:00
240 changed files with 3426 additions and 3185 deletions

View File

@@ -109,7 +109,6 @@ static uint build_bitmap_for_nested_joins(List<TABLE_LIST> *join_list,
static COND *optimize_cond(JOIN *join, COND *conds,
List<TABLE_LIST> *join_list,
Item::cond_result *cond_value);
static bool resolve_nested_join (TABLE_LIST *table);
static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool open_tmp_table(TABLE *table);
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
@@ -2463,14 +2462,14 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
for( ; sargables->field ; sargables++)
{
Field *field= sargables->field;
JOIN_TAB *stat= field->table->reginfo.join_tab;
JOIN_TAB *join_tab= field->table->reginfo.join_tab;
key_map possible_keys= field->key_start;
possible_keys.intersect(field->table->keys_in_use_for_query);
bool is_const= 1;
for (uint i=0; i< sargables->num_values; i++)
is_const&= sargables->arg_value[i]->const_item();
for (uint j=0; j < sargables->num_values; j++)
is_const&= sargables->arg_value[j]->const_item();
if (is_const)
stat[0].const_keys.merge(possible_keys);
join_tab[0].const_keys.merge(possible_keys);
}
}
@@ -3463,16 +3462,16 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
*/
if (keyuse->elements)
{
KEYUSE end,*prev,*save_pos,*use;
KEYUSE key_end,*prev,*save_pos,*use;
qsort(keyuse->buffer,keyuse->elements,sizeof(KEYUSE),
(qsort_cmp) sort_keyuse);
bzero((char*) &end,sizeof(end)); /* Add for easy testing */
VOID(insert_dynamic(keyuse,(gptr) &end));
bzero((char*) &key_end,sizeof(key_end)); /* Add for easy testing */
VOID(insert_dynamic(keyuse,(gptr) &key_end));
use=save_pos=dynamic_element(keyuse,0,KEYUSE*);
prev=&end;
prev= &key_end;
found_eq_constant=0;
for (i=0 ; i < keyuse->elements-1 ; i++,use++)
{
@@ -3500,7 +3499,7 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
save_pos++;
}
i=(uint) (save_pos-(KEYUSE*) keyuse->buffer);
VOID(set_dynamic(keyuse,(gptr) &end,i));
VOID(set_dynamic(keyuse,(gptr) &key_end,i));
keyuse->elements=i;
}
return FALSE;
@@ -3682,7 +3681,6 @@ best_access_path(JOIN *join,
double records= DBL_MAX;
double tmp;
ha_rows rec;
DBUG_ENTER("best_access_path");
if (s->keyuse)
@@ -3722,12 +3720,12 @@ best_access_path(JOIN *join,
found_part|= keyuse->keypart_map;
if (!(keyuse->used_tables & ~join->const_table_map))
const_part|= keyuse->keypart_map;
double tmp= prev_record_reads(join, (found_ref |
double tmp2= prev_record_reads(join, (found_ref |
keyuse->used_tables));
if (tmp < best_prev_record_reads)
if (tmp2 < best_prev_record_reads)
{
best_part_found_ref= keyuse->used_tables & ~join->const_table_map;
best_prev_record_reads= tmp;
best_prev_record_reads= tmp2;
}
if (rec > keyuse->ref_table_rows)
rec= keyuse->ref_table_rows;
@@ -5778,37 +5776,42 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
*/
COND *on_expr= *first_inner_tab->on_expr_ref;
table_map used_tables= join->const_table_map |
OUTER_REF_TABLE_BIT | RAND_TABLE_BIT;
table_map used_tables2= (join->const_table_map |
OUTER_REF_TABLE_BIT | RAND_TABLE_BIT);
for (tab= join->join_tab+join->const_tables; tab <= last_tab ; tab++)
{
current_map= tab->table->map;
used_tables|= current_map;
COND *tmp= make_cond_for_table(on_expr, used_tables, current_map);
if (tmp)
used_tables2|= current_map;
COND *tmp_cond= make_cond_for_table(on_expr, used_tables2,
current_map);
if (tmp_cond)
{
JOIN_TAB *cond_tab= tab < first_inner_tab ? first_inner_tab : tab;
/*
First add the guards for match variables of
all embedding outer join operations.
*/
if (!(tmp= add_found_match_trig_cond(cond_tab->first_inner,
tmp, first_inner_tab)))
if (!(tmp_cond= add_found_match_trig_cond(cond_tab->first_inner,
tmp_cond,
first_inner_tab)))
DBUG_RETURN(1);
/*
Now add the guard turning the predicate off for
the null complemented row.
*/
DBUG_PRINT("info", ("Item_func_trig_cond"));
tmp= new Item_func_trig_cond(tmp,
&first_inner_tab->not_null_compl);
DBUG_PRINT("info", ("Item_func_trig_cond 0x%lx", (ulong) tmp));
if (tmp)
tmp->quick_fix_field();
tmp_cond= new Item_func_trig_cond(tmp_cond,
&first_inner_tab->
not_null_compl);
DBUG_PRINT("info", ("Item_func_trig_cond 0x%lx",
(ulong) tmp_cond));
if (tmp_cond)
tmp_cond->quick_fix_field();
/* Add the predicate to other pushed down predicates */
DBUG_PRINT("info", ("Item_cond_and"));
cond_tab->select_cond= !cond_tab->select_cond ? tmp :
new Item_cond_and(cond_tab->select_cond,tmp);
cond_tab->select_cond= !cond_tab->select_cond ? tmp_cond :
new Item_cond_and(cond_tab->select_cond,
tmp_cond);
DBUG_PRINT("info", ("Item_cond_and 0x%lx",
(ulong)cond_tab->select_cond));
if (!cond_tab->select_cond)
@@ -6125,7 +6128,7 @@ void JOIN_TAB::cleanup()
void JOIN::join_free()
{
SELECT_LEX_UNIT *unit;
SELECT_LEX_UNIT *tmp_unit;
SELECT_LEX *sl;
/*
Optimization: if not EXPLAIN and we are done with the JOIN,
@@ -6137,8 +6140,10 @@ void JOIN::join_free()
cleanup(full);
for (unit= select_lex->first_inner_unit(); unit; unit= unit->next_unit())
for (sl= unit->first_select(); sl; sl= sl->next_select())
for (tmp_unit= select_lex->first_inner_unit();
tmp_unit;
tmp_unit= tmp_unit->next_unit())
for (sl= tmp_unit->first_select(); sl; sl= sl->next_select())
{
Item_subselect *subselect= sl->master_unit()->item;
bool full_local= full && (!subselect || subselect->is_evaluated());
@@ -6776,9 +6781,9 @@ static bool check_simple_equality(Item *left_item, Item *right_item,
else
{
/* None of the fields was found in multiple equalities */
Item_equal *item= new Item_equal((Item_field *) left_item,
(Item_field *) right_item);
cond_equal->current_level.push_back(item);
Item_equal *item_equal= new Item_equal((Item_field *) left_item,
(Item_field *) right_item);
cond_equal->current_level.push_back(item_equal);
}
}
return TRUE;
@@ -6885,8 +6890,8 @@ static bool check_row_equality(Item *left_row, Item_row *right_row,
for (uint i= 0 ; i < n; i++)
{
bool is_converted;
Item *left_item= left_row->el(i);
Item *right_item= right_row->el(i);
Item *left_item= left_row->element_index(i);
Item *right_item= right_row->element_index(i);
if (left_item->type() == Item::ROW_ITEM &&
right_item->type() == Item::ROW_ITEM)
is_converted= check_row_equality((Item_row *) left_item,
@@ -7276,14 +7281,15 @@ static COND *build_equal_items(THD *thd, COND *cond,
{
if (table->on_expr)
{
List<TABLE_LIST> *join_list= table->nested_join ?
&table->nested_join->join_list : NULL;
List<TABLE_LIST> *nested_join_list= table->nested_join ?
&table->nested_join->join_list : NULL;
/*
We can modify table->on_expr because its old value will
be restored before re-execution of PS/SP.
*/
table->on_expr= build_equal_items(thd, table->on_expr, inherited,
join_list, &table->cond_equal);
nested_join_list,
&table->cond_equal);
}
}
}
@@ -7640,7 +7646,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
value->result_type() != STRING_RESULT ||
left_item->collation.collation == value->collation.collation))
{
Item *tmp=value->new_item();
Item *tmp=value->clone_item();
tmp->collation.set(right_item->collation);
if (tmp)
@@ -7664,7 +7670,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
value->result_type() != STRING_RESULT ||
right_item->collation.collation == value->collation.collation))
{
Item *tmp=value->new_item();
Item *tmp= value->clone_item();
tmp->collation.set(left_item->collation);
if (tmp)
@@ -8285,7 +8291,6 @@ optimize_cond(JOIN *join, COND *conds, List<TABLE_LIST> *join_list,
Item::cond_result *cond_value)
{
THD *thd= join->thd;
SELECT_LEX *select= thd->lex->current_select;
DBUG_ENTER("optimize_cond");
if (!conds)
@@ -14608,7 +14613,7 @@ int JOIN::rollup_send_data(uint idx)
1 if write_data_failed()
*/
int JOIN::rollup_write_data(uint idx, TABLE *table)
int JOIN::rollup_write_data(uint idx, TABLE *table_arg)
{
uint i;
for (i= send_group_parts ; i-- > idx ; )
@@ -14619,7 +14624,7 @@ int JOIN::rollup_write_data(uint idx, TABLE *table)
ref_pointer_array_size);
if ((!having || having->val_int()))
{
int error;
int write_error;
Item *item;
List_iterator_fast<Item> it(rollup.fields[i]);
while ((item= it++))
@@ -14628,10 +14633,10 @@ int JOIN::rollup_write_data(uint idx, TABLE *table)
item->save_in_result_field(1);
}
copy_sum_funcs(sum_funcs_end[i+1], sum_funcs_end[i]);
if ((error= table->file->write_row(table->record[0])))
if ((write_error= table_arg->file->write_row(table_arg->record[0])))
{
if (create_myisam_from_heap(thd, table, &tmp_table_param,
error, 0))
if (create_myisam_from_heap(thd, table_arg, &tmp_table_param,
write_error, 0))
return 1;
}
}
@@ -14812,9 +14817,9 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
}
else
{
TABLE_LIST *tab=table->pos_in_table_list;
item_list.push_back(new Item_string(tab->alias,
strlen(tab->alias),
TABLE_LIST *real_table= table->pos_in_table_list;
item_list.push_back(new Item_string(real_table->alias,
strlen(real_table->alias),
cs));
}
/* type */