mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
Extract some of #3360 fixes to 10.5.x
That PR uncovered countless issues on `my_snprintf` uses. This commit backports a squashed subset of their fixes.
This commit is contained in:
parent
b414eca98d
commit
cf2d49ddcf
24 changed files with 102 additions and 101 deletions
|
@ -1739,7 +1739,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
|
|||
query_length= my_snprintf(query_buffer,
|
||||
sizeof (query_buffer),
|
||||
"SET SESSION character_set_results = '%s'",
|
||||
(const char *) cs_name);
|
||||
cs_name);
|
||||
|
||||
return mysql_real_query(mysql, query_buffer, (ulong)query_length);
|
||||
}
|
||||
|
|
|
@ -1398,7 +1398,7 @@ static size_t log_header(char *message, size_t message_len,
|
|||
if (output_type == OUTPUT_SYSLOG)
|
||||
return my_snprintf(message, message_len,
|
||||
"%.*s,%.*s,%.*s,%d,%lld,%s",
|
||||
(unsigned int) serverhost_len, serverhost,
|
||||
(int) serverhost_len, serverhost,
|
||||
username_len, username,
|
||||
host_len, host,
|
||||
connection_id, query_id, operation);
|
||||
|
@ -1408,7 +1408,7 @@ static size_t log_header(char *message, size_t message_len,
|
|||
"%04d%02d%02d %02d:%02d:%02d,%.*s,%.*s,%.*s,%d,%lld,%s",
|
||||
tm_time.tm_year+1900, tm_time.tm_mon+1, tm_time.tm_mday,
|
||||
tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec,
|
||||
serverhost_len, serverhost,
|
||||
(int) serverhost_len, serverhost,
|
||||
username_len, username,
|
||||
host_len, host,
|
||||
connection_id, query_id, operation);
|
||||
|
@ -1477,7 +1477,7 @@ static int log_connection_event(const struct mysql_event_connection *event,
|
|||
event->ip, event->ip_length,
|
||||
event->thread_id, 0, type);
|
||||
csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize,
|
||||
",%.*s,,%d", event->database.length, event->database.str, event->status);
|
||||
",%.*s,,%d", (int) event->database.length, event->database.str, event->status);
|
||||
message[csize]= '\n';
|
||||
return write_log(message, csize + 1, 1);
|
||||
}
|
||||
|
@ -1909,9 +1909,9 @@ static int log_table(const struct connection_info *cn,
|
|||
event->host, SAFE_STRLEN_UI(event->host),
|
||||
event->ip, SAFE_STRLEN_UI(event->ip),
|
||||
event->thread_id, cn->query_id, type);
|
||||
csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize,
|
||||
",%.*s,%.*s,",event->database.length, event->database.str,
|
||||
event->table.length, event->table.str);
|
||||
csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize, ",%.*s,%.*s,",
|
||||
(int) event->database.length, event->database.str,
|
||||
(int) event->table.length, event->table.str);
|
||||
message[csize]= '\n';
|
||||
return write_log(message, csize + 1, 1);
|
||||
}
|
||||
|
@ -1932,10 +1932,11 @@ static int log_rename(const struct connection_info *cn,
|
|||
event->ip, SAFE_STRLEN_UI(event->ip),
|
||||
event->thread_id, cn->query_id, "RENAME");
|
||||
csize+= my_snprintf(message+csize, sizeof(message) - 1 - csize,
|
||||
",%.*s,%.*s|%.*s.%.*s,",event->database.length, event->database.str,
|
||||
event->table.length, event->table.str,
|
||||
event->new_database.length, event->new_database.str,
|
||||
event->new_table.length, event->new_table.str);
|
||||
",%.*s,%.*s|%.*s.%.*s,",
|
||||
(int) event->database.length, event->database.str,
|
||||
(int) event->table.length, event->table.str,
|
||||
(int) event->new_database.length, event->new_database.str,
|
||||
(int) event->new_table.length, event->new_table.str);
|
||||
message[csize]= '\n';
|
||||
return write_log(message, csize + 1, 1);
|
||||
}
|
||||
|
@ -3108,4 +3109,3 @@ exit:
|
|||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -6105,7 +6105,7 @@ bool Regexp_processor_pcre::compile(String *pattern, bool send_error)
|
|||
(PCRE2_UCHAR8 *)buff, sizeof(buff));
|
||||
if (lmsg >= 0)
|
||||
my_snprintf(buff+lmsg, sizeof(buff)-lmsg,
|
||||
" at offset %d", pcreErrorOffset);
|
||||
" at offset %zu", pcreErrorOffset);
|
||||
my_error(ER_REGEXP_ERROR, MYF(0), buff);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -185,8 +185,8 @@ String *Item_func_geometry_from_json::val_str(String *str)
|
|||
if (code)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, code,
|
||||
ER_THD(thd, code));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, code,
|
||||
ER_THD(thd, code));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -4231,9 +4231,9 @@ longlong Item_func_uncompressed_length::val_int()
|
|||
if (res->length() <= 4)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_ZLIB_Z_DATA_ERROR,
|
||||
ER_THD(thd, ER_ZLIB_Z_DATA_ERROR));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_ZLIB_Z_DATA_ERROR,
|
||||
ER_THD(thd, ER_ZLIB_Z_DATA_ERROR));
|
||||
null_value= 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -4350,7 +4350,7 @@ String *Item_func_uncompress::val_str(String *str)
|
|||
if (res->length() <= 4)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_ZLIB_Z_DATA_ERROR,
|
||||
ER_THD(thd, ER_ZLIB_Z_DATA_ERROR));
|
||||
goto err;
|
||||
|
|
|
@ -4036,7 +4036,7 @@ int Xid_apply_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
}
|
||||
}
|
||||
|
||||
general_log_print(thd, COM_QUERY, get_query());
|
||||
general_log_print(thd, COM_QUERY, "%s", get_query());
|
||||
thd->variables.option_bits&= ~OPTION_GTID_BEGIN;
|
||||
res= do_commit();
|
||||
if (!res && rgi->gtid_pending)
|
||||
|
@ -7845,7 +7845,7 @@ void issue_long_find_row_warning(Log_event_type type,
|
|||
"while looking up records to be processed. Consider adding a "
|
||||
"primary key (or unique key) to the table to improve "
|
||||
"performance.",
|
||||
evt_type, table_name, (long) delta, scan_type);
|
||||
evt_type, table_name, delta, scan_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ int decimal_operation_results(int result, const char *value, const char *type)
|
|||
value, type);
|
||||
break;
|
||||
case E_DEC_DIV_ZERO:
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_DIVISION_BY_ZERO, ER_THD(thd, ER_DIVISION_BY_ZERO));
|
||||
break;
|
||||
case E_DEC_BAD_NUM:
|
||||
|
|
|
@ -7059,7 +7059,7 @@ dbug_gtid_accept:
|
|||
"the last seen GTID is %u-%u-%llu",
|
||||
Log_event::get_type_str((Log_event_type) (uchar)
|
||||
buf[EVENT_TYPE_OFFSET]),
|
||||
mi->last_queued_gtid);
|
||||
PARAM_GTID(mi->last_queued_gtid));
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12115,9 +12115,9 @@ void Sql_cmd_grant::warn_hostname_requires_resolving(THD *thd,
|
|||
while ((user= it++))
|
||||
{
|
||||
if (opt_skip_name_resolve && hostname_requires_resolving(user->host.str))
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_WARN_HOSTNAME_WONT_WORK,
|
||||
ER_THD(thd, ER_WARN_HOSTNAME_WONT_WORK));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_WARN_HOSTNAME_WONT_WORK,
|
||||
ER_THD(thd, ER_WARN_HOSTNAME_WONT_WORK));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13295,7 +13295,7 @@ static bool secure_auth(THD *thd)
|
|||
else
|
||||
{
|
||||
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
|
||||
general_log_print(thd, COM_CONNECT,
|
||||
general_log_print(thd, COM_CONNECT, "%s",
|
||||
ER_THD(thd, ER_NOT_SUPPORTED_AUTH_MODE));
|
||||
}
|
||||
return 1;
|
||||
|
@ -13368,7 +13368,7 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio,
|
|||
if (switch_from_short_to_long_scramble)
|
||||
{
|
||||
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT,
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT, "%s",
|
||||
ER_THD(mpvio->auth_info.thd, ER_NOT_SUPPORTED_AUTH_MODE));
|
||||
DBUG_RETURN (1);
|
||||
}
|
||||
|
@ -13458,7 +13458,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
|
|||
!ignore_max_password_errors(mpvio->acl_user))
|
||||
{
|
||||
my_error(ER_USER_IS_BLOCKED, MYF(0));
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT,
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT, "%s",
|
||||
ER_THD(mpvio->auth_info.thd, ER_USER_IS_BLOCKED));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
@ -13473,7 +13473,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio)
|
|||
DBUG_ASSERT(my_strcasecmp(system_charset_info,
|
||||
mpvio->acl_user->auth->plugin.str, old_password_plugin_name.str));
|
||||
my_error(ER_NOT_SUPPORTED_AUTH_MODE, MYF(0));
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT,
|
||||
general_log_print(mpvio->auth_info.thd, COM_CONNECT, "%s",
|
||||
ER_THD(mpvio->auth_info.thd, ER_NOT_SUPPORTED_AUTH_MODE));
|
||||
DBUG_RETURN (1);
|
||||
}
|
||||
|
@ -15019,5 +15019,3 @@ extern "C" void maria_update_hostname(
|
|||
*ip_mask= h.ip_mask;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ void set_thd_stage_info(void *thd,
|
|||
|
||||
#include "wsrep.h"
|
||||
#include "wsrep_on.h"
|
||||
#ifdef WITH_WSREP
|
||||
#include <inttypes.h>
|
||||
#ifdef WITH_WSREP
|
||||
/* wsrep-lib */
|
||||
#include "wsrep_client_service.h"
|
||||
#include "wsrep_client_state.h"
|
||||
|
|
|
@ -1838,10 +1838,8 @@ bool add_table_for_trigger(THD *thd,
|
|||
{
|
||||
if (if_exists)
|
||||
{
|
||||
push_warning_printf(thd,
|
||||
Sql_condition::WARN_LEVEL_NOTE,
|
||||
ER_TRG_DOES_NOT_EXIST,
|
||||
ER_THD(thd, ER_TRG_DOES_NOT_EXIST));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_NOTE,
|
||||
ER_TRG_DOES_NOT_EXIST, ER_THD(thd, ER_TRG_DOES_NOT_EXIST));
|
||||
|
||||
*table= NULL;
|
||||
|
||||
|
|
|
@ -687,7 +687,7 @@ public:
|
|||
{
|
||||
return m_usec ?
|
||||
my_snprintf(to, nbytes, "%s%llu.%06lu",
|
||||
m_neg ? "-" : "", m_sec, (uint) m_usec) :
|
||||
m_neg ? "-" : "", m_sec, m_usec) :
|
||||
my_snprintf(to, nbytes, "%s%llu", m_neg ? "-" : "", m_sec);
|
||||
}
|
||||
void make_truncated_warning(THD *thd, const char *type_str) const;
|
||||
|
|
|
@ -2224,17 +2224,17 @@ master_def:
|
|||
|
||||
if (unlikely(Lex->mi.heartbeat_period > slave_net_timeout))
|
||||
{
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
|
||||
ER_THD(thd, ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX,
|
||||
ER_THD(thd, ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX));
|
||||
}
|
||||
if (unlikely(Lex->mi.heartbeat_period < 0.001))
|
||||
{
|
||||
if (unlikely(Lex->mi.heartbeat_period != 0.0))
|
||||
{
|
||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
|
||||
ER_THD(thd, ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN,
|
||||
ER_THD(thd, ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN));
|
||||
Lex->mi.heartbeat_period= 0.0;
|
||||
}
|
||||
Lex->mi.heartbeat_opt= LEX_MASTER_INFO::LEX_MI_DISABLE;
|
||||
|
|
85
sql/table.cc
85
sql/table.cc
|
@ -3830,50 +3830,54 @@ static void print_long_unique_table(TABLE *table)
|
|||
" fields->offset,field->null_bit, field->null_pos and key_info ... \n"
|
||||
"\nPrinting Table keyinfo\n");
|
||||
str.append(buff, strlen(buff));
|
||||
my_snprintf(buff, sizeof(buff), "\ntable->s->reclength %d\n"
|
||||
"table->s->fields %d\n",
|
||||
my_snprintf(buff, sizeof(buff), "\ntable->s->reclength %lu\n"
|
||||
"table->s->fields %u\n",
|
||||
table->s->reclength, table->s->fields);
|
||||
str.append(buff, strlen(buff));
|
||||
for (uint i= 0; i < table->s->keys; i++)
|
||||
{
|
||||
key_info_table= table->key_info + i;
|
||||
key_info_share= table->s->key_info + i;
|
||||
my_snprintf(buff, sizeof(buff), "\ntable->key_info[%d] user_defined_key_parts = %d\n"
|
||||
"table->key_info[%d] algorithm == HA_KEY_ALG_LONG_HASH = %d\n"
|
||||
"table->key_info[%d] flags & HA_NOSAME = %d\n",
|
||||
i, key_info_table->user_defined_key_parts,
|
||||
i, key_info_table->algorithm == HA_KEY_ALG_LONG_HASH,
|
||||
i, key_info_table->flags & HA_NOSAME);
|
||||
my_snprintf(buff, sizeof(buff),
|
||||
"\ntable->key_info[%u] user_defined_key_parts = %u\n"
|
||||
"table->key_info[%u] algorithm == HA_KEY_ALG_LONG_HASH = %d\n"
|
||||
"table->key_info[%u] flags & HA_NOSAME = %lu\n",
|
||||
i, key_info_table->user_defined_key_parts,
|
||||
i, key_info_table->algorithm == HA_KEY_ALG_LONG_HASH,
|
||||
i, key_info_table->flags & HA_NOSAME);
|
||||
str.append(buff, strlen(buff));
|
||||
my_snprintf(buff, sizeof(buff), "\ntable->s->key_info[%d] user_defined_key_parts = %d\n"
|
||||
"table->s->key_info[%d] algorithm == HA_KEY_ALG_LONG_HASH = %d\n"
|
||||
"table->s->key_info[%d] flags & HA_NOSAME = %d\n",
|
||||
i, key_info_share->user_defined_key_parts,
|
||||
i, key_info_share->algorithm == HA_KEY_ALG_LONG_HASH,
|
||||
i, key_info_share->flags & HA_NOSAME);
|
||||
my_snprintf(buff, sizeof(buff),
|
||||
"\ntable->s->key_info[%u] user_defined_key_parts = %u\n"
|
||||
"table->s->key_info[%u] algorithm == HA_KEY_ALG_LONG_HASH = %d\n"
|
||||
"table->s->key_info[%u] flags & HA_NOSAME = %lu\n",
|
||||
i, key_info_share->user_defined_key_parts,
|
||||
i, key_info_share->algorithm == HA_KEY_ALG_LONG_HASH,
|
||||
i, key_info_share->flags & HA_NOSAME);
|
||||
str.append(buff, strlen(buff));
|
||||
key_part = key_info_table->key_part;
|
||||
my_snprintf(buff, sizeof(buff), "\nPrinting table->key_info[%d].key_part[0] info\n"
|
||||
"key_part->offset = %d\n"
|
||||
"key_part->field_name = %s\n"
|
||||
"key_part->length = %d\n"
|
||||
"key_part->null_bit = %d\n"
|
||||
"key_part->null_offset = %d\n",
|
||||
i, key_part->offset, key_part->field->field_name.str, key_part->length,
|
||||
key_part->null_bit, key_part->null_offset);
|
||||
my_snprintf(buff, sizeof(buff),
|
||||
"\nPrinting table->key_info[%u].key_part[0] info\n"
|
||||
"key_part->offset = %u\n"
|
||||
"key_part->field_name = %s\n"
|
||||
"key_part->length = %u\n"
|
||||
"key_part->null_bit = %u\n"
|
||||
"key_part->null_offset = %u\n",
|
||||
i, key_part->offset, key_part->field->field_name.str, key_part->length,
|
||||
key_part->null_bit, key_part->null_offset);
|
||||
str.append(buff, strlen(buff));
|
||||
|
||||
for (uint j= 0; j < key_info_share->user_defined_key_parts; j++)
|
||||
{
|
||||
key_part= key_info_share->key_part + j;
|
||||
my_snprintf(buff, sizeof(buff), "\nPrinting share->key_info[%d].key_part[%d] info\n"
|
||||
"key_part->offset = %d\n"
|
||||
"key_part->field_name = %s\n"
|
||||
"key_part->length = %d\n"
|
||||
"key_part->null_bit = %d\n"
|
||||
"key_part->null_offset = %d\n",
|
||||
i,j,key_part->offset, key_part->field->field_name.str, key_part->length,
|
||||
key_part->null_bit, key_part->null_offset);
|
||||
my_snprintf(buff, sizeof(buff),
|
||||
"\nPrinting share->key_info[%u].key_part[%u] info\n"
|
||||
"key_part->offset = %u\n"
|
||||
"key_part->field_name = %s\n"
|
||||
"key_part->length = %u\n"
|
||||
"key_part->null_bit = %u\n"
|
||||
"key_part->null_offset = %u\n",
|
||||
i, j, key_part->offset, key_part->field->field_name.str,
|
||||
key_part->length, key_part->null_bit, key_part->null_offset);
|
||||
str.append(buff, strlen(buff));
|
||||
}
|
||||
}
|
||||
|
@ -3882,16 +3886,17 @@ static void print_long_unique_table(TABLE *table)
|
|||
for(uint i= 0; i < table->s->fields; i++)
|
||||
{
|
||||
field= table->field[i];
|
||||
my_snprintf(buff, sizeof(buff), "\ntable->field[%d]->field_name %s\n"
|
||||
"table->field[%d]->offset = %d\n"
|
||||
"table->field[%d]->field_length = %d\n"
|
||||
"table->field[%d]->null_pos wrt to record 0 = %d\n"
|
||||
"table->field[%d]->null_bit_pos = %d\n",
|
||||
i, field->field_name.str,
|
||||
i, field->ptr- table->record[0],
|
||||
i, field->pack_length(),
|
||||
i, field->null_bit ? field->null_ptr - table->record[0] : -1,
|
||||
i, field->null_bit);
|
||||
my_snprintf(buff, sizeof(buff),
|
||||
"\ntable->field[%u]->field_name %s\n"
|
||||
"table->field[%u]->offset = %" PRIdPTR "\n" // `%td` not available
|
||||
"table->field[%u]->field_length = %d\n"
|
||||
"table->field[%u]->null_pos wrt to record 0 = %" PRIdPTR "\n"
|
||||
"table->field[%u]->null_bit_pos = %d\n",
|
||||
i, field->field_name.str,
|
||||
i, field->ptr- table->record[0],
|
||||
i, field->pack_length(),
|
||||
i, field->null_bit ? field->null_ptr - table->record[0] : -1,
|
||||
i, field->null_bit);
|
||||
str.append(buff, strlen(buff));
|
||||
}
|
||||
(*error_handler_hook)(1, str.ptr(), ME_NOTE);
|
||||
|
|
|
@ -986,7 +986,7 @@ bool wsrep_max_ws_size_update(sys_var *self, THD *thd, enum_var_type)
|
|||
{
|
||||
char max_ws_size_opt[128];
|
||||
my_snprintf(max_ws_size_opt, sizeof(max_ws_size_opt),
|
||||
"repl.max_ws_size=%d", wsrep_max_ws_size);
|
||||
"repl.max_ws_size=%lu", wsrep_max_ws_size);
|
||||
enum wsrep::provider::status ret= Wsrep_server_state::instance().provider().options(max_ws_size_opt);
|
||||
if (ret)
|
||||
{
|
||||
|
|
|
@ -11343,7 +11343,7 @@ create_table_info_t::check_table_options()
|
|||
push_warning_printf(
|
||||
m_thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
HA_WRONG_CREATE_OPTION,
|
||||
"InnoDB: invalid PAGE_COMPRESSION_LEVEL = %lu."
|
||||
"InnoDB: invalid PAGE_COMPRESSION_LEVEL = %llu."
|
||||
" Valid values are [1, 2, 3, 4, 5, 6, 7, 8, 9]",
|
||||
options->page_compression_level);
|
||||
return "PAGE_COMPRESSION_LEVEL";
|
||||
|
@ -21550,7 +21550,7 @@ ib_foreign_warn(trx_t* trx, /*!< in: trx */
|
|||
if (trx && trx->mysql_thd) {
|
||||
THD* thd = (THD*)trx->mysql_thd;
|
||||
|
||||
push_warning_printf(
|
||||
push_warning(
|
||||
thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
uint(convert_error_code_to_mysql(error, 0, thd)), buf);
|
||||
}
|
||||
|
|
|
@ -877,7 +877,7 @@ corrupted:
|
|||
+ block->frame);
|
||||
const trx_id_t trx_id= mach_read_from_8(undo_header + TRX_UNDO_TRX_ID);
|
||||
if (trx_id >> 48) {
|
||||
sql_print_error("InnoDB: corrupted TRX_ID %llx", trx_id);
|
||||
sql_print_error("InnoDB: corrupted TRX_ID %" PRIx64, trx_id);
|
||||
goto corrupted;
|
||||
}
|
||||
/* We will increment rseg->needs_purge, like trx_undo_reuse_cached()
|
||||
|
@ -913,7 +913,7 @@ corrupted:
|
|||
read_trx_no:
|
||||
trx_no = mach_read_from_8(TRX_UNDO_TRX_NO + undo_header);
|
||||
if (trx_no >> 48) {
|
||||
sql_print_error("InnoDB: corrupted TRX_NO %llx",
|
||||
sql_print_error("InnoDB: corrupted TRX_NO %" PRIx64,
|
||||
trx_no);
|
||||
goto corrupted;
|
||||
}
|
||||
|
|
|
@ -1162,7 +1162,7 @@ my_bool s3_rename_object(ms3_st *s3_client, const char *aws_bucket,
|
|||
if (!(errmsg= ms3_server_error(s3_client)))
|
||||
errmsg= ms3_error(error);
|
||||
|
||||
my_printf_error(EE_READ, "Got error from move_object(%s -> %s): %d %",
|
||||
my_printf_error(EE_READ, "Got error from move_object(%s -> %s): %d %s",
|
||||
error_flags,
|
||||
from_name, to_name, error, errmsg);
|
||||
}
|
||||
|
|
|
@ -693,7 +693,7 @@ namespace mrn {
|
|||
"data: <%.*s>",
|
||||
normalized_length,
|
||||
UINT_MAX16,
|
||||
field->field_name,
|
||||
field->field_name.str,
|
||||
blob_data_length, blob_data);
|
||||
memcpy(grn_key, normalized, blob_data_length);
|
||||
new_blob_data_length = blob_data_length;
|
||||
|
|
|
@ -1488,7 +1488,7 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
|
|||
param->db_name= table->s->db.str;
|
||||
param->table_name= table->s->table_name.str;
|
||||
param->testflag= 0;
|
||||
mi_check_print_error(param, errmsg);
|
||||
mi_check_print_error(param, "%s", errmsg);
|
||||
}
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
@ -1554,7 +1554,7 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
|
|||
param->db_name= table->s->db.str;
|
||||
param->table_name= table->s->table_name.str;
|
||||
param->testflag= 0;
|
||||
mi_check_print_error(param, errmsg);
|
||||
mi_check_print_error(param, "%s", errmsg);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -874,7 +874,7 @@ static int chk_index(HA_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
|
|||
if (keypos != endpos)
|
||||
{
|
||||
mi_check_print_error(param,"Keyblock size at page %s is not correct. Block length: %d key length: %d",
|
||||
llstr(page,llbuff), used_length, (keypos - buff));
|
||||
llstr(page,llbuff), used_length, (int) (keypos - buff));
|
||||
goto err;
|
||||
}
|
||||
my_afree((uchar*) temp_buff);
|
||||
|
@ -1167,7 +1167,7 @@ int chk_data_link(HA_CHECK *param, MI_INFO *info, my_bool extend)
|
|||
block_info.rec_len > (uint) info->s->max_pack_length)
|
||||
{
|
||||
mi_check_print_error(param,
|
||||
"Found block with wrong recordlength: %d at %s",
|
||||
"Found block with wrong recordlength: %lu at %s",
|
||||
block_info.rec_len, llstr(start_recpos,llbuff));
|
||||
got_error=1;
|
||||
break;
|
||||
|
@ -3389,7 +3389,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
|
|||
{
|
||||
if (!searching)
|
||||
mi_check_print_info(param,
|
||||
"Deleted block with impossible length %u at %s",
|
||||
"Deleted block with impossible length %lu at %s",
|
||||
block_info.block_len,llstr(pos,llbuff));
|
||||
error=1;
|
||||
}
|
||||
|
@ -3625,7 +3625,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
|
|||
block_info.rec_len > (uint) share->max_pack_length)
|
||||
{
|
||||
if (! searching)
|
||||
mi_check_print_info(param,"Found block with wrong recordlength: %d at %s\n",
|
||||
mi_check_print_info(param,"Found block with wrong recordlength: %ld at %s\n",
|
||||
block_info.rec_len,
|
||||
llstr(sort_param->pos,llbuff));
|
||||
continue;
|
||||
|
@ -4133,7 +4133,7 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param)
|
|||
if (info->s->options & HA_OPTION_COMPRESS_RECORD)
|
||||
{
|
||||
mi_check_print_error(param,
|
||||
"Recover aborted; Can't run standard recovery on compressed tables with errors in data-file. Use switch 'myisamchk --safe-recover' to fix it\n",stderr);;
|
||||
"Recover aborted; Can't run standard recovery on compressed tables with errors in data-file. Use switch 'myisamchk --safe-recover' to fix it\n");
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -1578,7 +1578,7 @@ static int mi_sort_records(HA_CHECK *param,
|
|||
share->state.key_root[sort_key],
|
||||
MYF(MY_NABP+MY_WME)))
|
||||
{
|
||||
mi_check_print_error(param,"Can't read indexpage from filepos: %s",
|
||||
mi_check_print_error(param,"Can't read indexpage from filepos: %lu",
|
||||
(ulong) share->state.key_root[sort_key]);
|
||||
goto err;
|
||||
}
|
||||
|
|
|
@ -318,7 +318,7 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg)
|
|||
{
|
||||
DBUG_PRINT( "oq-debug", ("Allowing integer no more!"));
|
||||
badColumn = true;
|
||||
push_warning_printf( current_thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Integer latch is not supported for new tables.", i);
|
||||
push_warning(current_thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Integer latch is not supported for new tables.");
|
||||
} else
|
||||
/* Check Column Type */
|
||||
if ((*field)->type() != skel[i].coltype) {
|
||||
|
|
|
@ -2315,7 +2315,7 @@ int spider_db_mbase::fetch_and_print_warnings(struct tm *l_time)
|
|||
longlong res_num =
|
||||
(longlong) my_strtoll10(row[1], (char**) NULL, &error_num);
|
||||
DBUG_PRINT("info",("spider res_num=%lld", res_num));
|
||||
my_printf_error((int) res_num, row[2], MYF(0));
|
||||
my_printf_error((int) res_num, "%s", MYF(0), row[2]);
|
||||
error_num = (int) res_num;
|
||||
row = mysql_fetch_row(res);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue