Commit dfac82e4 authored by Monty's avatar Monty

Fixed failing tests and compiler warnings

- UNINIT_VAR() was required for 4.8.3 on openSUSE 13.2
parent 6b203426
...@@ -468,7 +468,7 @@ extern "C" int madvise(void *addr, size_t len, int behav); ...@@ -468,7 +468,7 @@ extern "C" int madvise(void *addr, size_t len, int behav);
/* /*
Suppress uninitialized variable warning without generating code. Suppress uninitialized variable warning without generating code.
*/ */
#if defined(__GNUC__) #if defined(__GNUC__) && (__GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ < 8)
/* GCC specific self-initialization which inhibits the warning. */ /* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x #define UNINIT_VAR(x) x= x
#elif defined(_lint) || defined(FORCE_INIT_OF_VARS) #elif defined(_lint) || defined(FORCE_INIT_OF_VARS)
......
...@@ -159,6 +159,7 @@ begin ...@@ -159,6 +159,7 @@ begin
select 1; select 1;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sleep(2);
end | end |
set max_statement_time = 0.001; set max_statement_time = 0.001;
call pr(); call pr();
...@@ -170,6 +171,7 @@ create procedure pr() ...@@ -170,6 +171,7 @@ create procedure pr()
begin begin
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sleep(2);
end | end |
set max_statement_time = 0.001; set max_statement_time = 0.001;
call pr(); call pr();
......
...@@ -13,3 +13,5 @@ ...@@ -13,3 +13,5 @@
innodb_scrub : MDEV-8139 innodb_scrub : MDEV-8139
innodb_scrub_compressed : MDEV-8139 innodb_scrub_compressed : MDEV-8139
innodb_scrub_background : MDEV-8139 innodb_scrub_background : MDEV-8139
innodb_encryption-page-compression : Fails with lost connection at line 156
...@@ -201,6 +201,7 @@ create procedure pr() ...@@ -201,6 +201,7 @@ create procedure pr()
select 1; select 1;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sleep(2);
end | end |
delimiter ;| delimiter ;|
set max_statement_time = 0.001; set max_statement_time = 0.001;
...@@ -212,6 +213,7 @@ create procedure pr() ...@@ -212,6 +213,7 @@ create procedure pr()
begin begin
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sql_no_cache * from t1 where i > 5; select sql_no_cache * from t1 where i > 5;
select sleep(2);
end | end |
delimiter ;| delimiter ;|
set max_statement_time = 0.001; set max_statement_time = 0.001;
......
...@@ -1082,6 +1082,8 @@ static int setup_relate_func(Geometry *g1, Geometry *g2, ...@@ -1082,6 +1082,8 @@ static int setup_relate_func(Geometry *g1, Geometry *g2,
uint shape_a, shape_b; uint shape_a, shape_b;
uint n_operands= 0; uint n_operands= 0;
int last_shape_pos; int last_shape_pos;
UNINIT_VAR(shape_a);
UNINIT_VAR(shape_b);
last_shape_pos= func->get_next_expression_pos(); last_shape_pos= func->get_next_expression_pos();
if (func->reserve_op_buffer(1)) if (func->reserve_op_buffer(1))
...@@ -2325,7 +2327,8 @@ String *Item_func_pointonsurface::val_str(String *str) ...@@ -2325,7 +2327,8 @@ String *Item_func_pointonsurface::val_str(String *str)
String *result= 0; String *result= 0;
const Gcalc_scan_iterator::point *pprev= NULL; const Gcalc_scan_iterator::point *pprev= NULL;
uint32 srid; uint32 srid;
UNINIT_VAR(px);
UNINIT_VAR(py);
null_value= 1; null_value= 1;
if ((args[0]->null_value || if ((args[0]->null_value ||
......
...@@ -3545,9 +3545,11 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) ...@@ -3545,9 +3545,11 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
break; break;
bitmap_set_bit(&handled_columns, key_part->fieldnr-1); bitmap_set_bit(&handled_columns, key_part->fieldnr-1);
} }
double selectivity_mult;
if (i) if (i)
{ {
double selectivity_mult;
UNINIT_VAR(selectivity_mult);
/* /*
There is at least 1-column prefix of columns whose selectivity has There is at least 1-column prefix of columns whose selectivity has
not yet been accounted for. not yet been accounted for.
......
...@@ -1133,6 +1133,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success) ...@@ -1133,6 +1133,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
Diagnostics_area *da= thd->get_stmt_da(); Diagnostics_area *da= thd->get_stmt_da();
Warning_info sp_wi(da->warning_info_id(), false, true); Warning_info sp_wi(da->warning_info_id(), false, true);
UNINIT_VAR(saved_creation_ctx);
/* this 7*STACK_MIN_SIZE is a complex matter with a long history (see it!) */ /* this 7*STACK_MIN_SIZE is a complex matter with a long history (see it!) */
if (check_stack_overrun(thd, 7 * STACK_MIN_SIZE, (uchar*)&old_packet)) if (check_stack_overrun(thd, 7 * STACK_MIN_SIZE, (uchar*)&old_packet))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
......
...@@ -2283,7 +2283,7 @@ bool ha_cassandra::mrr_start_read() ...@@ -2283,7 +2283,7 @@ bool ha_cassandra::mrr_start_read()
rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len); rowkey_converter->mariadb_to_cassandra(&cass_key, &cass_key_len);
// Primitive buffer control // Primitive buffer control
if (se->add_lookup_key(cass_key, cass_key_len) > if ((ulong) se->add_lookup_key(cass_key, cass_key_len) >
THDVAR(table->in_use, multiget_batch_size)) THDVAR(table->in_use, multiget_batch_size))
break; break;
} }
......
...@@ -1405,7 +1405,7 @@ void ZLBFAM::Rewind(void) ...@@ -1405,7 +1405,7 @@ void ZLBFAM::Rewind(void)
if (CurBlk >= 0) { // Nothing to do if no block read yet if (CurBlk >= 0) { // Nothing to do if no block read yet
if (!Optimized) { // If optimized, fseek will be done in ReadBuffer if (!Optimized) { // If optimized, fseek will be done in ReadBuffer
rewind(Stream); rewind(Stream);
fread(Zlenp, sizeof(int), 1, Stream); (void) fread(Zlenp, sizeof(int), 1, Stream);
fseek(Stream, *Zlenp + sizeof(int), SEEK_SET); fseek(Stream, *Zlenp + sizeof(int), SEEK_SET);
OldBlk = -1; OldBlk = -1;
} // endif Optimized } // endif Optimized
......
...@@ -4928,8 +4928,11 @@ page_zip_verify_checksum( ...@@ -4928,8 +4928,11 @@ page_zip_verify_checksum(
stored = static_cast<ib_uint32_t>(mach_read_from_4( stored = static_cast<ib_uint32_t>(mach_read_from_4(
static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM)); static_cast<const unsigned char*>(data) + FIL_PAGE_SPACE_OR_CHKSUM));
ulint page_no = mach_read_from_4(static_cast<const unsigned char*> (data) + FIL_PAGE_OFFSET); ulint page_no __attribute__((unused)) =
ulint space_id = mach_read_from_4(static_cast<const unsigned char*> mach_read_from_4(static_cast<const unsigned char*>
(data) + FIL_PAGE_OFFSET);
ulint space_id __attribute__((unused)) =
mach_read_from_4(static_cast<const unsigned char*>
(data) + FIL_PAGE_SPACE_ID); (data) + FIL_PAGE_SPACE_ID);
#if FIL_PAGE_LSN % 8 #if FIL_PAGE_LSN % 8
......
...@@ -1208,7 +1208,6 @@ static my_bool extend_directory(MARIA_HA *info, uchar *buff, uint block_size, ...@@ -1208,7 +1208,6 @@ static my_bool extend_directory(MARIA_HA *info, uchar *buff, uint block_size,
{ {
uint length, first_pos; uint length, first_pos;
uchar *dir, *first_dir; uchar *dir, *first_dir;
MARIA_SHARE *share= info->s;
DBUG_ENTER("extend_directory"); DBUG_ENTER("extend_directory");
/* /*
...@@ -1254,10 +1253,10 @@ static my_bool extend_directory(MARIA_HA *info, uchar *buff, uint block_size, ...@@ -1254,10 +1253,10 @@ static my_bool extend_directory(MARIA_HA *info, uchar *buff, uint block_size,
} }
} }
check_directory(share, check_directory(info->s,
buff, block_size, buff, block_size,
head_page ? MY_MIN(share->base.min_block_length, length) : 0, head_page ? MY_MIN(info->s->base.min_block_length, length) :
*empty_space); 0, *empty_space);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -172,6 +172,7 @@ static inline uint32_t get_len_of_offsets(KEY_AND_COL_INFO* kc_info, TABLE_SHARE ...@@ -172,6 +172,7 @@ static inline uint32_t get_len_of_offsets(KEY_AND_COL_INFO* kc_info, TABLE_SHARE
} }
#ifndef NOT_USED
static int get_thread_query_string(my_thread_id id, String &qs) { static int get_thread_query_string(my_thread_id id, String &qs) {
mysql_mutex_lock(&LOCK_thread_count); mysql_mutex_lock(&LOCK_thread_count);
I_List_iterator<THD> it(threads); I_List_iterator<THD> it(threads);
...@@ -196,6 +197,7 @@ static int get_thread_query_string(my_thread_id id, String &qs) { ...@@ -196,6 +197,7 @@ static int get_thread_query_string(my_thread_id id, String &qs) {
mysql_mutex_unlock(&LOCK_thread_count); mysql_mutex_unlock(&LOCK_thread_count);
return 0; return 0;
} }
#endif
static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INFO* kc_info) { static int allocate_key_and_col_info ( TABLE_SHARE* table_share, KEY_AND_COL_INFO* kc_info) {
int error; int error;
......
...@@ -363,8 +363,9 @@ fil_compress_page( ...@@ -363,8 +363,9 @@ fil_compress_page(
/* Actual write needs to be alligned on block size */ /* Actual write needs to be alligned on block size */
if (write_size % block_size) { if (write_size % block_size) {
#ifdef UNIV_DEBUG
size_t tmp = write_size; size_t tmp = write_size;
#endif
write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size); write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size);
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
ut_a(write_size > 0 && ((write_size % block_size) == 0)); ut_a(write_size > 0 && ((write_size % block_size) == 0));
......
...@@ -56,6 +56,8 @@ buf/buf0buf\.c : label.*loop2.* defined but not used ...@@ -56,6 +56,8 @@ buf/buf0buf\.c : label.*loop2.* defined but not used
# #
storage/xtradb/handler/ha_innodb\.cc: ignoring return value of storage/xtradb/handler/ha_innodb\.cc: ignoring return value of
storage/xtradb/row/row0log\.cc: ignoring return value of storage/xtradb/row/row0log\.cc: ignoring return value of
storage/xtradb/btr/btr0cur\.cc : null argument where non-null required
storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required
# #
# bdb is not critical to keep up to date # bdb is not critical to keep up to date
...@@ -176,22 +178,29 @@ jemalloc/src/jemalloc\.c: set but not used ...@@ -176,22 +178,29 @@ jemalloc/src/jemalloc\.c: set but not used
# #
# Connect engine # Connect engine
# #
storage/connect/connect\.cc: might be clobbered by ~longjmp~ storage/connect/ha_connect\.cc: might be clobbered by
storage/connect/connect\.cc: might be clobbered by
storage/connect/filamvct\.cpp: ignoring return value of storage/connect/filamvct\.cpp: ignoring return value of
storage/connect/filamvct\.cpp: might be clobbered by ~longjmp~ storage/connect/filamvct\.cpp: might be clobbered by
storage/connect/xindex\.cpp: ignoring return value of storage/connect/xindex\.cpp: ignoring return value of
#
# Mroonga
#
groonga/lib/expr\.c : const/copy propagation disabled
# #
# Unexplanable (?) stuff # Unexplanable (?) stuff
# #
listener.cc : .*conversion from 'SOCKET' to 'int'.* listener\.cc : .*conversion from 'SOCKET' to 'int'.*
net_serv.cc : .*conversion from 'SOCKET' to 'int'.* net_serv\.cc : .*conversion from 'SOCKET' to 'int'.*
# #
# Ignorable warnings from header files # Ignorable warnings from header files
# #
backward_warning\.h : This file includes at least one backward_warning\.h : This file includes at least one
/usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter /usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter
bits/string3.h : might overflow destination buffer
# allow a little moving space for the warning below # allow a little moving space for the warning below
mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600
......
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