Skip to content

Commit fba61fb

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 89f3555 commit fba61fb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

storage/rocksdb/rdb_index_merge.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "./rdb_index_merge.h"
1919

2020
/* MySQL header files */
21+
#include "mysqld_error.h"
2122
#include "mysql/plugin.h"
2223
#include "mysql/psi/mysql_file.h"
2324
#include "sql/table.h"
@@ -163,9 +164,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
163164
add is too large for the buffer.
164165
*/
165166
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.",
167+
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
168+
"Current value of rocksdb_merge_buf_size=%" PRIu64
169+
" is too small. At least %u bytes required.",
169170
m_rec_buf_unsorted->m_total_size, total_offset);
170171
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
171172
}
@@ -181,9 +182,9 @@ int Rdb_index_merge::add(const rocksdb::Slice &key, const rocksdb::Slice &val) {
181182
const uint data_size = RDB_MERGE_CHUNK_LEN + RDB_MERGE_KEY_DELIMITER +
182183
RDB_MERGE_VAL_DELIMITER + key.size() + val.size();
183184
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.",
185+
LogPluginErrMsg(ERROR_LEVEL, ER_LOG_PRINTF_MSG,
186+
"Current value of rocksdb_merge_buf_size=%" PRIu64
187+
" is too small. At least %u bytes required.",
187188
m_rec_buf_unsorted->m_total_size, data_size);
188189
return HA_ERR_ROCKSDB_MERGE_FILE_ERR;
189190
}

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)