diff options
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 23af38cee2d..2c55fc381b1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -93,7 +93,7 @@ static void add_load_option(DYNAMIC_STRING *str, const char *option, const char *option_value); static ulong find_set(TYPELIB *, const char *, size_t, char **, uint *); -static char *alloc_query_str(ulong size); +static char *alloc_query_str(size_t size); static void field_escape(DYNAMIC_STRING* in, const char *from); static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_med= 1, @@ -171,7 +171,7 @@ wrappers, they will terminate the process if there is an allocation failure. */ static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, - uint init_alloc, uint alloc_increment); + size_t init_alloc, size_t alloc_increment); static void dynstr_append_checked(DYNAMIC_STRING* dest, const char* src); static void dynstr_set_checked(DYNAMIC_STRING *str, const char *init_str); static void dynstr_append_mem_checked(DYNAMIC_STRING *str, const char *append, @@ -1283,8 +1283,8 @@ get_binlog_gtid_pos(char *binlog_pos_file, char *binlog_pos_offset, if (len_pos_file >= FN_REFLEN || len_pos_offset > LONGLONG_LEN) return 0; - mysql_real_escape_string(mysql, file_buf, binlog_pos_file, len_pos_file); - mysql_real_escape_string(mysql, offset_buf, binlog_pos_offset, len_pos_offset); + mysql_real_escape_string(mysql, file_buf, binlog_pos_file, (ulong)len_pos_file); + mysql_real_escape_string(mysql, offset_buf, binlog_pos_offset, (ulong)len_pos_offset); init_dynamic_string_checked(&query, "SELECT BINLOG_GTID_POS('", 256, 1024); dynstr_append_checked(&query, file_buf); dynstr_append_checked(&query, "', '"); @@ -1531,7 +1531,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name) "SET SESSION character_set_results = '%s'", (const char *) cs_name); - return mysql_real_query(mysql, query_buffer, query_length); + return mysql_real_query(mysql, query_buffer, (ulong)query_length); } /** @@ -2715,7 +2715,7 @@ static uint get_table_structure(char *table, char *db, char *table_type, "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE " "TABLE_SCHEMA = %s AND TABLE_NAME = %s"; FILE *sql_file= md_result_file; - int len; + size_t len; my_bool is_log_table; MYSQL_RES *result; MYSQL_ROW row; @@ -3618,7 +3618,7 @@ static void field_escape(DYNAMIC_STRING* in, const char *from) -static char *alloc_query_str(ulong size) +static char *alloc_query_str(size_t size) { char *query; @@ -3653,8 +3653,10 @@ static void dump_table(char *table, char *db) char table_type[NAME_LEN]; char *result_table, table_buff2[NAME_LEN*2+3], *opt_quoted_table; int error= 0; - ulong rownr, row_break, total_length, init_length; + ulong rownr, row_break; uint num_fields; + size_t total_length, init_length; + MYSQL_RES *res; MYSQL_FIELD *field; MYSQL_ROW row; @@ -3778,7 +3780,7 @@ static void dump_table(char *table, char *db) order_by= 0; } - if (mysql_real_query(mysql, query_string.str, query_string.length)) + if (mysql_real_query(mysql, query_string.str, (ulong)query_string.length)) { dynstr_free(&query_string); DB_error(mysql, "when executing 'SELECT INTO OUTFILE'"); @@ -4066,7 +4068,7 @@ static void dump_table(char *table, char *db) if (extended_insert) { - ulong row_length; + size_t row_length; dynstr_append_checked(&extended_row,")"); row_length= 2 + extended_row.length; if (total_length + row_length < opt_net_buffer_length) @@ -4645,7 +4647,7 @@ static int dump_all_tables_in_db(char *database) dynstr_append_checked(&query, " READ /*!32311 LOCAL */,"); } } - if (numrows && mysql_real_query(mysql, query.str, query.length-1)) + if (numrows && mysql_real_query(mysql, query.str, (ulong)query.length-1)) { dynstr_free(&query); DB_error(mysql, "when using LOCK TABLES"); @@ -4828,7 +4830,7 @@ static my_bool dump_all_views_in_db(char *database) dynstr_append_checked(&query, " READ /*!32311 LOCAL */,"); } } - if (numrows && mysql_real_query(mysql, query.str, query.length-1)) + if (numrows && mysql_real_query(mysql, query.str, (ulong)query.length-1)) DB_error(mysql, "when using LOCK TABLES"); /* We shall continue here, if --force was given */ dynstr_free(&query); @@ -5024,7 +5026,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) !my_strcasecmp(&my_charset_latin1, db, PERFORMANCE_SCHEMA_DB_NAME))) { if (mysql_real_query(mysql, lock_tables_query.str, - lock_tables_query.length-1)) + (ulong)lock_tables_query.length-1)) { if (!ignore_errors) { @@ -5690,7 +5692,7 @@ static char *primary_key_fields(const char *table_name) MYSQL_ROW row; /* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */ char show_keys_buff[15 + NAME_LEN * 2 + 3]; - uint result_length= 0; + size_t result_length= 0; char *result= 0; char buff[NAME_LEN * 2 + 3]; char *quoted_field; @@ -6008,7 +6010,7 @@ static my_bool get_view_structure(char *table, char* db) #define DYNAMIC_STR_ERROR_MSG "Couldn't perform DYNAMIC_STRING operation" static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, - uint init_alloc, uint alloc_increment) + size_t init_alloc, size_t alloc_increment) { if (init_dynamic_string(str, init_str, init_alloc, alloc_increment)) die(EX_MYSQLERR, DYNAMIC_STR_ERROR_MSG); |