Commit 3956f591 authored by unknown's avatar unknown
Browse files

Remove compiler warnings


mysql-test/mysql-test-run.pl:
  Fix warning when using --extern
sql/field.cc:
  Fix wrong fix
sql/ha_ndbcluster.cc:
  Better fixes to remove compiler warnings
sql/ha_ndbcluster_binlog.cc:
  Better fixes to remove compiler warnings
sql/log.cc:
  Fix compiler warnings
sql/sql_parse.cc:
  Indentation fix
sql/sql_table.cc:
  Indentation fixes
storage/myisammrg/ha_myisammrg.cc:
  Fix compiler warnings
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  Fix compiler warnings
support-files/compiler_warnings.supp:
  Suppress all 'safe' warnings, as detected by win64
win/README:
  Fixed typo
parent 175507b7
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -409,24 +409,24 @@ sub main () {
    {
      next if $test->{skip};

      if (!$opt_extern)
      {
	$need_ndbcluster||= $test->{ndb_test};
	$need_im||= $test->{component_id} eq 'im';

	# Count max number of slaves used by a test case
      if ( $test->{slave_num} > $max_slave_num)
      {
	if ( $test->{slave_num} > $max_slave_num) {
	  $max_slave_num= $test->{slave_num};
	  mtr_error("Too many slaves") if $max_slave_num > 3;
	}

	# Count max number of masters used by a test case
      if ( $test->{master_num} > $max_master_num)
      {
	if ( $test->{master_num} > $max_master_num) {
	  $max_master_num= $test->{master_num};
	  mtr_error("Too many masters") if $max_master_num > 2;
	  mtr_error("Too few masters") if $max_master_num < 1;
	}

      }
      $use_innodb||= $test->{'innodb_test'};
    }

+4 −4
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@

User::User(const LEX_STRING *user_name_arg, const char *password)
{
  user_length= strmake(user, user_name_arg->str, USERNAME_LENGTH + 1) - user;

  user_length= (uint8) (strmake(user, user_name_arg->str,
                                USERNAME_LENGTH + 1) - user);
  set_password(password);
}

@@ -59,7 +59,7 @@ int User::init(const char *line)
    password= name_end + 1;
  }

  user_length= name_end - name_begin;
  user_length= (uint8) (name_end - name_begin);
  if (user_length > USERNAME_LENGTH)
  {
    log_error("User name is too long (%d). Max length: %d. "
@@ -70,7 +70,7 @@ int User::init(const char *line)
    return 1;
  }

  password_length= strlen(password);
  password_length= (int) strlen(password);
  if (password_length > SCRAMBLED_PASSWORD_CHAR_LENGTH)
  {
    log_error("Password is too long (%d). Max length: %d."
+3 −5
Original line number Diff line number Diff line
@@ -6297,12 +6297,10 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)

void Field_string::sort_string(char *to,uint length)
{
#ifndef DBUG_OFF
  uint tmp= my_strnxfrm(field_charset,
  IF_DBUG(uint tmp=) my_strnxfrm(field_charset,
                                 (uchar*) to, length,
                                 (uchar*) ptr, field_length);
  DBUG_ASSERT(tmp == length);
#endif
}


+28 −20
Original line number Diff line number Diff line
@@ -4719,7 +4719,9 @@ static int create_ndb_column(NDBCOL &col,
  // Set autoincrement
  if (field->flags & AUTO_INCREMENT_FLAG) 
  {
    IF_DBUG(char buff[22]);
#ifndef DBUG_OFF
    char buff[22];
#endif
    col.setAutoIncrement(TRUE);
    ulonglong value= info->auto_increment_value ?
      info->auto_increment_value : (ulonglong) 1;
@@ -5411,8 +5413,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
#ifdef HAVE_NDB_BINLOG
    if (share)
    {
      IF_DBUG(int r=) rename_share(share, from);
      DBUG_ASSERT(r == 0);
      IF_DBUG(int ret=) rename_share(share, from);
      DBUG_ASSERT(ret == 0);
      /* ndb_share reference temporary free */
      DBUG_PRINT("NDB_SHARE", ("%s temporary free  use_count: %u",
                               share->key, share->use_count));
@@ -7270,7 +7272,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
    if (share->commit_count != 0)
    {
      *commit_count= share->commit_count;
      IF_DBUG(char buff[22]);
#ifndef DBUG_OFF
      char buff[22];
#endif
      DBUG_PRINT("info", ("Getting commit_count: %s from share",
                          llstr(share->commit_count, buff)));
      pthread_mutex_unlock(&share->mutex);
@@ -7306,7 +7310,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
  pthread_mutex_lock(&share->mutex);
  if (share->commit_count_lock == lock)
  {
    IF_DBUG(char buff[22]);
#ifndef DBUG_OFF
    char buff[22];
#endif
    DBUG_PRINT("info", ("Setting commit_count to %s",
                        llstr(stat.commit_count, buff)));
    share->commit_count= stat.commit_count;
@@ -7365,8 +7371,9 @@ ndbcluster_cache_retrieval_allowed(THD *thd,
  bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
  char *dbname= full_name;
  char *tabname= dbname+strlen(dbname)+1;
  IF_DBUG(char buff[22]);
  IF_DBUG(char buff2[22]);
#ifndef DBUG_OFF
  char buff[22], buff2[22];
#endif
  DBUG_ENTER("ndbcluster_cache_retrieval_allowed");
  DBUG_PRINT("enter", ("dbname: %s, tabname: %s, is_autocommit: %d",
                       dbname, tabname, is_autocommit));
@@ -7433,7 +7440,9 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
                                          ulonglong *engine_data)
{
  Uint64 commit_count;
  IF_DBUG(char buff[22]);
#ifndef DBUG_OFF
  char buff[22];
#endif
  bool is_autocommit= !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN));
  DBUG_ENTER("ha_ndbcluster::register_query_cache_table");
  DBUG_PRINT("enter",("dbname: %s, tabname: %s, is_autocommit: %d",
@@ -7878,10 +7887,9 @@ ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb, const
  int retries= 10;
  int reterr= 0;
  int retry_sleep= 30 * 1000; /* 30 milliseconds */
  IF_DBUG(char buff[22]);
  IF_DBUG(char buff2[22]);
  IF_DBUG(char buff3[22]);
  IF_DBUG(char buff4[22]);
#ifndef DBUG_OFF
  char buff[22], buff2[22], buff3[22], buff4[22];
#endif
  DBUG_ENTER("ndb_get_table_statistics");
  DBUG_PRINT("enter", ("table: %s", ndbtab->getName()));

@@ -8699,8 +8707,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
            ndb_get_table_statistics(NULL, FALSE, ndb,
                                     ndbtab_g.get_table(), &stat) == 0)
        {
          IF_DBUG(char buff[22]);
	  IF_DBUG(char buff2[22]);
#ifndef DBUG_OFF
          char buff[22], buff2[22];
#endif
          DBUG_PRINT("info",
                     ("Table: %s  commit_count: %s  rows: %s",
                      share->key,
@@ -9552,8 +9561,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("INT_ITEM"));
          if (context->expecting(Item::INT_ITEM)) 
          {
            IF_DBUG(Item_int *int_item= (Item_int *) item);
            DBUG_PRINT("info", ("value %ld", (long) int_item->value));
            DBUG_PRINT("info", ("value %ld",
                                (long) ((Item_int*) item)->value));
            NDB_ITEM_QUALIFICATION q;
            q.value_type= Item::INT_ITEM;
            curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
@@ -9579,8 +9588,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("REAL_ITEM"));
          if (context->expecting(Item::REAL_ITEM)) 
          {
            IF_DBUG(Item_float *float_item= (Item_float *) item);
            DBUG_PRINT("info", ("value %f", float_item->value));
            DBUG_PRINT("info", ("value %f", ((Item_float*) item)->value));
            NDB_ITEM_QUALIFICATION q;
            q.value_type= Item::REAL_ITEM;
            curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
@@ -9627,8 +9635,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("DECIMAL_ITEM"));
          if (context->expecting(Item::DECIMAL_ITEM)) 
          {
            IF_DBUG(Item_decimal *decimal_item= (Item_decimal *) item);
            DBUG_PRINT("info", ("value %f", decimal_item->val_real()));
            DBUG_PRINT("info", ("value %f",
                                ((Item_decimal*) item)->val_real()));
            NDB_ITEM_QUALIFICATION q;
            q.value_type= Item::DECIMAL_ITEM;
            curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
+6 −2
Original line number Diff line number Diff line
@@ -3857,7 +3857,9 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
              continue;
            }
            TABLE *table= share->table;
            IF_DBUG(const LEX_STRING &name= table->s->table_name);
#ifndef DBUG_OFF
            const LEX_STRING &name= table->s->table_name;
#endif
            if ((event_types & (NdbDictionary::Event::TE_INSERT |
                                NdbDictionary::Event::TE_UPDATE |
                                NdbDictionary::Event::TE_DELETE)) == 0)
@@ -3884,8 +3886,10 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
          {
            TABLE *table= ndb_apply_status_share->table;

            IF_DBUG(const LEX_STRING& name= table->s->table_name);
#ifndef DBUG_OFF
            const LEX_STRING& name= table->s->table_name;
            DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str));
#endif
            injector::transaction::table tbl(table, TRUE);
            IF_DBUG(int ret=) trans.use_table(::server_id, tbl);
            DBUG_ASSERT(ret == 0);
Loading