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:
  added mysql-test/mysql-test-run-shell
client/mysql.cc:
  Auto merged
client/mysql_upgrade.c:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
client/sql_string.cc:
  Auto merged
client/sql_string.h:
  Auto merged
extra/my_print_defaults.c:
  Auto merged
include/m_ctype.h:
  Auto merged
include/my_pthread.h:
  Auto merged
include/my_sys.h:
  Auto merged
include/my_time.h:
  Auto merged
include/mysql.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
myisam/mi_search.c:
  Auto merged
myisam/mi_unique.c:
  Auto merged
myisam/myisampack.c:
  Auto merged
myisam/rt_index.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysys/default.c:
  Auto merged
mysys/mf_iocache2.c:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
mysys/my_bitmap.c:
  Auto merged
mysys/sha1.c:
  Auto merged
ndb/include/kernel/signaldata/ArbitSignalData.hpp:
  Auto merged
ndb/include/kernel/signaldata/DictTabInfo.hpp:
  Auto merged
ndb/include/ndbapi/NdbReceiver.hpp:
  Auto merged
ndb/include/transporter/TransporterDefinitions.hpp:
  Auto merged
ndb/include/util/InputStream.hpp:
  Auto merged
ndb/include/util/OutputStream.hpp:
  Auto merged
ndb/include/util/SimpleProperties.hpp:
  Auto merged
ndb/include/util/SocketAuthenticator.hpp:
  Auto merged
ndb/include/util/SocketServer.hpp:
  Auto merged
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  Auto merged
ndb/src/common/portlib/NdbTick.c:
  Auto merged
ndb/src/common/transporter/SHM_Transporter.cpp:
  Auto merged
ndb/src/common/transporter/TCP_Transporter.cpp:
  Auto merged
ndb/src/common/transporter/TCP_Transporter.hpp:
  Auto merged
ndb/src/common/transporter/Transporter.cpp:
  Auto merged
ndb/src/common/transporter/TransporterRegistry.cpp:
  Auto merged
ndb/src/common/util/Bitmask.cpp:
  Auto merged
ndb/src/common/util/ConfigValues.cpp:
  Auto merged
ndb/src/common/util/File.cpp:
  Auto merged
ndb/src/common/util/Properties.cpp:
  Auto merged
ndb/src/common/util/SocketClient.cpp:
  Auto merged
ndb/src/common/util/random.c:
  Auto merged
ndb/src/common/util/socket_io.cpp:
  Auto merged
ndb/src/cw/cpcd/APIService.cpp:
  Auto merged
ndb/src/cw/cpcd/main.cpp:
  Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Auto merged
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
  Auto merged
ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  Auto merged
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Auto merged
ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxNode.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp:
  Auto merged
ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp:
  Auto merged
ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp:
  Auto merged
ndb/src/kernel/blocks/ndbfs/AsyncFile.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/kernel/blocks/suma/Suma.cpp:
  Auto merged
ndb/src/kernel/blocks/suma/Suma.hpp:
  Auto merged
ndb/src/kernel/vm/MetaData.hpp:
  Auto merged
ndb/src/mgmapi/LocalConfig.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/ConfigInfo.hpp:
  Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
ndb/src/mgmsrv/Services.cpp:
  Auto merged
ndb/src/mgmsrv/main.cpp:
  Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
  Auto merged
ndb/src/ndbapi/Ndb.cpp:
  Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
ndb/src/ndbapi/NdbIndexOperation.cpp:
  Auto merged
ndb/src/ndbapi/NdbOperationDefine.cpp:
  Auto merged
ndb/src/ndbapi/NdbOperationExec.cpp:
  Auto merged
ndb/src/ndbapi/NdbOperationSearch.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanFilter.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
ndb/src/ndbapi/ndb_cluster_connection.cpp:
  Auto merged
ndb/tools/delete_all.cpp:
  Auto merged
ndb/tools/desc.cpp:
  Auto merged
ndb/tools/drop_index.cpp:
  Auto merged
ndb/tools/drop_tab.cpp:
  Auto merged
ndb/tools/listTables.cpp:
  Auto merged
ndb/tools/ndb_config.cpp:
  Auto merged
ndb/tools/restore/Restore.hpp:
  Auto merged
ndb/tools/restore/consumer.hpp:
  Auto merged
ndb/tools/restore/restore_main.cpp:
  Auto merged
ndb/tools/select_all.cpp:
  Auto merged
ndb/tools/select_count.cpp:
  Auto merged
server-tools/instance-manager/commands.h:
  Auto merged
server-tools/instance-manager/guardian.cc:
  Auto merged
server-tools/instance-manager/instance_options.cc:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
server-tools/instance-manager/options.cc:
  Auto merged
server-tools/instance-manager/options.h:
  Auto merged
server-tools/instance-manager/parse.cc:
  Auto merged
server-tools/instance-manager/user_map.cc:
  Auto merged
server-tools/instance-manager/user_map.h:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_archive.cc:
  Auto merged
sql/ha_archive.h:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  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_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_row.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/password.c:
  Auto merged
sql/protocol.cc:
  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/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/spatial.cc:
  Auto merged
sql/spatial.h:
  Auto merged
sql/sql_cache.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_derived.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_string.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_trigger.h:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
strings/ctype-bin.c:
  Auto merged
strings/ctype-cp932.c:
  Auto merged
strings/ctype-eucjpms.c:
  Auto merged
strings/ctype-mb.c:
  Auto merged
strings/ctype-simple.c:
  Auto merged
strings/ctype-sjis.c:
  Auto merged
strings/ctype-uca.c:
  Auto merged
strings/ctype-ujis.c:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
strings/decimal.c:
  Auto merged
strings/my_vsnprintf.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Manual merge
sql/sql_class.h:
  Manual merge
sql/sql_parse.cc:
  Manual merge
This commit is contained in:
unknown
2007-01-22 14:04:40 +02:00
229 changed files with 3267 additions and 3076 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,
@@ -2429,14 +2428,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);
}
}
@@ -3430,16 +3429,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++)
{
@@ -3467,7 +3466,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;
@@ -3649,7 +3648,6 @@ best_access_path(JOIN *join,
double records= DBL_MAX;
double tmp;
ha_rows rec;
DBUG_ENTER("best_access_path");
if (s->keyuse)
@@ -3689,12 +3687,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;
@@ -5741,37 +5739,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)
@@ -6088,7 +6091,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,
@@ -6100,8 +6103,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());
@@ -6737,9 +6742,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;
@@ -6846,8 +6851,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,
@@ -7237,14 +7242,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);
}
}
}
@@ -7601,7 +7607,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)
@@ -7625,7 +7631,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)
@@ -8246,7 +8252,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)
@@ -14524,7 +14529,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 ; )
@@ -14535,7 +14540,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++))
@@ -14544,10 +14549,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;
}
}
@@ -14728,9 +14733,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 */