From eca5a6fb62fb7cbf78ae54e45102c0a014061b8f Mon Sep 17 00:00:00 2001 From: ParadoxV5 Date: Wed, 28 Aug 2024 20:00:15 -0600 Subject: [PATCH] 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. --- client/mysqldump.c | 2 +- sql/item_geofunc.cc | 4 +- sql/item_strfunc.cc | 8 +- sql/log_event_server.cc | 4 +- sql/my_decimal.cc | 2 +- sql/slave.cc | 2 +- sql/sql_acl.cc | 16 ++-- sql/sql_class.h | 2 +- sql/sql_trigger.cc | 6 +- sql/sql_yacc.yy | 12 +-- sql/table.cc | 85 ++++++++++--------- storage/innobase/handler/ha_innodb.cc | 8 +- storage/innobase/trx/trx0undo.cc | 4 +- storage/maria/s3_func.c | 2 +- .../lib/mrn_multiple_column_key_codec.cpp | 2 +- storage/myisam/ha_myisam.cc | 4 +- storage/myisam/mi_check.c | 10 +-- storage/myisam/myisamchk.c | 2 +- storage/oqgraph/ha_oqgraph.cc | 2 +- storage/spider/spd_db_mysql.cc | 2 +- 20 files changed, 90 insertions(+), 89 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 7ebf072890049..fbe5ac687654c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -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); } diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 5160bfdc4bb3f..18e59fecb5336 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -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; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 4a54cf06b925f..10f7dcd9851d9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -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; diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index d8056fd437815..82d30369f09e3 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -4042,7 +4042,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) @@ -7852,7 +7852,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); } } } diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index edf3e82de408d..f35df43d044e9 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -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: diff --git a/sql/slave.cc b/sql/slave.cc index f258f9f35953e..0ddae351cb3e1 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -7041,7 +7041,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) "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; } } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index acbb9fa6d388d..c1eab5d587e95 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -12100,9 +12100,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)); } } @@ -13280,7 +13280,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; @@ -13353,7 +13353,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); } @@ -13443,7 +13443,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); } @@ -13458,7 +13458,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); } @@ -15004,5 +15004,3 @@ extern "C" void maria_update_hostname( *ip_mask= h.ip_mask; #endif } - - diff --git a/sql/sql_class.h b/sql/sql_class.h index 08a0466538307..0871710b194c3 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -67,8 +67,8 @@ void set_thd_stage_info(void *thd, #include "wsrep.h" #include "wsrep_on.h" -#ifdef WITH_WSREP #include +#ifdef WITH_WSREP /* wsrep-lib */ #include "wsrep_client_service.h" #include "wsrep_client_state.h" diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 4f9c71d2bab67..c788d66744ad0 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -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; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 155424a3c2184..9aab9f97fe0f1 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -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; diff --git a/sql/table.cc b/sql/table.cc index 74b478cb81600..cfad7fb59e413 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -3829,50 +3829,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)); } } @@ -3881,16 +3885,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); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d249cb205f412..e53d22f7bb035 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11329,7 +11329,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"; @@ -21469,7 +21469,7 @@ ib_push_warning( buf[MAX_BUF_SIZE - 1] = 0; vsnprintf(buf, MAX_BUF_SIZE - 1, format, args); - push_warning_printf( + push_warning( thd, Sql_condition::WARN_LEVEL_WARN, uint(convert_error_code_to_mysql(error, 0, thd)), buf); my_free(buf); @@ -21501,7 +21501,7 @@ ib_push_warning( buf[MAX_BUF_SIZE - 1] = 0; vsnprintf(buf, MAX_BUF_SIZE - 1, format, args); - push_warning_printf( + push_warning( thd, Sql_condition::WARN_LEVEL_WARN, uint(convert_error_code_to_mysql(error, 0, thd)), buf); my_free(buf); @@ -21547,7 +21547,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); } diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc index bb327f6cc9da0..ccd0838fec88f 100644 --- a/storage/innobase/trx/trx0undo.cc +++ b/storage/innobase/trx/trx0undo.cc @@ -877,7 +877,7 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no) + 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 @@ trx_undo_mem_create_at_db_start(trx_rseg_t *rseg, ulint id, uint32_t page_no) 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; } diff --git a/storage/maria/s3_func.c b/storage/maria/s3_func.c index 3d18ba8800de4..84e46cf944dbe 100644 --- a/storage/maria/s3_func.c +++ b/storage/maria/s3_func.c @@ -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); } diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp index dd3165cdadfea..5114544013566 100644 --- a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp @@ -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; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index c5d13273b2357..f922d274927a8 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1477,7 +1477,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); } @@ -1543,7 +1543,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); } } diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 33fab259a9cc6..c4389d3cfa857 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -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); } diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index 4344ce1142037..3f504a2ea44a3 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -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; } diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 11bb139fd55c4..415ac292c3528 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -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) { diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc index 04f4bfd22ee04..be3d85c7465e7 100644 --- a/storage/spider/spd_db_mysql.cc +++ b/storage/spider/spd_db_mysql.cc @@ -2305,7 +2305,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); }