After merge fixes

Remove compiler warnings
This commit is contained in:
monty@mysql.com 2006-06-05 06:16:08 +03:00
parent c46fb742b8
commit 430347f126
15 changed files with 56 additions and 30 deletions

View File

@ -324,7 +324,7 @@ CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select *
ROLLBACK; ROLLBACK;
SELECT * from t2; SELECT * from t2;
DROP TABLE t1,t2; DROP TABLE t1,t2;
--replace_regex /table_id: [0-9]+/table_id: #/ --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102; show binlog events from 102;
# Test for BUG#16559 (ROLLBACK should always have a zero error code in # Test for BUG#16559 (ROLLBACK should always have a zero error code in

View File

@ -1,3 +1,4 @@
drop database if exists client_test_db;
DROP SCHEMA test; DROP SCHEMA test;
CREATE SCHEMA test; CREATE SCHEMA test;
cluster.binlog_index OK cluster.binlog_index OK

View File

@ -5,6 +5,10 @@
# depends on the presence of the log tables (which are CSV-based). # depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc --source include/have_csv.inc
--disable_warnings
drop database if exists client_test_db;
--enable_warnings
DROP SCHEMA test; DROP SCHEMA test;
CREATE SCHEMA test; CREATE SCHEMA test;
# #

View File

@ -610,7 +610,7 @@ drop database db1;
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
# #
--exec $MYSQL_MY_PRINT_DEFAULTS --defaults-extra-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump --exec $MYSQL_MY_PRINT_DEFAULTS --defaults-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
# #

View File

@ -873,13 +873,19 @@ Event_scheduler::drop_event(THD *thd, Event_timed *et)
*/ */
enum Event_scheduler::enum_error_code enum Event_scheduler::enum_error_code
Event_scheduler::replace_event(THD *thd, Event_timed *et, LEX_STRING *new_schema, Event_scheduler::replace_event(THD *thd, Event_timed *et,
LEX_STRING *new_schema,
LEX_STRING *new_name) LEX_STRING *new_name)
{ {
enum enum_error_code res; enum enum_error_code res;
Event_timed *et_old, *et_new= NULL; Event_timed *et_old, *et_new= NULL;
LEX_STRING old_schema, old_name; LEX_STRING old_schema, old_name;
LINT_INIT(old_schema.str);
LINT_INIT(old_schema.length);
LINT_INIT(old_name.str);
LINT_INIT(old_name.length);
DBUG_ENTER("Event_scheduler::replace_event"); DBUG_ENTER("Event_scheduler::replace_event");
DBUG_PRINT("enter", ("thd=%p et=%p et=[%s.%s] lock=%p", DBUG_PRINT("enter", ("thd=%p et=%p et=[%s.%s] lock=%p",
thd, et, et->dbname.str, et->name.str, &LOCK_scheduler_data)); thd, et, et->dbname.str, et->name.str, &LOCK_scheduler_data));

View File

@ -4146,7 +4146,8 @@ void ha_partition::info(uint flag)
ulonglong nb_reserved_values; ulonglong nb_reserved_values;
DBUG_PRINT("info", ("HA_STATUS_AUTO")); DBUG_PRINT("info", ("HA_STATUS_AUTO"));
/* we don't want to reserve any values, it's pure information */ /* we don't want to reserve any values, it's pure information */
get_auto_increment(0, 0, 0, &stats.auto_increment_value, &nb_reserved_values); get_auto_increment(0, 0, 0, &stats.auto_increment_value,
&nb_reserved_values);
release_auto_increment(); release_auto_increment();
} }
if (flag & HA_STATUS_VARIABLE) if (flag & HA_STATUS_VARIABLE)
@ -4188,7 +4189,7 @@ void ha_partition::info(uint flag)
stats.deleted+= file->stats.deleted; stats.deleted+= file->stats.deleted;
stats.data_file_length+= file->stats.data_file_length; stats.data_file_length+= file->stats.data_file_length;
stats.index_file_length+= file->stats.index_file_length; stats.index_file_length+= file->stats.index_file_length;
stats.delete_length+= file->delete_length; stats.delete_length+= file->stats.delete_length;
if (file->stats.check_time > stats.check_time) if (file->stats.check_time > stats.check_time)
stats.check_time= file->stats.check_time; stats.check_time= file->stats.check_time;
} }
@ -5282,7 +5283,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong *nb_reserved_values) ulonglong *nb_reserved_values)
{ {
ulonglong first_value_part, last_value_part, nb_reserved_values_part, ulonglong first_value_part, last_value_part, nb_reserved_values_part,
last_value; last_value= ~ (ulonglong) 0;
handler **pos, **end; handler **pos, **end;
DBUG_ENTER("ha_partition::get_auto_increment"); DBUG_ENTER("ha_partition::get_auto_increment");
@ -5308,8 +5309,9 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
{ {
*first_value= ~(ulonglong)(0); *first_value= ~(ulonglong)(0);
} }
*nb_reserved_values= (last_value == ULONGLONG_MAX) ? if (increment) // If not check for values
ULONGLONG_MAX : ((last_value - *first_value) / increment); *nb_reserved_values= (last_value == ULONGLONG_MAX) ?
ULONGLONG_MAX : ((last_value - *first_value) / increment);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -143,6 +143,7 @@ const char *ha_get_storage_engine(enum legacy_db_type db_type)
static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root) static handler *create_default(TABLE_SHARE *table, MEM_ROOT *mem_root)
{ {
handlerton *hton=ha_resolve_by_legacy_type(current_thd, DB_TYPE_DEFAULT);
return (hton && hton->create) ? hton->create(table, mem_root) : NULL; return (hton && hton->create) ? hton->create(table, mem_root) : NULL;
} }

View File

@ -7011,7 +7011,7 @@ static void mysql_init_variables(void)
character_set_filesystem_name= (char*) "binary"; character_set_filesystem_name= (char*) "binary";
/* Set default values for some option variables */ /* Set default values for some option variables */
default_storage_engine_str="MyISAM"; default_storage_engine_str= (char*) "MyISAM";
global_system_variables.table_type= &myisam_hton; global_system_variables.table_type= &myisam_hton;
global_system_variables.tx_isolation= ISO_REPEATABLE_READ; global_system_variables.tx_isolation= ISO_REPEATABLE_READ;
global_system_variables.select_limit= (ulonglong) HA_POS_ERROR; global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;

View File

@ -635,8 +635,8 @@ bool partition_info::check_list_constants()
&list_part_cmp); &list_part_cmp);
not_first= FALSE; not_first= FALSE;
i= prev_value= 0; //prev_value initialised to quiet compiler prev_value= 0; // prev_value initialised to quiet compiler
do for (i= 0; i < no_list_values ; i++)
{ {
curr_value= list_array[i].list_value; curr_value= list_array[i].list_value;
if (likely(!not_first || prev_value != curr_value)) if (likely(!not_first || prev_value != curr_value))
@ -649,7 +649,7 @@ bool partition_info::check_list_constants()
my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0)); my_error(ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR, MYF(0));
goto end; goto end;
} }
} while (++i < no_list_values); }
result= FALSE; result= FALSE;
end: end:
DBUG_RETURN(result); DBUG_RETURN(result);
@ -689,10 +689,10 @@ bool partition_info::check_partition_info(handlerton **eng_type,
DBUG_ENTER("partition_info::check_partition_info"); DBUG_ENTER("partition_info::check_partition_info");
if (part_type != HASH_PARTITION || !list_of_part_fields) if (part_type != HASH_PARTITION || !list_of_part_fields)
part_expr->walk(&Item::check_partition_func_processor, part_expr->walk(&Item::check_partition_func_processor, 0,
(byte*)(&part_expression_ok)); (byte*)(&part_expression_ok));
if (is_sub_partitioned() && !list_of_subpart_fields) if (is_sub_partitioned() && !list_of_subpart_fields)
subpart_expr->walk(&Item::check_partition_func_processor, subpart_expr->walk(&Item::check_partition_func_processor, 0,
(byte*)(&part_expression_ok)); (byte*)(&part_expression_ok));
if (!part_expression_ok) if (!part_expression_ok)
{ {

View File

@ -5433,27 +5433,27 @@ bool setup_tables_and_check_access(THD *thd,
Name_resolution_context *context, Name_resolution_context *context,
List<TABLE_LIST> *from_clause, List<TABLE_LIST> *from_clause,
TABLE_LIST *tables, TABLE_LIST *tables,
Item **conds, TABLE_LIST **leaves, TABLE_LIST **leaves,
bool select_insert, bool select_insert,
ulong want_access) ulong want_access)
{ {
TABLE_LIST *leaves_tmp = NULL; TABLE_LIST *leaves_tmp= NULL;
if (setup_tables (thd, context, from_clause, tables, conds, if (setup_tables(thd, context, from_clause, tables,
&leaves_tmp, select_insert)) &leaves_tmp, select_insert))
return TRUE; return TRUE;
if (leaves) *leaves= leaves_tmp;
*leaves = leaves_tmp;
for (; leaves_tmp; leaves_tmp= leaves_tmp->next_leaf) for (; leaves_tmp; leaves_tmp= leaves_tmp->next_leaf)
{
if (leaves_tmp->belong_to_view && if (leaves_tmp->belong_to_view &&
check_one_table_access(thd, want_access, leaves_tmp)) check_one_table_access(thd, want_access, leaves_tmp))
{ {
tables->hide_view_error(thd); tables->hide_view_error(thd);
return TRUE; return TRUE;
} }
}
return FALSE; return FALSE;
} }

View File

@ -2570,7 +2570,10 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
bool is_const=1; bool is_const=1;
for (uint i=0; i<num_values; i++) for (uint i=0; i<num_values; i++)
is_const&= value[i]->const_item(); {
if (!(is_const&= value[i]->const_item()))
break;
}
if (is_const) if (is_const)
stat[0].const_keys.merge(possible_keys); stat[0].const_keys.merge(possible_keys);
/* /*

View File

@ -3119,9 +3119,10 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
if (!(wild && wild[0] && if (!(wild && wild[0] &&
wild_case_compare(scs, plugin->name.str,wild))) wild_case_compare(scs, plugin->name.str,wild)))
{ {
LEX_STRING state[2]={{STRING_WITH_LEN("ENABLED")}, LEX_STRING state[2]= {{(char*) STRING_WITH_LEN("ENABLED")},
{STRING_WITH_LEN("DISABLED")}}; {(char*) STRING_WITH_LEN("DISABLED")}};
LEX_STRING yesno[2]={{STRING_WITH_LEN("NO")}, {STRING_WITH_LEN("YES")}}; LEX_STRING yesno[2]= {{(char*) STRING_WITH_LEN("NO")},
{(char*) STRING_WITH_LEN("YES")}};
LEX_STRING *tmp; LEX_STRING *tmp;
restore_record(table, s->default_values); restore_record(table, s->default_values);

View File

@ -6247,9 +6247,10 @@ copy_data_between_tables(TABLE *from,TABLE *to,
{ {
const char *err_msg= ER(ER_DUP_ENTRY); const char *err_msg= ER(ER_DUP_ENTRY);
if (key_nr == 0 && if (key_nr == 0 &&
(to->key_info[0].key_part[0].field->flags & AUTO_INCREMENT_FLAG)) (to->key_info[0].key_part[0].field->flags &
AUTO_INCREMENT_FLAG))
err_msg= ER(ER_DUP_ENTRY_AUTOINCREMENT_CASE); err_msg= ER(ER_DUP_ENTRY_AUTOINCREMENT_CASE);
to->file->print_keydupp_error(key_nr, err_msg); to->file->print_keydup_error(key_nr, err_msg);
break; break;
} }
} }

View File

@ -497,7 +497,7 @@ int ha_tina::encode_quote(byte *buf)
String attribute(attribute_buffer, sizeof(attribute_buffer), String attribute(attribute_buffer, sizeof(attribute_buffer),
&my_charset_bin); &my_charset_bin);
my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set); my_bitmap_map *org_bitmap= dbug_tmp_use_all_columns(table, table->read_set);
buffer.length(0); buffer.length(0);
for (Field **field=table->field ; *field ; field++) for (Field **field=table->field ; *field ; field++)
{ {
@ -558,7 +558,7 @@ int ha_tina::encode_quote(byte *buf)
buffer.append('\n'); buffer.append('\n');
//buffer.replace(buffer.length(), 0, "\n", 1); //buffer.replace(buffer.length(), 0, "\n", 1);
dbug_tmp_restore_column_map(table->read_set, old_map); dbug_tmp_restore_column_map(table->read_set, org_bitmap);
return (buffer.length()); return (buffer.length());
} }
@ -634,7 +634,10 @@ int ha_tina::find_current_row(byte *buf)
if (*mapped_ptr == '"') if (*mapped_ptr == '"')
mapped_ptr++; // Increment past the first quote mapped_ptr++; // Increment past the first quote
else else
{
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
for(;mapped_ptr != end_ptr; mapped_ptr++) for(;mapped_ptr != end_ptr; mapped_ptr++)
{ {
// Need to convert line feeds! // Need to convert line feeds!
@ -667,7 +670,10 @@ int ha_tina::find_current_row(byte *buf)
we are working with a damaged file. we are working with a damaged file.
*/ */
if (mapped_ptr == end_ptr -1) if (mapped_ptr == end_ptr -1)
{
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE); DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
buffer.append(*mapped_ptr); buffer.append(*mapped_ptr);
} }
} }
@ -677,7 +683,7 @@ int ha_tina::find_current_row(byte *buf)
next_position= (end_ptr - share->mapped_file)+eoln_len; next_position= (end_ptr - share->mapped_file)+eoln_len;
/* Maybe use \N for null? */ /* Maybe use \N for null? */
memset(buf, 0, table->s->null_bytes); /* We do not implement nulls! */ memset(buf, 0, table->s->null_bytes); /* We do not implement nulls! */
tmp_restore_column_map(table->write_set, org_bitmap); dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(0); DBUG_RETURN(0);
} }

View File

@ -1478,6 +1478,7 @@ public:
* @return 0 or -1 on error, and tupleId in out parameter * @return 0 or -1 on error, and tupleId in out parameter
*/ */
struct TupleIdRange { struct TupleIdRange {
TupleIdRange() {}
Uint64 m_first_tuple_id; Uint64 m_first_tuple_id;
Uint64 m_last_tuple_id; Uint64 m_last_tuple_id;
void reset() { void reset() {