Commit 950722e7 authored by unknown's avatar unknown

After merge fixes

Remove compiler warnings


mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Fixed regex to get rid of xid= in output
mysql-test/r/mysqlcheck.result:
  Drop client_test_db if mysql_client_test fails
mysql-test/t/mysqlcheck.test:
  Drop client_test_db if mysql_client_test fails
mysql-test/t/mysqldump.test:
  Use --defaults-file instead of --defaults-extra-file to avoid reading my.cnf files
sql/event_scheduler.cc:
  Remove compiler warnings
sql/ha_partition.cc:
  Don't divide with 0 when checking current auto_increment value
sql/handler.cc:
  After merge fix
sql/mysqld.cc:
  Remove comiler warning
sql/partition_info.cc:
  After merge fix
  Fixed memory reference overrun for some wrong partition definitions
sql/sql_base.cc:
  After merge fix
  Always set *leaves in setup_tables_and_check_access() (assume argument is always given).
sql/sql_select.cc:
  Simple optimization
sql/sql_show.cc:
  Remove compiler warning
sql/sql_table.cc:
  After merge fix
storage/csv/ha_tina.cc:
  Ensure table maps are restored properly
storage/ndb/include/ndbapi/Ndb.hpp:
  Remove compiler warning
parent 9b9e965c
No related merge requests found
......@@ -324,7 +324,7 @@ CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) engine=innodb select *
ROLLBACK;
SELECT * from 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;
# Test for BUG#16559 (ROLLBACK should always have a zero error code in
......
drop database if exists client_test_db;
DROP SCHEMA test;
CREATE SCHEMA test;
cluster.binlog_index OK
......
......@@ -5,6 +5,10 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
--disable_warnings
drop database if exists client_test_db;
--enable_warnings
DROP SCHEMA test;
CREATE SCHEMA test;
#
......
......@@ -610,7 +610,7 @@ drop database db1;
# 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
#
......
......@@ -873,13 +873,19 @@ Event_scheduler::drop_event(THD *thd, Event_timed *et)
*/
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)
{
enum enum_error_code res;
Event_timed *et_old, *et_new= NULL;
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_PRINT("enter", ("thd=%p et=%p et=[%s.%s] lock=%p",
thd, et, et->dbname.str, et->name.str, &LOCK_scheduler_data));
......
......@@ -4146,7 +4146,8 @@ void ha_partition::info(uint flag)
ulonglong nb_reserved_values;
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
/* 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();
}
if (flag & HA_STATUS_VARIABLE)
......@@ -4188,7 +4189,7 @@ void ha_partition::info(uint flag)
stats.deleted+= file->stats.deleted;
stats.data_file_length+= file->stats.data_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)
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 first_value_part, last_value_part, nb_reserved_values_part,
last_value;
last_value= ~ (ulonglong) 0;
handler **pos, **end;
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);
}
*nb_reserved_values= (last_value == ULONGLONG_MAX) ?
ULONGLONG_MAX : ((last_value - *first_value) / increment);
if (increment) // If not check for values
*nb_reserved_values= (last_value == ULONGLONG_MAX) ?
ULONGLONG_MAX : ((last_value - *first_value) / increment);
DBUG_VOID_RETURN;
}
......
......@@ -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)
{
handlerton *hton=ha_resolve_by_legacy_type(current_thd, DB_TYPE_DEFAULT);
return (hton && hton->create) ? hton->create(table, mem_root) : NULL;
}
......
......@@ -7011,7 +7011,7 @@ static void mysql_init_variables(void)
character_set_filesystem_name= (char*) "binary";
/* 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.tx_isolation= ISO_REPEATABLE_READ;
global_system_variables.select_limit= (ulonglong) HA_POS_ERROR;
......
......@@ -635,8 +635,8 @@ bool partition_info::check_list_constants()
&list_part_cmp);
not_first= FALSE;
i= prev_value= 0; //prev_value initialised to quiet compiler
do
prev_value= 0; // prev_value initialised to quiet compiler
for (i= 0; i < no_list_values ; i++)
{
curr_value= list_array[i].list_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));
goto end;
}
} while (++i < no_list_values);
}
result= FALSE;
end:
DBUG_RETURN(result);
......@@ -689,10 +689,10 @@ bool partition_info::check_partition_info(handlerton **eng_type,
DBUG_ENTER("partition_info::check_partition_info");
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));
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));
if (!part_expression_ok)
{
......
......@@ -5433,27 +5433,27 @@ bool setup_tables_and_check_access(THD *thd,
Name_resolution_context *context,
List<TABLE_LIST> *from_clause,
TABLE_LIST *tables,
Item **conds, TABLE_LIST **leaves,
TABLE_LIST **leaves,
bool select_insert,
ulong want_access)
{
TABLE_LIST *leaves_tmp = NULL;
TABLE_LIST *leaves_tmp= NULL;
if (setup_tables (thd, context, from_clause, tables, conds,
&leaves_tmp, select_insert))
if (setup_tables(thd, context, from_clause, tables,
&leaves_tmp, select_insert))
return TRUE;
if (leaves)
*leaves = leaves_tmp;
*leaves= leaves_tmp;
for (; leaves_tmp; leaves_tmp= leaves_tmp->next_leaf)
{
if (leaves_tmp->belong_to_view &&
check_one_table_access(thd, want_access, leaves_tmp))
{
tables->hide_view_error(thd);
return TRUE;
}
}
return FALSE;
}
......
......@@ -2570,7 +2570,10 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
bool is_const=1;
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)
stat[0].const_keys.merge(possible_keys);
/*
......
......@@ -3119,9 +3119,10 @@ static my_bool iter_schema_engines(THD *thd, st_plugin_int *plugin,
if (!(wild && wild[0] &&
wild_case_compare(scs, plugin->name.str,wild)))
{
LEX_STRING state[2]={{STRING_WITH_LEN("ENABLED")},
{STRING_WITH_LEN("DISABLED")}};
LEX_STRING yesno[2]={{STRING_WITH_LEN("NO")}, {STRING_WITH_LEN("YES")}};
LEX_STRING state[2]= {{(char*) STRING_WITH_LEN("ENABLED")},
{(char*) STRING_WITH_LEN("DISABLED")}};
LEX_STRING yesno[2]= {{(char*) STRING_WITH_LEN("NO")},
{(char*) STRING_WITH_LEN("YES")}};
LEX_STRING *tmp;
restore_record(table, s->default_values);
......
......@@ -6247,9 +6247,10 @@ copy_data_between_tables(TABLE *from,TABLE *to,
{
const char *err_msg= ER(ER_DUP_ENTRY);
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);
to->file->print_keydupp_error(key_nr, err_msg);
to->file->print_keydup_error(key_nr, err_msg);
break;
}
}
......
......@@ -497,7 +497,7 @@ int ha_tina::encode_quote(byte *buf)
String attribute(attribute_buffer, sizeof(attribute_buffer),
&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);
for (Field **field=table->field ; *field ; field++)
{
......@@ -558,7 +558,7 @@ int ha_tina::encode_quote(byte *buf)
buffer.append('\n');
//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());
}
......@@ -634,7 +634,10 @@ int ha_tina::find_current_row(byte *buf)
if (*mapped_ptr == '"')
mapped_ptr++; // Increment past the first quote
else
{
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
for(;mapped_ptr != end_ptr; mapped_ptr++)
{
// Need to convert line feeds!
......@@ -667,7 +670,10 @@ int ha_tina::find_current_row(byte *buf)
we are working with a damaged file.
*/
if (mapped_ptr == end_ptr -1)
{
dbug_tmp_restore_column_map(table->write_set, org_bitmap);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
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;
/* Maybe use \N for null? */
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);
}
......
......@@ -1478,6 +1478,7 @@ public:
* @return 0 or -1 on error, and tupleId in out parameter
*/
struct TupleIdRange {
TupleIdRange() {}
Uint64 m_first_tuple_id;
Uint64 m_last_tuple_id;
void reset() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment