Skip to content

Commit

Permalink
Use PRIu64 instead of %lu to format std::uint64_t values (percona#1261)
Browse files Browse the repository at this point in the history
Upstream commit ID: facebook/mysql-5.6@65f8d20
PS-8755: Merge percona-202301 (https://jira.percona.com/browse/PS-8755)

Summary:
This fixes the macOS build, where std::uint64_t is unsigned long long.

Pull Request resolved: facebook/mysql-5.6#1261

Reviewed By: sunshine-Chun

Differential Revision: D42850107

Pulled By: hermanlee

fbshipit-source-id: 7520d90efc4369e203d0c4ee6f52ab02863ca10d
  • Loading branch information
laurynas-biveinis authored and oleksandr-kachan committed Jan 26, 2024
1 parent 5e15df8 commit 01724d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions storage/rocksdb/rdb_index_merge.cc
Expand Up @@ -18,6 +18,7 @@
#include "./rdb_index_merge.h"

/* MySQL header files */
#include "mysqld_error.h"
#include "mysql/plugin.h"
#include "mysql/psi/mysql_file.h"
#include "sql/table.h"
Expand Down Expand Up @@ -163,9 +164,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
add is too large for the buffer.
*/
if (m_offset_tree.empty()) {
LogPluginErrMsg(ERROR_LEVEL, 0,
"Current value of rocksdb_merge_buf_size=%llu is too "
"small. At least %u bytes required.",
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
"Current value of rocksdb_merge_buf_size=%" PRIu64
" is too small. At least %u bytes required.",
m_rec_buf_unsorted->m_total_size, total_offset);
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
}
Expand All @@ -181,9 +182,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
const uint data_size = RDB_MERGE_CHUNK_LEN + RDB_MERGE_KEY_DELIMITER +
RDB_MERGE_VAL_DELIMITER + key.size() + val.size();
if (data_size > m_rec_buf_unsorted->m_total_size) {
LogPluginErrMsg(ERROR_LEVEL, 0,
"Current value of rocksdb_merge_buf_size=%llu is too "
"small. At least %u bytes required.",
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
"Current value of rocksdb_merge_buf_size=%" PRIu64
" is too small. At least %u bytes required.",
m_rec_buf_unsorted->m_total_size, data_size);
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
}
Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/rdb_index_merge.h
Expand Up @@ -62,7 +62,7 @@ class Rdb_index_merge {
ulonglong m_curr_offset; /* offset of the record pointer for the block */
ulonglong m_disk_start_offset; /* where the chunk starts on disk */
ulonglong m_disk_curr_offset; /* current offset on disk */
ulonglong m_total_size; /* total # of data bytes in chunk */
uint64 m_total_size; /* total # of data bytes in chunk */

void store_key_value(const rocksdb::Slice &key, const rocksdb::Slice &val)
MY_ATTRIBUTE((__nonnull__));
Expand Down

0 comments on commit 01724d6

Please sign in to comment.