Commit 53c5511a authored by unknown's avatar unknown
Browse files

Merge mysql.com:/home/gluh/MySQL/Merge/5.1

into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt

parents 8010d987 ae72e394
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ extern FILE *_db_fp_(void);
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define IF_DBUG(A) A
#else						/* No debugger */

#define DBUG_ENTER(a1)
@@ -106,6 +107,7 @@ extern FILE *_db_fp_(void);
#define DBUG_UNLOCK_FILE
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)
#define IF_DBUG(A)
#endif
#ifdef	__cplusplus
}
+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 −3
Original line number Diff line number Diff line
@@ -6297,7 +6297,7 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)

void Field_string::sort_string(char *to,uint length)
{
  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);
+25 −10
Original line number Diff line number Diff line
@@ -2764,10 +2764,12 @@ int ha_ndbcluster::write_row(byte *record)
  {
    Ndb *ndb= get_ndb();
    Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1;
#ifndef DBUG_OFF
    char buff[22];
    DBUG_PRINT("info", 
               ("Trying to set next auto increment value to %s",
                llstr(next_val, buff)));
#endif
    Ndb_tuple_id_range_guard g(m_share);
    if (ndb->setAutoIncrementValue(m_table, g.range, next_val, TRUE)
        == -1)
@@ -3999,7 +4001,7 @@ int ha_ndbcluster::end_bulk_insert()
      }
      else
      {
        int res= trans->restart();
        IF_DBUG(int res=) trans->restart();
        DBUG_ASSERT(res == 0);
      }
    }
@@ -4717,7 +4719,9 @@ static int create_ndb_column(NDBCOL &col,
  // Set autoincrement
  if (field->flags & AUTO_INCREMENT_FLAG) 
  {
#ifndef DBUG_OFF
    char buff[22];
#endif
    col.setAutoIncrement(TRUE);
    ulonglong value= info->auto_increment_value ?
      info->auto_increment_value : (ulonglong) 1;
@@ -5388,7 +5392,7 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
  {
    DBUG_PRINT("NDB_SHARE", ("%s temporary  use_count: %u",
                             share->key, share->use_count));
    int r= rename_share(share, to);
    IF_DBUG(int r=) rename_share(share, to);
    DBUG_ASSERT(r == 0);
  }
#endif
@@ -5409,8 +5413,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
#ifdef HAVE_NDB_BINLOG
    if (share)
    {
      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));
@@ -7268,7 +7272,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
    if (share->commit_count != 0)
    {
      *commit_count= share->commit_count;
#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);
@@ -7304,7 +7310,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname,
  pthread_mutex_lock(&share->mutex);
  if (share->commit_count_lock == lock)
  {
#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;
@@ -7363,7 +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;
#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));
@@ -7430,7 +7440,9 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
                                          ulonglong *engine_data)
{
  Uint64 commit_count;
#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",
@@ -7875,7 +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 */
#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()));

@@ -8693,7 +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)
        {
#ifndef DBUG_OFF
          char buff[22], buff2[22];
#endif
          DBUG_PRINT("info",
                     ("Table: %s  commit_count: %s  rows: %s",
                      share->key,
@@ -9545,8 +9561,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("INT_ITEM"));
          if (context->expecting(Item::INT_ITEM)) 
          {
            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);
@@ -9572,8 +9588,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("REAL_ITEM"));
          if (context->expecting(Item::REAL_ITEM)) 
          {
            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);
@@ -9620,8 +9635,8 @@ void ndb_serialize_cond(const Item *item, void *arg)
          DBUG_PRINT("info", ("DECIMAL_ITEM"));
          if (context->expecting(Item::DECIMAL_ITEM)) 
          {
            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);
Loading