Commit 307c0b77 authored by unknown's avatar unknown
Browse files

many warnings (practically safe but annoying) corrected


client/mysqladmin.cc:
  don't use the handler after it's closed
client/mysqlbinlog.cc:
  memory leak
client/mysqldump.c:
  many "ignore return value" warnings, one "NULL dereference"
cmd-line-utils/libedit/history.c:
  memory leak
include/my_base.h:
  cleanup
libmysql/libmysql.c:
  "return value ignored" warning
myisam/mi_delete.c:
  "return value ignored" warning
myisam/myisampack.c:
  "out-of-bound access" warning
myisam/sort.c:
  "double free" warning
mysys/default_modify.c:
  "double free" warning
mysys/mf_iocache2.c:
  "return value ignored" warnings
mysys/my_bitmap.c:
  s/return/DBUG_RETURN/
mysys/my_error.c:
  memory leak
server-tools/instance-manager/parse.cc:
  "NULL dereference" warning
sql-common/client.c:
  "NULL dereference" warning
sql/field.cc:
  deadcode, "NULL dereference", "uninitialized" warnings
sql/field.h:
  unused parameters removed from constructor
sql/ha_myisam.cc:
  "return value ignored" warnings
sql/item.cc:
  "return value ignored" warnings
  changed constructor
sql/item_func.cc:
  "return value ignored" warnings
sql/log_event.cc:
  uninitialized warning
sql/opt_range.cc:
  "double free" and uninitialized warnings
sql/opt_range.h:
  "return value ignored" warning
sql/repl_failsafe.cc:
  "return value ignored" warning
sql/set_var.cc:
  "return value ignored" warning
sql/slave.cc:
  "return value ignored" warnings
sql/slave.h:
  new prototype
sql/sql_acl.cc:
  deadcode and "NULL dereference" warnings
sql/sql_db.cc:
  "return value ignored" warning
sql/sql_handler.cc:
  "NULL dereference" warning
sql/sql_help.cc:
  "NULL dereference" warning
sql/sql_insert.cc:
  "return value ignored" warning
sql/sql_parse.cc:
  "return value ignored" warning
  one more DBUG_ASSERT
sql/sql_repl.cc:
  "return value ignored" and memory leak warnings
sql/sql_show.cc:
  "return value ignored" and "NULL dereference"  warnings
sql/sql_test.cc:
  "return value ignored" warning
sql/table.cc:
  memory leak
sql/uniques.cc:
  "return value ignored" warning
  endspaces deleted
parent 348efa52
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -569,6 +569,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
	return -1;
      }
      mysql_close(mysql);	/* Close connection to avoid error messages */
      argc=1;                   /* force SHUTDOWN to be the last command    */
      if (got_pidfile)
      {
	if (opt_verbose)
+5 −4
Original line number Diff line number Diff line
@@ -1266,12 +1266,13 @@ at offset %lu ; this could be a log format error or read error",
      }
      else if (buf[4] == ROTATE_EVENT)
      {
        Log_event *ev;
        my_b_seek(file, tmp_pos); /* seek back to event's start */
        if (!Log_event::read_log_event(file, *description_event))
        if (!(ev= Log_event::read_log_event(file, *description_event)))
          /* EOF can't be hit here normally, so it's a real error */
          die("Could not read a Rotate_log_event event \
at offset %lu ; this could be a log format error or read error",
              tmp_pos);
          die("Could not read a Rotate_log_event event at offset %lu ;"
              " this could be a log format error or read error", tmp_pos);
        delete ev;
      }
      else
        break;
+15 −12
Original line number Diff line number Diff line
@@ -1306,7 +1306,7 @@ static uint dump_routines_for_db(char *db)
  fprintf(sql_file, "DELIMITER ;\n");

  if (lock_tables)
    mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
    VOID(mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"));
  DBUG_RETURN(0);
}

@@ -2095,7 +2095,10 @@ static void dump_table(char *table, char *db)
    else
      res=mysql_store_result(sock);
    if (!res)
    {
      DB_error(sock, "when retrieving data from server");
      goto err;
    }
    if (verbose)
      fprintf(stderr, "-- Retrieving rows...\n");
    if (mysql_num_fields(res) != num_fields)
@@ -2625,7 +2628,7 @@ static int dump_all_tables_in_db(char *database)
    check_io(md_result_file);
  }
  if (lock_tables)
    mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
    VOID(mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"));
  return 0;
} /* dump_all_tables_in_db */

@@ -2680,7 +2683,7 @@ static my_bool dump_all_views_in_db(char *database)
    check_io(md_result_file);
  }
  if (lock_tables)
    mysql_query(sock,"UNLOCK TABLES");
    VOID(mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"));
  return 0;
} /* dump_all_tables_in_db */

@@ -2839,7 +2842,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
    check_io(md_result_file);
  }
  if (lock_tables)
    mysql_query_with_error_report(sock, 0, "UNLOCK TABLES");
    VOID(mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"));
  DBUG_RETURN(0);
} /* dump_selected_tables */

+2 −2
Original line number Diff line number Diff line
@@ -676,8 +676,8 @@ history_load(History *h, const char *fname)
		(void) strunvis(ptr, line);
		line[sz] = c;
		if (HENTER(h, &ev, ptr) == -1) {
			h_free((ptr_t)ptr);
			return -1;
                  i = -1;
                  goto oomem;
		}
	}
oomem:
+2 −1
Original line number Diff line number Diff line
@@ -404,7 +404,8 @@ enum ha_base_keytype {
enum en_fieldtype {
  FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
  FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
  FIELD_VARCHAR,FIELD_CHECK
  FIELD_VARCHAR,FIELD_CHECK,
  FIELD_enum_val_count
};

enum data_file_type {
Loading