Skip to content

Commit

Permalink
Fix some compilation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 13, 2017
1 parent e5b155a commit 056ec4a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 46 deletions.
11 changes: 4 additions & 7 deletions storage/innobase/include/os0file.h
Expand Up @@ -426,15 +426,12 @@ class IORequest {
}
}

/** Punch a hole in the file if it was a write
/** Free storage space associated with a section of the file.
@param[in] fh Open file handle
@param[in] len Compressed buffer length for write
@param[in] off Starting offset (SEEK_SET)
@param[in] len Size of the hole
@return DB_SUCCESS or error code */

dberr_t punch_hole(
os_file_t fh,
os_offset_t offset,
os_offset_t len);
dberr_t punch_hole(os_file_t fh, os_offset_t off, ulint len);

private:
/** Page to be written on write operation. */
Expand Down
5 changes: 3 additions & 2 deletions storage/innobase/include/row0sel.h
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -223,8 +224,8 @@ row_count_rtree_recs(
/*******************************************************************//**
Checks if MySQL at the moment is allowed for this table to retrieve a
consistent read result, or store it to the query cache.
@return TRUE if storing or retrieving from the query cache is permitted */
ibool
@return whether storing or retrieving from the query cache is permitted */
bool
row_search_check_if_query_cache_permitted(
/*======================================*/
trx_t* trx, /*!< in: transaction object */
Expand Down
21 changes: 11 additions & 10 deletions storage/innobase/log/log0recv.cc
Expand Up @@ -2726,27 +2726,28 @@ recv_scan_log_recs(
stored to the hash table; this is reset
if just debug checking is needed, or
when the available_memory runs out */
const byte* buf, /*!< in: buffer containing a log
segment or garbage */
ulint len, /*!< in: buffer length */
const byte* log_block, /*!< in: log segment */
lsn_t checkpoint_lsn, /*!< in: latest checkpoint LSN */
lsn_t start_lsn, /*!< in: buffer start lsn */
lsn_t start_lsn, /*!< in: buffer start LSN */
lsn_t end_lsn, /*!< in: buffer end LSN */
lsn_t* contiguous_lsn, /*!< in/out: it is known that all log
groups contain contiguous log data up
to this lsn */
lsn_t* group_scanned_lsn)/*!< out: scanning succeeded up to
this lsn */
{
const byte* log_block = buf;
lsn_t scanned_lsn = start_lsn;
bool finished = false;
ulint data_len;
bool more_data = false;
bool apply = recv_sys->mlog_checkpoint_lsn != 0;

ut_ad(start_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(len >= OS_FILE_LOG_BLOCK_SIZE);
ut_ad(end_lsn % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_ad(end_lsn >= start_lsn + OS_FILE_LOG_BLOCK_SIZE);

const byte* const log_end = log_block
+ ulint(end_lsn - start_lsn);

do {
ut_ad(!finished);
Expand Down Expand Up @@ -2842,7 +2843,7 @@ recv_scan_log_recs(
} else {
log_block += OS_FILE_LOG_BLOCK_SIZE;
}
} while (log_block < buf + len);
} while (log_block < log_end);

*group_scanned_lsn = scanned_lsn;

Expand Down Expand Up @@ -2938,9 +2939,9 @@ recv_group_scan_log_recs(
} while (end_lsn != start_lsn
&& !recv_scan_log_recs(
available_mem, &store_to_hash, log_sys->buf,
end_lsn - start_lsn,
checkpoint_lsn,
start_lsn, contiguous_lsn, &group->scanned_lsn));
start_lsn, end_lsn,
contiguous_lsn, &group->scanned_lsn));

if (recv_sys->found_corrupt_log || recv_sys->found_corrupt_fs) {
DBUG_RETURN(false);
Expand Down
14 changes: 4 additions & 10 deletions storage/innobase/os/os0file.cc
Expand Up @@ -1920,8 +1920,7 @@ LinuxAIOHandler::collect()

slot->err = slot->type.punch_hole(
slot->file,
slot->offset,
static_cast<os_offset_t>(slot->len));
slot->offset, slot->len);
} else {
slot->err = DB_SUCCESS;
}
Expand Down Expand Up @@ -4881,9 +4880,7 @@ os_file_io(
&& !type.is_log()
&& type.is_write()
&& type.punch_hole()) {
*err = type.punch_hole(file,
offset,
static_cast<os_offset_t>(n));
*err = type.punch_hole(file, offset, n);

} else {
*err = DB_SUCCESS;
Expand Down Expand Up @@ -5541,10 +5538,7 @@ os_file_punch_hole(
@param[in] len Size of the hole
@return DB_SUCCESS or error code */
dberr_t
IORequest::punch_hole(
os_file_t fh,
os_offset_t off,
os_offset_t len)
IORequest::punch_hole(os_file_t fh, os_offset_t off, ulint len)
{
/* In this debugging mode, we act as if punch hole is supported,
and then skip any calls to actually punch a hole here.
Expand All @@ -5553,7 +5547,7 @@ IORequest::punch_hole(
return(DB_SUCCESS);
);

os_offset_t trim_len = static_cast<os_offset_t>(get_trim_length(len));
ulint trim_len = get_trim_length(len);

if (trim_len == 0) {
return(DB_SUCCESS);
Expand Down
31 changes: 14 additions & 17 deletions storage/innobase/row/row0sel.cc
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2015, MariaDB Corporation.
Copyright (c) 2015, 2017, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
Expand Down Expand Up @@ -3260,7 +3260,9 @@ row_sel_store_mysql_rec(
getting selected. The non-key virtual columns may
not be materialized and we should skip them. */
if (dfield_get_type(dfield)->mtype == DATA_MISSING) {
#ifdef UNIV_DEBUG
ulint prefix;
#endif /* UNIV_DEBUG */
ut_ad(prebuilt->m_read_virtual_key);

/* If it is part of index key the data should
Expand Down Expand Up @@ -5947,23 +5949,20 @@ row_count_rtree_recs(
/*******************************************************************//**
Checks if MySQL at the moment is allowed for this table to retrieve a
consistent read result, or store it to the query cache.
@return TRUE if storing or retrieving from the query cache is permitted */
ibool
@return whether storing or retrieving from the query cache is permitted */
bool
row_search_check_if_query_cache_permitted(
/*======================================*/
trx_t* trx, /*!< in: transaction object */
const char* norm_name) /*!< in: concatenation of database name,
'/' char, table name */
{
dict_table_t* table;
ibool ret = FALSE;

table = dict_table_open_on_name(
dict_table_t* table = dict_table_open_on_name(
norm_name, FALSE, FALSE, DICT_ERR_IGNORE_NONE);

if (table == NULL) {

return(FALSE);
return(false);
}

/* Start the transaction if it is not started yet */
Expand All @@ -5975,18 +5974,16 @@ row_search_check_if_query_cache_permitted(
read/write from/to the cache.
If a read view has not been created for the transaction then it doesn't
really matter what this transactin sees. If a read view was created
really matter what this transaction sees. If a read view was created
then the view low_limit_id is the max trx id that this transaction
saw at the time of the read view creation. */

if (lock_table_get_n_locks(table) == 0
&& ((trx->id != 0 && trx->id >= table->query_cache_inv_id)
|| !MVCC::is_view_active(trx->read_view)
|| trx->read_view->low_limit_id()
>= table->query_cache_inv_id)) {

ret = TRUE;

const bool ret = lock_table_get_n_locks(table) == 0
&& ((trx->id != 0 && trx->id >= table->query_cache_inv_id)
|| !MVCC::is_view_active(trx->read_view)
|| trx->read_view->low_limit_id()
>= table->query_cache_inv_id);
if (ret) {
/* If the isolation level is high, assign a read view for the
transaction if it does not yet have one */

Expand Down

0 comments on commit 056ec4a

Please sign in to comment.