Browse Source

Fixed compiler warnings

sql/item_subselect.cc:
  Added purecov info
sql/sql_select.cc:
  Added cast
storage/innobase/handler/ha_innodb.cc:
  Added cast
storage/xtradb/btr/btr0btr.c:
  Added buf_block_get_frame_fast() to avoid compiler warning
storage/xtradb/handler/ha_innodb.cc:
  Added cast
storage/xtradb/include/buf0buf.h:
  Innodb has buf_block_get_frame(block) defined as (block)->frame.
  Didn't want to do a big change to break xtradb as it may use block_get_frame() differently, so I mad this quick hack to patch one compiler warning.
pull/843/head
Michael Widenius 13 years ago
parent
commit
dd8bd2e4c3
  1. 4
      configure.cmake
  2. 6
      sql/item_subselect.cc
  3. 2
      sql/sql_select.cc
  4. 7
      storage/innobase/handler/ha_innodb.cc
  5. 2
      storage/xtradb/btr/btr0btr.c
  6. 7
      storage/xtradb/handler/ha_innodb.cc
  7. 2
      storage/xtradb/include/buf0buf.h

4
configure.cmake

@ -56,10 +56,10 @@ ENDIF()
# Always enable -Wall for gnu C/C++
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter")
SET(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
SET(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS}")
ENDIF()

6
sql/item_subselect.cc

@ -5169,13 +5169,17 @@ Ordered_key::cmp_keys_by_row_data(ha_rows a, ha_rows b)
/* Fetch the rows for comparison. */
if ((error= tbl->file->ha_rnd_pos(tbl->record[0], rowid_a)))
{
/* purecov: begin inspected */
tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
return 0;
/* purecov: end */
}
if ((error= tbl->file->ha_rnd_pos(tbl->record[1], rowid_b)))
{
/* purecov: begin inspected */
tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
return 0;
/* purecov: end */
}
/*
Compare the two rows by the corresponding values of the indexed
@ -5253,8 +5257,10 @@ int Ordered_key::cmp_key_with_search_key(rownum_t row_num)
if ((error= tbl->file->ha_rnd_pos(tbl->record[0], cur_rowid)))
{
/* purecov: begin inspected */
tbl->file->print_error(error, MYF(ME_FATALERROR)); // Sets fatal_error
return 0;
/* purecov: end */
}
for (uint i= 0; i < key_column_count; i++)

2
sql/sql_select.cc

@ -6657,7 +6657,7 @@ double JOIN::get_examined_rows()
while ((tab= next_breadth_first_tab(this, tab)))
{
prev_fanout *= prev_tab->records_read;
examined_rows+= tab->get_examined_rows() * prev_fanout;
examined_rows+= (ha_rows) (tab->get_examined_rows() * prev_fanout);
prev_tab= tab;
}
return examined_rows;

7
storage/innobase/handler/ha_innodb.cc

@ -8418,9 +8418,10 @@ ha_innobase::info_low(
}
else if (rec_per_key > 1) {
rec_per_key =
k_rec_per_key *
(double)rec_per_key /
n_rows;
(ha_rows)
(k_rec_per_key *
(double)rec_per_key /
n_rows);
}
key_info->rec_per_key[k++]=

2
storage/xtradb/btr/btr0btr.c

@ -61,7 +61,7 @@ btr_corruption_report(
buf_block_get_zip_size(block),
BUF_PAGE_PRINT_NO_CRASH);
}
buf_page_print(buf_block_get_frame(block), 0, 0);
buf_page_print(buf_block_get_frame_fast(block), 0, 0);
}
#ifdef UNIV_BLOB_DEBUG

7
storage/xtradb/handler/ha_innodb.cc

@ -9281,9 +9281,10 @@ ha_innobase::info_low(
}
else if (rec_per_key > 1) {
rec_per_key =
k_rec_per_key *
(double)rec_per_key /
n_rows;
(ha_rows)
(k_rec_per_key *
(double)rec_per_key /
n_rows);
}
key_info->rec_per_key[k++]=

2
storage/xtradb/include/buf0buf.h

@ -1063,8 +1063,10 @@ buf_block_get_frame(
/*================*/
const buf_block_t* block) /*!< in: pointer to the control block */
__attribute__((pure));
# define buf_block_get_frame_fast(block) buf_block_get_frame(block)
#else /* UNIV_DEBUG */
# define buf_block_get_frame(block) (block ? (block)->frame : 0)
# define buf_block_get_frame_fast(block) (block)->frame
#endif /* UNIV_DEBUG */
/*********************************************************************//**
Gets the space id of a block.

Loading…
Cancel
Save