Commit 1e87cfee authored by unknown's avatar unknown
Browse files

Fixed compiler warnings (Mostly VC++):

- Removed not used variables
- Changed some ulong parameters/variables to ulonglong (possible serious bug)
- Added casts to get rid of safe assignment from longlong to long (and similar)
- Added casts to function parameters
- Fixed signed/unsigned compares
- Added some constructores to structures
- Removed some not portable constructs

Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
(Added new parameter to net_clear() to define when we want the communication buffer to be emptied)


client/mysql.cc:
  Removed not used variable
client/mysqldump.c:
  Fixed compiler warning
client/mysqlslap.c:
  Fixed compiler warning
client/mysqltest.c:
  Fixed compiler warning
extra/replace.c:
  Fixed compiler warning
include/my_global.h:
  Fixed compiler warning
include/mysql_com.h:
  Changed prototype for net_clear()
libmysql/libmysql.c:
  Changed prototype for net_clear()
mysys/base64.c:
  Fixed compiler warning (function definition and prototype didn't match)
mysys/my_thr_init.c:
  AFter merge fixes
mysys/my_vle.c:
  Fixed compiler warning
sql/event_data_objects.cc:
  Fixed compiler warning
sql/event_scheduler.cc:
  Removed not used variable
sql/field.cc:
  Removed not used variables
  Fixed compiler warning
sql/gen_lex_hash.cc:
  Fixed compiler warning
sql/ha_partition.h:
  Fixed compiler warning
sql/handler.cc:
  Fixed compiler warning
sql/item.cc:
  Fixed compiler warning
sql/item_create.cc:
  Fixed compiler warning
sql/item_func.cc:
  Fixed compiler warning
sql/item_strfunc.cc:
  Fixed compiler warning
sql/item_timefunc.cc:
  Fixed compiler warning
sql/item_xmlfunc.cc:
  Fixed compiler warning
sql/log.cc:
  Fixed compiler warning
sql/log_event.cc:
  Fixed compiler warning
sql/log_event.h:
  Fixed compiler warning
sql/mysql_priv.h:
  Fixed too short 'select_type'
sql/net_serv.cc:
  Added argument to net_clear() if we should empty the communication buffer.
sql/opt_range.cc:
  Fixed compiler warning
sql/partition_info.cc:
  Fixed compiler warning
sql/rpl_injector.h:
  Fixed compiler warning
sql/set_var.cc:
  Fixed compiler warning
sql/slave.cc:
  Fixed compiler warning
sql/sp_head.cc:
  Fixed compiler warning
sql/sql_base.cc:
  Fixed compiler warning
sql/sql_db.cc:
  Fixed compiler warning
sql/sql_delete.cc:
  Fixed compiler warning
sql/sql_insert.cc:
  Fixed compiler warning
sql/sql_lex.h:
  Fixed compiler warning
sql/sql_parse.cc:
  Fixed compiler warning
sql/sql_partition.cc:
  Fixed compiler warning
sql/sql_plugin.cc:
  Fixed compiler warning
sql/sql_prepare.cc:
  Fixed compiler warning
sql/sql_rename.cc:
  Fixed compiler warning
sql/sql_select.cc:
  Fixed compiler warning
sql/sql_show.cc:
  Fixed compiler warning
sql/sql_table.cc:
  Fixed compiler warning
sql/sql_trigger.cc:
  Fixed compiler warning
sql-common/client.c:
  Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
sql-common/my_time.c:
  Fixed compiler warning
sql/sql_union.cc:
  Fixed compiler warning
sql/sql_update.cc:
  Fixed compiler warning
sql/sql_view.cc:
  Fixed compiler warning
sql/sql_yacc.yy:
  Fixed compiler warning
sql/table.cc:
  Fixed compiler warning
storage/archive/azio.c:
  Fixed compiler warning
storage/csv/ha_tina.cc:
  Removed not used code
storage/myisam/mi_unique.c:
  Fixed compiler warning
storage/ndb/include/util/OutputStream.hpp:
  Fixed compiler warning
storage/ndb/include/util/SocketAuthenticator.hpp:
  Fixed compiler warning
storage/ndb/src/kernel/vm/Pool.hpp:
  Fixed compiler warning
strings/ctype-simple.c:
  Fixed compiler warning
strings/my_strchr.c:
  Fixed compiler warning
parent c0c013e5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3437,7 +3437,6 @@ server_version_string(MYSQL *mysql)
  {
    char *bufp = buf;
    MYSQL_RES *result;
    MYSQL_ROW cur;

    bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf);

+1 −1
Original line number Diff line number Diff line
@@ -2149,7 +2149,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
    write_footer(sql_file);
    my_fclose(sql_file, MYF(MY_WME));
  }
  DBUG_RETURN(num_fields);
  DBUG_RETURN((uint) num_fields);
} /* get_table_structure */


+2 −0
Original line number Diff line number Diff line
@@ -979,7 +979,9 @@ drop_schema(MYSQL *mysql, const char *db)
static int
run_scheduler(stats *sptr, statement *stmts, uint concur, ulonglong limit)
{
#ifndef __WIN__
  uint x;
#endif
  File lock_file;
  struct timeval start_time, end_time;
  thread_context con;
+4 −4
Original line number Diff line number Diff line
@@ -3460,10 +3460,10 @@ int read_line(char *buf, int size)
	DBUG_RETURN(0);
      }
      else if ((c == '{' &&
                (!my_strnncoll_simple(charset_info, "while", 5,
                                      buf, min(5, p - buf), 0) ||
                 !my_strnncoll_simple(charset_info, "if", 2,
                                      buf, min(2, p - buf), 0))))
                (!my_strnncoll_simple(charset_info, (const uchar*) "while", 5,
                                      (uchar*) buf, min(5, p - buf), 0) ||
                 !my_strnncoll_simple(charset_info, (const uchar*) "if", 2,
                                      (uchar*) buf, min(2, p - buf), 0))))
      {
        /* Only if and while commands can be terminated by { */
        *p++= c;
+4 −2
Original line number Diff line number Diff line
@@ -1052,8 +1052,10 @@ static int convert_file(REPLACE *rep, my_string name)
{
  int error;
  FILE *in,*out;
  char dir_buff[FN_REFLEN], tempname[FN_REFLEN];
  char link_name[FN_REFLEN], *org_name = name;
  char dir_buff[FN_REFLEN], tempname[FN_REFLEN],*org_name = name;
#ifdef HAVE_READLINK  
  char link_name[FN_REFLEN];
#endif
  File temp_file;
  DBUG_ENTER("convert_file");

Loading