Commit c53184eb authored by unknown's avatar unknown
Browse files

Proper fix for comparision with ' '

(Bug #7788 "Table is full" occurs during a multitable update")


client/mysqldump.c:
  Style fixes
innobase/include/univ.i:
  UNIV_DEBUG should not depend on configure --debug but on --debug=full
mysql-test/r/compare.result:
  Added test to find bug in previous bugfix
mysql-test/t/compare.test:
  Added test to find bug in previous bugfix
mysys/my_handler.c:
  Proper fix for comparision with ' '
strings/ctype-big5.c:
  Proper fix for comparision with ' '
strings/ctype-bin.c:
  Proper fix for comparision with ' '
strings/ctype-gbk.c:
  Proper fix for comparision with ' '
strings/ctype-latin1.c:
  Proper fix for comparision with ' '
strings/ctype-mb.c:
  Proper fix for comparision with ' '
strings/ctype-simple.c:
  Proper fix for comparision with ' '
strings/ctype-sjis.c:
  Proper fix for comparision with ' '
strings/ctype-tis620.c:
  Proper fix for comparision with ' '
strings/ctype-ucs2.c:
  Proper fix for comparision with ' '
strings/ctype-utf8.c:
  Proper fix for comparision with ' '
parent e5d8e72a
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -2091,6 +2091,7 @@ static int dump_all_tables_in_db(char *database)
  RETURN
    void
*/

static void get_actual_table_name(const char *old_table_name, 
                                  char *new_table_name, 
                                  int buf_size)
@@ -2098,7 +2099,6 @@ static void get_actual_table_name( const char *old_table_name,
  MYSQL_RES  *tableRes;
  MYSQL_ROW  row;
  char query[ NAME_LEN + 50 ];

  DBUG_ENTER("get_actual_table_name");

  sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name);
@@ -2109,9 +2109,9 @@ static void get_actual_table_name( const char *old_table_name,

  tableRes= mysql_store_result( sock );
  row= mysql_fetch_row( tableRes );
	strncpy( new_table_name, row[0], buf_size );
  strmake(new_table_name, row[0], buf_size-1);
  mysql_free_result(tableRes);
} /* get_actual_table_name */
}


static int dump_selected_tables(char *db, char **table_names, int tables)
+0 −4
Original line number Diff line number Diff line
@@ -80,10 +80,6 @@ memory is read outside the allocated blocks. */

/* Make a non-inline debug version */

#ifdef DBUG_ON
#define UNIV_DEBUG
#endif /* DBUG_ON */

/*
#define UNIV_DEBUG
#define UNIV_MEM_DEBUG
+3 −0
Original line number Diff line number Diff line
@@ -39,3 +39,6 @@ DROP TABLE t1;
SELECT CHAR(31) = '', '' = CHAR(31);
CHAR(31) = ''	'' = CHAR(31)
0	0
SELECT CHAR(30) = '', '' = CHAR(30);
CHAR(30) = ''	'' = CHAR(30)
0	0
+2 −0
Original line number Diff line number Diff line
@@ -33,3 +33,5 @@ DROP TABLE t1;

# Bug #8134: Comparison against CHAR(31) at end of string
SELECT CHAR(31) = '', '' = CHAR(31);
# Extra test
SELECT CHAR(30) = '', '' = CHAR(30);
+3 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
    return 0;
  if (skip_end_space && a_length != b_length)
  {
    int swap= 0;
    int swap= 1;
    /*
      We are using space compression. We have to check if longer key
      has next character < ' ', in which case it's less than the shorter
@@ -57,12 +57,12 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
      /* put shorter key in a */
      a_length= b_length;
      a= b;
      swap= -1 ^ 1;					/* swap sign of result */
      swap= -1;					/* swap sign of result */
    }
    for (end= a + a_length-length; a < end ; a++)
    {
      if (*a != ' ')
	return ((int) *a - (int) ' ') ^ swap;
	return (*a < ' ') ? -swap : swap;
    }
    return 0;
  }
Loading