diff options
author | Sergei Golubchik <serg@mysql.com> | 2009-05-04 22:33:23 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mysql.com> | 2009-05-04 22:33:23 +0200 |
commit | e85cd1987fc3c1ad35b4d58e8d977aaa5eadc4f0 (patch) | |
tree | 2c7fffd24732e835d1f2922055e690988dff453b | |
parent | 973c7793c351aa7dbcd5907b4cb18ef94a799c0d (diff) | |
download | mariadb-git-e85cd1987fc3c1ad35b4d58e8d977aaa5eadc4f0.tar.gz |
bug#44166
removed few sprintf's
-rw-r--r-- | sql/item.cc | 14 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 6 | ||||
-rw-r--r-- | sql/unireg.cc | 3 |
4 files changed, 11 insertions, 14 deletions
diff --git a/sql/item.cc b/sql/item.cc index d1418b9a137..4d9dc50226f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3390,14 +3390,12 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, current->mark_as_dependent(last); if (thd->lex->describe & DESCRIBE_EXTENDED) { - char warn_buff[MYSQL_ERRMSG_SIZE]; - sprintf(warn_buff, ER(ER_WARN_FIELD_RESOLVED), - db_name, (db_name[0] ? "." : ""), - table_name, (table_name [0] ? "." : ""), - resolved_item->field_name, - current->select_number, last->select_number); - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_WARN_FIELD_RESOLVED, warn_buff); + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_WARN_FIELD_RESOLVED, ER(ER_WARN_FIELD_RESOLVED), + db_name, (db_name[0] ? "." : ""), + table_name, (table_name [0] ? "." : ""), + resolved_item->field_name, + current->select_number, last->select_number); } } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 29d43155778..2744619e138 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3126,7 +3126,7 @@ static bool prepare_blob_field(THD *thd, Create_field *sql_field) } sql_field->sql_type= MYSQL_TYPE_BLOB; sql_field->flags|= BLOB_FLAG; - sprintf(warn_buff, ER(ER_AUTO_CONVERT), sql_field->field_name, + my_snprintf(warn_buff, sizeof(warn_buff), ER(ER_AUTO_CONVERT), sql_field->field_name, (sql_field->charset == &my_charset_bin) ? "VARBINARY" : "VARCHAR", (sql_field->charset == &my_charset_bin) ? "BLOB" : "TEXT"); push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_AUTO_CONVERT, diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b3bd5d0bc57..1a8c43f46aa 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -818,7 +818,7 @@ int mysql_update(THD *thd, if (error < 0) { char buff[STRING_BUFFER_USUAL_SIZE]; - sprintf(buff, ER(ER_UPDATE_INFO), (ulong) found, (ulong) updated, + my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), (ulong) found, (ulong) updated, (ulong) thd->cuted_fields); thd->row_count_func= (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; @@ -2066,8 +2066,8 @@ bool multi_update::send_eof() id= thd->arg_of_last_insert_id_function ? thd->first_successful_insert_id_in_prev_stmt : 0; - sprintf(buff, ER(ER_UPDATE_INFO), (ulong) found, (ulong) updated, - (ulong) thd->cuted_fields); + my_snprintf(buff, sizeof(buff), ER(ER_UPDATE_INFO), + (ulong) found, (ulong) updated, (ulong) thd->cuted_fields); thd->row_count_func= (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; ::my_ok(thd, (ulong) thd->row_count_func, id, buff); diff --git a/sql/unireg.cc b/sql/unireg.cc index 51293184ad8..68a352e4a44 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -37,8 +37,7 @@ static bool pack_header(uchar *forminfo,enum legacy_db_type table_type, List<Create_field> &create_fields, uint info_length, uint screens, uint table_options, ulong data_offset, handler *file); -static uint get_interval_id(uint *int_count,List<Create_field> &create_fields, - Create_field *last_field); +static uint get_interval_id(uint *,List<Create_field> &, Create_field *); static bool pack_fields(File file, List<Create_field> &create_fields, ulong data_offset); static bool make_empty_rec(THD *thd, int file, enum legacy_db_type table_type, |