Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more MDEV-35429 my_snprintf fixes for 10.5+ #3749

Open
wants to merge 1 commit into
base: 10.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,8 @@ bool os_file_set_size(const char *name, os_file_t file, os_offset_t size,
if (is_sparse) {
bool success = !ftruncate(file, size);
if (!success) {
sql_print_error("InnoDB: ftruncate of file %s"
" to %llu bytes failed with error %d",
sql_print_error("InnoDB: ftruncate of file %s to %"
PRIu64 " bytes failed with error %d",
name, size, errno);
}
return success;
Expand Down Expand Up @@ -1680,7 +1680,7 @@ bool os_file_set_size(const char *name, os_file_t file, os_offset_t size,
case 0:
return true;
default:
sql_print_error("InnoDB: preallocating %llu"
sql_print_error("InnoDB: preallocating %" PRIu64
" bytes for file %s failed with error %d",
size, name, err);
/* fall through */
Expand Down
6 changes: 3 additions & 3 deletions storage/myisam/mi_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -3429,9 +3429,9 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
{
if (!searching)
mi_check_print_info(param,
"Found block with impossible length %u at %s; Skipped",
block_info.block_len+ (uint) (block_info.filepos-pos),
llstr(pos,llbuff));
"Found block with impossible length %lu at %s; Skipped",
block_info.block_len + (unsigned long) (block_info.filepos-pos),
Copy link
Contributor Author

@ParadoxV5 ParadoxV5 Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MI_BLOCK_INFO::filepos and local var pos are both my_off_t which can be as large as unsigned long long, yet the old code casted to uint.

Here I cast to unsigned long to match MI_BLOCK_INFO::block_len (and #3748 and its surrounding code too).

llstr(pos, llbuff));
if (found_record)
goto try_next;
searching=1;
Expand Down