mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
@@ -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++)
|
||||
|
@@ -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;
|
||||
|
@@ -8418,9 +8418,10 @@ ha_innobase::info_low(
|
||||
}
|
||||
else if (rec_per_key > 1) {
|
||||
rec_per_key =
|
||||
k_rec_per_key *
|
||||
(ha_rows)
|
||||
(k_rec_per_key *
|
||||
(double)rec_per_key /
|
||||
n_rows;
|
||||
n_rows);
|
||||
}
|
||||
|
||||
key_info->rec_per_key[k++]=
|
||||
|
@@ -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
|
||||
|
@@ -9281,9 +9281,10 @@ ha_innobase::info_low(
|
||||
}
|
||||
else if (rec_per_key > 1) {
|
||||
rec_per_key =
|
||||
k_rec_per_key *
|
||||
(ha_rows)
|
||||
(k_rec_per_key *
|
||||
(double)rec_per_key /
|
||||
n_rows;
|
||||
n_rows);
|
||||
}
|
||||
|
||||
key_info->rec_per_key[k++]=
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user