Skip to content

Commit d466b7d

Browse files
laurynas-biveinisinikep
authored andcommitted
Use PRIu64 instead of %lu to format std::uint64_t values (percona#1261)
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
1 parent e68f8f1 commit d466b7d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

storage/rocksdb/rdb_index_merge.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
/* This C++ file's header file */
1818
#include "./rdb_index_merge.h"
1919

20+
#include <cinttypes>
21+
2022
/* MySQL header files */
2123
#include "mysql/plugin.h"
2224
#include "mysql/psi/mysql_file.h"
@@ -163,9 +165,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
163165
add is too large for the buffer.
164166
*/
165167
if (m_offset_tree.empty()) {
166-
LogPluginErrMsg(ERROR_LEVEL, 0,
167-
"Current value of rocksdb_merge_buf_size=%llu is too "
168-
"small. At least %u bytes required.",
168+
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
169+
"Current value of rocksdb_merge_buf_size=%" PRIu64
170+
" is too small. At least %u bytes required.",
169171
m_rec_buf_unsorted->m_total_size, total_offset);
170172
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
171173
}
@@ -181,9 +183,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
181183
const uint data_size = RDB_MERGE_CHUNK_LEN + RDB_MERGE_KEY_DELIMITER +
182184
RDB_MERGE_VAL_DELIMITER + key.size() + val.size();
183185
if (data_size > m_rec_buf_unsorted->m_total_size) {
184-
LogPluginErrMsg(ERROR_LEVEL, 0,
185-
"Current value of rocksdb_merge_buf_size=%llu is too "
186-
"small. At least %u bytes required.",
186+
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
187+
"Current value of rocksdb_merge_buf_size=%" PRIu64
188+
" is too small. At least %u bytes required.",
187189
m_rec_buf_unsorted->m_total_size, data_size);
188190
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
189191
}

storage/rocksdb/rdb_index_merge.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Rdb_index_merge {
6262
ulonglong m_curr_offset; /* offset of the record pointer for the block */
6363
ulonglong m_disk_start_offset; /* where the chunk starts on disk */
6464
ulonglong m_disk_curr_offset; /* current offset on disk */
65-
ulonglong m_total_size; /* total # of data bytes in chunk */
65+
uint64 m_total_size; /* total # of data bytes in chunk */
6666

6767
void store_key_value(const rocksdb::Slice &key, const rocksdb::Slice &val)
6868
MY_ATTRIBUTE((__nonnull__));

0 commit comments

Comments
 (0)