Commit fa4e07bf authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi
Browse files

merge

parents 75b4156d f3a186c9
Loading
Loading
Loading
Loading
+19 −8
Original line number Diff line number Diff line
@@ -1793,7 +1793,7 @@ and @code{row-level locking}.
@item
Our German, Austrian, and Swiss users will note that we have a new character
set, @code{latin_de}, which corrects the @emph{German sorting order},
set, @code{latin1_de}, which corrects the @emph{German sorting order},
placing German umlauts in the same order as German telephone books.
@item
@@ -3409,9 +3409,6 @@ database if you are not using the @code{-A} option or if you are using
@code{rehash}. This is especially notable when you have a big table
cache.
@item
The current replication protocol cannot deal with @code{LOAD DATA INFILE}
and line terminator characters of more than 1 character.
@end itemize
The following problems are known and will be fixed in due time:
@@ -3422,6 +3419,10 @@ The following problems are known and will be fixed in due time:
When using @code{SET CHARACTER SET}, one can't use translated
characters in database, table, and column names.
@item
One can't use @code{_} or @code{%} with @code{ESCAPE} in @code{LIKE
... ESCAPE}.
@item
If you have a @code{DECIMAL} column with a  number stored in different
formats (+01.00, 1.00, 01.00), @code{GROUP BY} may regard each value
@@ -20614,7 +20615,7 @@ but normally this is never needed.
@subsubsection German character set
To get German sorting order, you should start @code{mysqld} with
@code{--default-character-set=latin_de}.  This will give you the following
@code{--default-character-set=latin1_de}.  This will give you the following
characteristics.
When sorting and comparing string's the following mapping is done on the
@@ -50393,8 +50394,18 @@ each individual 4.0.x release.
@itemize @bullet
@item
Fixed a bug, that caused MySQL to create unusable MyISAM tables, when key
length (in @code{CREATE TABLE}) exceeded 500 bytes.
@code{SELECT @@@@[global|session].var_name} didn't report
@code{global | session} in the result column name.
@item
Fixed problem in replication that @code{FLUSH LOGS} in a circular
replication setup created an infinite number of binary log files.
Now a @code{rotate-binary-log} command in the binary log will not cause slaves
to rotate logs.
@item
Removed @code{STOP EVENT} from binary log when doing @code{FLUSH LOGS}.
@item
Disable the use of @code{SHOW NEW MASTER FOR SLAVE} as this needs to be
completely changed in 4.1.
@item
Fixed a bug with constant expression (e.g. field of a one-row table, or field
from a table, referenced by a @code{UNIQUE} key) appeared in @code{ORDER BY}
@@ -50963,7 +50974,7 @@ Secure connections (with SSL).
Unsigned @code{BIGINT} constants now work. @code{MIN()} and @code{MAX()}
now handle signed and unsigned @code{BIGINT} numbers correctly.
@item
New character set @code{latin_de} which provides correct German sorting.
New character set @code{latin1_de} which provides correct German sorting.
@item
@code{STRCMP()} now uses the current character set when doing comparisons,
which means that the default comparison behaviour now is case-insensitive.
+18 −16
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
#include "log_event.h"

#define BIN_LOG_HEADER_SIZE	4
#define PROBE_HEADER_LEN	(BIN_LOG_HEADER_SIZE+EVENT_LEN_OFFSET+4)
#define PROBE_HEADER_LEN	(EVENT_LEN_OFFSET+4)


#define CLIENT_CAPABILITIES	(CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES)
@@ -378,31 +378,40 @@ static void dump_remote_log_entries(const char* logname)

static int check_header(IO_CACHE* file)
{
  byte header[BIN_LOG_HEADER_SIZE];
  byte buf[PROBE_HEADER_LEN];
  int old_format=0;

  my_off_t pos = my_b_tell(file);
  my_b_seek(file, (my_off_t)0);
  if (my_b_read(file, buf, sizeof(buf)))
    die("Failed reading header");
  if (buf[EVENT_TYPE_OFFSET+4] == START_EVENT)
  if (my_b_read(file, header, sizeof(header)))
    die("Failed reading header;  Probably an empty file");
  if (memcmp(header, BINLOG_MAGIC, sizeof(header)))
    die("File is not a binary log file");
  if (!my_b_read(file, buf, sizeof(buf)))
  {
    if (buf[4] == START_EVENT)
    {
      uint event_len;
    event_len = uint4korr(buf + EVENT_LEN_OFFSET + 4);
      event_len = uint4korr(buf + 4);
      old_format = (event_len < LOG_EVENT_HEADER_LEN + START_HEADER_LEN);
    }
  }
  my_b_seek(file, pos);
  return old_format;
}


static void dump_local_log_entries(const char* logname)
{
  File fd = -1;
  IO_CACHE cache,*file= &cache;
  ulonglong rec_count = 0;
  char last_db[FN_REFLEN+1] = "";
  char last_db[FN_REFLEN+1], tmp_buff[BIN_LOG_HEADER_SIZE];
  bool old_format = 0;

  last_db[0]=0;

  if (logname && logname[0] != '-')
  {
    if ((fd = my_open(logname, O_RDONLY | O_BINARY, MYF(MY_WME))) < 0)
@@ -435,14 +444,7 @@ static void dump_local_log_entries(const char* logname)
  }

  if (!position)
  {
    char magic[BIN_LOG_HEADER_SIZE];
    if (my_b_read(file, (byte*) magic, sizeof(magic)))
      die("I/O error reading binlog magic number");
    if (memcmp(magic, BINLOG_MAGIC, 4))
      die("Bad magic number;  The file is probably not a MySQL binary log");
  }

    my_b_read(file, tmp_buff, BIN_LOG_HEADER_SIZE); // Skip header
  for (;;)
  {
    char llbuff[21];
+38 −64
Original line number Diff line number Diff line
@@ -87,11 +87,8 @@
#define CON_RETRY_SLEEP 2
#define MAX_CON_TRIES	5

#ifndef OS2
#define SLAVE_POLL_INTERVAL 300000 /* 0.3 of a sec */
#else
#defile SLAVE_POLL_INTERVAL 0.3
#endif


enum {OPT_MANAGER_USER=256,OPT_MANAGER_HOST,OPT_MANAGER_PASSWD,
      OPT_MANAGER_PORT,OPT_MANAGER_WAIT_TIMEOUT};
@@ -423,6 +420,7 @@ static void free_used_memory()
    my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
  delete_dynamic(&q_lines);
  dynstr_free(&ds_res);
  free_replace();
  my_free(pass,MYF(MY_ALLOW_ZERO_PTR));
  free_defaults(default_argv);
  mysql_server_end();
@@ -687,13 +685,23 @@ int open_file(const char* name)
  return 0;
}

/* ugly long name, but we are following the convention */
int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
static void my_sleep(ulong m_seconds)
{
  MYSQL* mysql = &cur_con->mysql;
#ifndef OS2
   struct timeval t;
   t.tv_sec=  m_seconds / 1000000L;
   t.tv_usec= m_seconds % 1000000L;
   select(0,0,0,0,&t); /* sleep */
#else
   DosSleep(m_seconds/1000+1);
#endif
}


/* ugly long name, but we are following the convention */
int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
{
  MYSQL* mysql = &cur_con->mysql;
  for (;;)
  {
    MYSQL_RES* res;
@@ -714,15 +722,8 @@ int do_wait_for_slave_to_stop(struct st_query* q __attribute__((unused)))
    mysql_free_result(res);
    if (done)
      break;
#ifndef OS2
    t.tv_sec=0;
    t.tv_usec=SLAVE_POLL_INTERVAL;
    select(0,0,0,0,&t); /* sleep */
#else
    DosSleep(OS2_SLAVE_POLL_INTERVAL);
#endif
    my_sleep(SLAVE_POLL_INTERVAL);
  }

  return 0;
}

@@ -1000,10 +1001,18 @@ int do_sync_with_master2(const char* p)
    die("line %u: empty result in %s", start_lineno, query_buf);
  if (!row[0])
    die("Error on slave while syncing with master");
  mysql_free_result(res);   last_result=0;
  mysql_free_result(res);
  last_result=0;
  if (rpl_parse)
    mysql_enable_rpl_parse(mysql);

#ifndef TO_BE_REMOVED
  /*
    We need this because wait_for_pos() only waits for the relay log,
    which doesn't guarantee that the slave has executed the statement.
  */
  my_sleep(2*1000000L);
#endif
  return 0;
}

@@ -1082,53 +1091,15 @@ int do_disable_rpl_parse(struct st_query* q __attribute__((unused)))
int do_sleep(struct st_query* q, my_bool real_sleep)
{
  char* p=q->first_argument;
  struct timeval t;
  int dec_mul = 1000000;
  while (*p && isspace(*p)) p++;
  while (*p && isspace(*p))
    p++;
  if (!*p)
    die("Missing argument in sleep\n");
  t.tv_usec = 0;

#ifdef OS2

  if (opt_sleep && !real_sleep)
    DosSleep( opt_sleep * 1000);
    my_sleep(opt_sleep * 1000000L);
  else
    DosSleep( atof( p) * 1000);

    my_sleep((ulong) (atof(p) * 1000000L));
  return 0;

#else
  if (opt_sleep && !real_sleep)
    t.tv_sec = opt_sleep;
  else
  {
    t.tv_sec = atoi(p);
    while (*p && *p != '.' && !isspace(*p))
      p++;
    if (*p == '.')
    {
      int c;
      char *p_end;
      p++;
      p_end = p + 6;

      for (;p <= p_end; ++p)
      {
	c = (int) (*p - '0');
	if (c < 10 && (int) c >= 0)
	{
	  t.tv_usec = t.tv_usec * 10 + c;
	  dec_mul /= 10;
	}
	else
	  break;
      }
    }
  }
  t.tv_usec *= dec_mul;
  return select(0,0,0,0, &t);
#endif
}

static void get_file_name(char *filename, struct st_query* q)
@@ -1261,7 +1232,6 @@ static void get_replace(struct st_query *q)
  POINTER_ARRAY to_array,from_array;
  DBUG_ENTER("get_replace");

  if (glob_replace)
  free_replace();

  bzero((char*) &to_array,sizeof(to_array));
@@ -1298,9 +1268,12 @@ static void get_replace(struct st_query *q)
void free_replace()
{
  DBUG_ENTER("free_replace");
  if (glob_replace)
  {
    my_free((char*) glob_replace,MYF(0));
    glob_replace=0;
    free_replace_buffer();
  }
  DBUG_VOID_RETURN;
}

@@ -2090,6 +2063,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
    query = eval_query.str;
    query_len = eval_query.length;
  }
  DBUG_PRINT("enter", ("query: '%-.60s'", query));

  if (q->record_file[0])
  {
+9 −1
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ case $SYSTEM_TYPE in
      fi
    fi
    ;;
  *darwin*)
  *darwin5*)
    if test "$ac_cv_prog_gcc" = "yes"
    then
      CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
@@ -931,6 +931,14 @@ case $SYSTEM_TYPE in
      with_named_curses=""
    fi
    ;;
  *darwin6*)
    if test "$ac_cv_prog_gcc" = "yes"
    then
      CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH"
      CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ"
      MAX_C_OPTIMIZE="-O"
    fi
    ;;
  *freebsd*)
    echo "Adding fix for interrupted reads"
    CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000"
+13 −6
Original line number Diff line number Diff line
@@ -126,13 +126,14 @@ extern int NEAR my_errno; /* Last error in mysys */
	/* defines when allocating data */

#ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc( SZ, __FILE__, __LINE__, FLAG )
#define my_malloc_ci(SZ,FLAG) _mymalloc( SZ, sFile, uLine, FLAG )
#define my_realloc(PTR,SZ,FLAG) _myrealloc( PTR, SZ, __FILE__, __LINE__, FLAG )
#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
#define my_malloc_ci(SZ,FLAG) _mymalloc((SZ), sFile, uLine, FLAG )
#define my_realloc(PTR,SZ,FLAG) _myrealloc((PTR), (SZ), __FILE__, __LINE__, FLAG )
#define my_checkmalloc() _sanity( __FILE__, __LINE__ )
#define my_free(PTR,FLAG) _myfree( PTR, __FILE__, __LINE__,FLAG)
#define my_memdup(A,B,C) _my_memdup(A,B,__FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup(A,__FILE__,__LINE__,C)
#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG)
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE__,__LINE__,C)
#define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0
extern uint sf_malloc_prehunc,sf_malloc_endhunc,sf_malloc_quick;
@@ -153,6 +154,8 @@ extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern my_string my_strdup(const char *from,myf MyFlags);
extern my_string my_strdup_with_length(const char *from,uint length,
				       myf MyFlags);
#define my_free(PTR,FG) my_no_flags_free(PTR)
#define CALLER_INFO_PROTO   /* nothing */
#define CALLER_INFO         /* nothing */
@@ -550,6 +553,10 @@ extern gptr _my_memdup(const byte *from,uint length,
		       const char *sFile, uint uLine,myf MyFlag);
extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
			    myf MyFlag);
extern my_string _my_strdup_with_length(const char *from, uint length,
					const char *sFile, uint uLine,
					myf MyFlag);

#ifndef TERMINATE
extern void TERMINATE(FILE *file);
#endif
Loading