Extract some of #3360 fixes to 10.11.x
That PR uncovered countless issues on `my_snprintf` uses. This commit backports a squashed subset of their fixes. (Excludes previous parts #3485 and #3493)
This commit is contained in:
parent
c72221e2f8
commit
687377633d
@ -283,7 +283,7 @@ void get_dynamic(DYNAMIC_ARRAY *array, void *element, size_t idx)
|
|||||||
{
|
{
|
||||||
if (idx >= array->elements)
|
if (idx >= array->elements)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("warning",("To big array idx: %d, array size is %d",
|
DBUG_PRINT("warning",("To big array idx: %zu, array size is %zu",
|
||||||
idx,array->elements));
|
idx,array->elements));
|
||||||
bzero(element,array->size_of_element);
|
bzero(element,array->size_of_element);
|
||||||
return;
|
return;
|
||||||
|
@ -829,7 +829,7 @@ static int unlock_lock_and_free_resource(WT_THD *thd, WT_RESOURCE *rc)
|
|||||||
|
|
||||||
if (rc->owners.elements || rc->waiter_count)
|
if (rc->owners.elements || rc->waiter_count)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("wt", ("nothing to do, %u owners, %u waiters",
|
DBUG_PRINT("wt", ("nothing to do, %zu owners, %u waiters",
|
||||||
rc->owners.elements, rc->waiter_count));
|
rc->owners.elements, rc->waiter_count));
|
||||||
rc_unlock(rc);
|
rc_unlock(rc);
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
@ -1142,4 +1142,3 @@ void wt_thd_release(WT_THD *thd, const WT_RESOURCE_ID *resid)
|
|||||||
reset_dynamic(&thd->my_resources);
|
reset_dynamic(&thd->my_resources);
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ int HCData::curl_run (const char *url, std::string *response,
|
|||||||
else if (is_error)
|
else if (is_error)
|
||||||
{
|
{
|
||||||
my_printf_error(ER_UNKNOWN_ERROR, PLUGIN_ERROR_HEADER
|
my_printf_error(ER_UNKNOWN_ERROR, PLUGIN_ERROR_HEADER
|
||||||
"Hashicorp server error: %d, response: %s",
|
"Hashicorp server error: %ld, response: %s",
|
||||||
ME_ERROR_LOG_ONLY | ME_WARNING, http_code, res);
|
ME_ERROR_LOG_ONLY | ME_WARNING, http_code, res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2705,7 +2705,7 @@ static void check_and_remove_stale_alter(Relay_log_info *rli)
|
|||||||
{
|
{
|
||||||
DBUG_ASSERT(info->state == start_alter_state::REGISTERED);
|
DBUG_ASSERT(info->state == start_alter_state::REGISTERED);
|
||||||
|
|
||||||
sql_print_warning("ALTER query started at %u-%u-%llu could not "
|
sql_print_warning("ALTER query started at %llu-%u-%u could not "
|
||||||
"be completed because of unexpected master server "
|
"be completed because of unexpected master server "
|
||||||
"or its binlog change", info->sa_seq_no, // todo:gtid
|
"or its binlog change", info->sa_seq_no, // todo:gtid
|
||||||
0, 0);
|
0, 0);
|
||||||
|
@ -3380,7 +3380,7 @@ void plugin_thdvar_cleanup(THD *thd)
|
|||||||
if ((idx= thd->lex->plugins.elements))
|
if ((idx= thd->lex->plugins.elements))
|
||||||
{
|
{
|
||||||
list= ((plugin_ref*) thd->lex->plugins.buffer) + idx - 1;
|
list= ((plugin_ref*) thd->lex->plugins.buffer) + idx - 1;
|
||||||
DBUG_PRINT("info",("unlocking %d plugins", idx));
|
DBUG_PRINT("info",("unlocking %zu plugins", idx));
|
||||||
while ((uchar*) list >= thd->lex->plugins.buffer)
|
while ((uchar*) list >= thd->lex->plugins.buffer)
|
||||||
intern_plugin_unlock(NULL, *list--);
|
intern_plugin_unlock(NULL, *list--);
|
||||||
}
|
}
|
||||||
|
@ -6406,7 +6406,7 @@ remove_key:
|
|||||||
}
|
}
|
||||||
if (!part_elem)
|
if (!part_elem)
|
||||||
{
|
{
|
||||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
|
push_warning(thd, Sql_condition::WARN_LEVEL_NOTE,
|
||||||
ER_PARTITION_DOES_NOT_EXIST,
|
ER_PARTITION_DOES_NOT_EXIST,
|
||||||
ER_THD(thd, ER_PARTITION_DOES_NOT_EXIST));
|
ER_THD(thd, ER_PARTITION_DOES_NOT_EXIST));
|
||||||
names_it.remove();
|
names_it.remove();
|
||||||
|
@ -2487,7 +2487,7 @@ fil_ibd_load(uint32_t space_id, const char *filename, fil_space_t *&space)
|
|||||||
|
|
||||||
if (space) {
|
if (space) {
|
||||||
sql_print_information("InnoDB: Ignoring data file '%s'"
|
sql_print_information("InnoDB: Ignoring data file '%s'"
|
||||||
" with space ID " ULINTPF
|
" with space ID %" PRIu32
|
||||||
". Another data file called %s"
|
". Another data file called %s"
|
||||||
" exists"
|
" exists"
|
||||||
" with the same space ID.",
|
" with the same space ID.",
|
||||||
|
@ -2638,7 +2638,7 @@ dberr_t fseg_free_page(fseg_header_t *seg_header, fil_space_t *space,
|
|||||||
mtr->x_lock_space(space);
|
mtr->x_lock_space(space);
|
||||||
|
|
||||||
DBUG_PRINT("fseg_free_page",
|
DBUG_PRINT("fseg_free_page",
|
||||||
("space_id: " ULINTPF ", page_no: %u", space->id, offset));
|
("space_id: %" PRIu32 ", page_no: %" PRIu32, space->id, offset));
|
||||||
|
|
||||||
dberr_t err;
|
dberr_t err;
|
||||||
if (fseg_inode_t *seg_inode= fseg_inode_try_get(seg_header,
|
if (fseg_inode_t *seg_inode= fseg_inode_try_get(seg_header,
|
||||||
|
@ -3771,7 +3771,7 @@ compression_algorithm_is_not_loaded(ulong compression_algorithm, myf flags)
|
|||||||
if (is_loaded[compression_algorithm])
|
if (is_loaded[compression_algorithm])
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
my_printf_error(HA_ERR_UNSUPPORTED, "InnoDB: compression algorithm %s (%u)"
|
my_printf_error(HA_ERR_UNSUPPORTED, "InnoDB: compression algorithm %s (%lu)"
|
||||||
" is not available. Please, load the corresponding provider plugin.", flags,
|
" is not available. Please, load the corresponding provider plugin.", flags,
|
||||||
page_compression_algorithms[compression_algorithm], compression_algorithm);
|
page_compression_algorithms[compression_algorithm], compression_algorithm);
|
||||||
return 1;
|
return 1;
|
||||||
@ -4016,7 +4016,7 @@ static int innodb_init_params()
|
|||||||
"InnoDB: innodb_open_files=%lu is not greater "
|
"InnoDB: innodb_open_files=%lu is not greater "
|
||||||
"than the number of system tablespace files, "
|
"than the number of system tablespace files, "
|
||||||
"temporary tablespace files, "
|
"temporary tablespace files, "
|
||||||
"innodb_undo_tablespaces=%lu; adjusting "
|
"innodb_undo_tablespaces=%u; adjusting "
|
||||||
"to innodb_open_files=%zu",
|
"to innodb_open_files=%zu",
|
||||||
innobase_open_files, srv_undo_tablespaces,
|
innobase_open_files, srv_undo_tablespaces,
|
||||||
min_open_files_limit);
|
min_open_files_limit);
|
||||||
@ -18565,7 +18565,7 @@ static void innodb_log_file_size_update(THD *thd, st_mysql_sys_var*,
|
|||||||
*static_cast<const ulonglong*>(save) < log_sys.buf_size)
|
*static_cast<const ulonglong*>(save) < log_sys.buf_size)
|
||||||
my_printf_error(ER_WRONG_ARGUMENTS,
|
my_printf_error(ER_WRONG_ARGUMENTS,
|
||||||
"innodb_log_file_size must be at least"
|
"innodb_log_file_size must be at least"
|
||||||
" innodb_log_buffer_size=%zu", MYF(0), log_sys.buf_size);
|
" innodb_log_buffer_size=%u", MYF(0), log_sys.buf_size);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (log_sys.resize_start(*static_cast<const ulonglong*>(save))) {
|
switch (log_sys.resize_start(*static_cast<const ulonglong*>(save))) {
|
||||||
|
@ -4517,7 +4517,7 @@ static dberr_t recv_rename_files()
|
|||||||
err= space->rename(new_name, false);
|
err= space->rename(new_name, false);
|
||||||
if (err != DB_SUCCESS)
|
if (err != DB_SUCCESS)
|
||||||
sql_print_error("InnoDB: Cannot replay rename of tablespace "
|
sql_print_error("InnoDB: Cannot replay rename of tablespace "
|
||||||
UINT32PF " to '%s: %s", new_name, ut_strerr(err));
|
UINT32PF " to '%s': %s", id, new_name, ut_strerr(err));
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
mysql_mutex_unlock(&fil_system.mutex);
|
mysql_mutex_unlock(&fil_system.mutex);
|
||||||
|
@ -3941,7 +3941,8 @@ bool fil_node_t::read_page0(const byte *dpage, bool no_lsn) noexcept
|
|||||||
invalid:
|
invalid:
|
||||||
if (dpage)
|
if (dpage)
|
||||||
goto retry_dpage;
|
goto retry_dpage;
|
||||||
sql_print_error("InnoDB: Expected tablespace flags 0x%zx but found 0x%zx"
|
sql_print_error("InnoDB: Expected tablespace flags 0x%" PRIx32
|
||||||
|
" but found 0x%" PRIx32
|
||||||
" in the file %s", space->flags, flags, name);
|
" in the file %s", space->flags, flags, name);
|
||||||
goto err_exit;
|
goto err_exit;
|
||||||
}
|
}
|
||||||
|
@ -5707,7 +5707,7 @@ translog_write_variable_record_mgroup(LSN *lsn,
|
|||||||
goto err_unlock;
|
goto err_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
DBUG_PRINT("info", ("chunk: #%u first_page: %u (%u) "
|
DBUG_PRINT("info", ("chunk: #%zu first_page: %u (%u) "
|
||||||
"full_pages: %lu (%lu) "
|
"full_pages: %lu (%lu) "
|
||||||
"Left %lu",
|
"Left %lu",
|
||||||
groups.elements,
|
groups.elements,
|
||||||
@ -5875,8 +5875,8 @@ translog_write_variable_record_mgroup(LSN *lsn,
|
|||||||
record_rest + header_fixed_part +
|
record_rest + header_fixed_part +
|
||||||
(groups.elements - groups_per_page * (chunk0_pages - 1)) * (7 + 1))
|
(groups.elements - groups_per_page * (chunk0_pages - 1)) * (7 + 1))
|
||||||
chunk0_pages++;
|
chunk0_pages++;
|
||||||
DBUG_PRINT("info", ("chunk0_pages: %u groups %u groups per full page: %u "
|
DBUG_PRINT("info", ("chunk0_pages: %u groups %zu groups per full page: %u "
|
||||||
"Group on last page: %u",
|
"Group on last page: %zu",
|
||||||
chunk0_pages, groups.elements,
|
chunk0_pages, groups.elements,
|
||||||
groups_per_page,
|
groups_per_page,
|
||||||
(groups.elements -
|
(groups.elements -
|
||||||
|
Loading…
x
Reference in New Issue
Block a user