SOURCES (MYSQL_4_1): mysql-bk-20071202.patch (NEW) - update from b...

arekm arekm at pld-linux.org
Sun Dec 2 21:32:29 CET 2007


Author: arekm                        Date: Sun Dec  2 20:32:29 2007 GMT
Module: SOURCES                       Tag: MYSQL_4_1
---- Log message:
- update from bk (future 4.1.24)

---- Files affected:
SOURCES:
   mysql-bk-20071202.patch (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/mysql-bk-20071202.patch
diff -u /dev/null SOURCES/mysql-bk-20071202.patch:1.1.2.1
--- /dev/null	Sun Dec  2 21:32:29 2007
+++ SOURCES/mysql-bk-20071202.patch	Sun Dec  2 21:32:24 2007
@@ -0,0 +1,4150 @@
+diff -urN mysql-4.1.23/BK/keys mysql-4.1/BK/keys
+--- mysql-4.1.23/BK/keys	2007-12-02 20:38:52.000000000 +0100
++++ mysql-4.1/BK/keys	2007-11-29 23:23:39.000000000 +0100
+@@ -1,2 +1,2 @@
+ ROOTKEY=3985cf0cwNRCED_XNSCA7RvkLPer2Q
+-TIPKEY=466e5874F5N8tMqwd_kEmlTPE9UlnA
++TIPKEY=47448694WzdmhSoqwUkknsFfid9jmw
+diff -urN mysql-4.1.23/client/mysqldump.c mysql-4.1/client/mysqldump.c
+--- mysql-4.1.23/client/mysqldump.c	2007-12-02 20:38:26.000000000 +0100
++++ mysql-4.1/client/mysqldump.c	2007-10-04 08:27:01.000000000 +0200
+@@ -2428,6 +2428,18 @@
+     need the REPEATABLE READ level (not anything lower, for example READ
+     COMMITTED would give one new consistent read per dumped table).
+   */
++  if ((mysql_get_server_version(mysql_con) < 40100) && opt_master_data)
++  {
++    fprintf(stderr, "-- %s: the combination of --single-transaction and "
++            "--master-data requires a MySQL server version of at least 4.1 "
++            "(current server's version is %s). %s\n",
++            ignore_errors ? "Warning" : "Error",
++            mysql_con->server_version ? mysql_con->server_version : "unknown",
++            ignore_errors ? "Continuing due to --force, backup may not be consistent across all tables!" : "Aborting.");
++    if (!ignore_errors)
++      exit(EX_MYSQLERR);
++  }
++
+   return (mysql_query_with_error_report(mysql_con, 0,
+                                         "SET SESSION TRANSACTION ISOLATION "
+                                         "LEVEL REPEATABLE READ") ||
+diff -urN mysql-4.1.23/client/mysqltest.c mysql-4.1/client/mysqltest.c
+--- mysql-4.1.23/client/mysqltest.c	2007-12-02 20:38:52.000000000 +0100
++++ mysql-4.1/client/mysqltest.c	2007-06-01 19:57:26.000000000 +0200
+@@ -1125,6 +1125,50 @@
+ }
+ 
+ 
++/*
++   Remove surrounding chars from string
++
++   Return 1 if first character is found but not last
++*/
++static int strip_surrounding(char* str, char c1, char c2)
++{
++  char* ptr= str;
++
++  /* Check if the first non space character is c1 */
++  while(*ptr && my_isspace(charset_info, *ptr))
++    ptr++;
++  if (*ptr == c1)
++  {
++    /* Replace it with a space */
++    *ptr= ' ';
++
++    /* Last non space charecter should be c2 */
++    ptr= strend(str)-1;
++    while(*ptr && my_isspace(charset_info, *ptr))
++      ptr--;
++    if (*ptr == c2)
++    {
++      /* Replace it with \0 */
++      *ptr= 0;
++    }
++    else
++    {
++      /* Mismatch detected */
++      return 1;
++    }
++  }
++  return 0;
++}
++
++
++static void strip_parentheses(struct st_command *command)
++{
++  if (strip_surrounding(command->first_argument, '(', ')'))
++      die("%.*s - argument list started with '%c' must be ended with '%c'",
++          command->first_word_len, command->query, '(', ')');
++}
++
++
+ static byte *get_var_key(const byte* var, uint* len,
+                   my_bool __attribute__((unused)) t)
+ {
+@@ -1380,12 +1424,11 @@
+   init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
+   do_eval(&ds_query, query, end, FALSE);
+ 
+-  if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
+-      !(res = mysql_store_result(mysql)))
+-  {
++  if (mysql_real_query(mysql, ds_query.str, ds_query.length))
+     die("Error running query '%s': %d %s", ds_query.str,
+ 	mysql_errno(mysql), mysql_error(mysql));
+-  }
++  if (!(res= mysql_store_result(mysql)))
++    die("Query '%s' didn't return a result set", ds_query.str);
+   dynstr_free(&ds_query);
+ 
+   if ((row = mysql_fetch_row(res)) && row[0])
+@@ -1440,6 +1483,130 @@
+ }
+ 
+ 
++/*
++  Set variable from the result of a field in a query
++
++  This function is useful when checking for a certain value
++  in the output from a query that can't be restricted to only
++  return some values. A very good example of that is most SHOW
++  commands.
++
++  SYNOPSIS
++  var_set_query_get_value()
++
++  DESCRIPTION
++  let $variable= query_get_value(<query to run>,<column name>,<row no>);
++
++  <query to run> -    The query that should be sent to the server
++  <column name> -     Name of the column that holds the field be compared
++                      against the expected value
++  <row no> -          Number of the row that holds the field to be
++                      compared against the expected value
++
++*/
++
++void var_set_query_get_value(struct st_command *command, VAR *var)
++{
++  ulong row_no;
++  int col_no= -1;
++  MYSQL_RES* res;
++  MYSQL* mysql= &cur_con->mysql;
++
++  static DYNAMIC_STRING ds_query;
++  static DYNAMIC_STRING ds_col;
++  static DYNAMIC_STRING ds_row;
++  const struct command_arg query_get_value_args[] = {
++    "query", ARG_STRING, TRUE, &ds_query, "Query to run",
++    "column name", ARG_STRING, TRUE, &ds_col, "Name of column",
++    "row number", ARG_STRING, TRUE, &ds_row, "Number for row",
++  };
++
++  DBUG_ENTER("var_set_query_get_value");
++  LINT_INIT(res);
++
++  strip_parentheses(command);
++  DBUG_PRINT("info", ("query: %s", command->query));
++  check_command_args(command, command->first_argument, query_get_value_args,
++                     sizeof(query_get_value_args)/sizeof(struct command_arg),
++                     ',');
++
++  DBUG_PRINT("info", ("query: %s", ds_query.str));
++  DBUG_PRINT("info", ("col: %s", ds_col.str));
++
++  /* Convert row number to int */
++  if (!str2int(ds_row.str, 10, (long) 0, (long) INT_MAX, &row_no))
++    die("Invalid row number: '%s'", ds_row.str);
++  DBUG_PRINT("info", ("row: %s, row_no: %ld", ds_row.str, row_no));
++  dynstr_free(&ds_row);
++
++  /* Remove any surrounding "'s from the query - if there is any */
++  if (strip_surrounding(ds_query.str, '"', '"'))
++    die("Mismatched \"'s around query '%s'", ds_query.str);
++
++  /* Run the query */
++  if (mysql_real_query(mysql, ds_query.str, ds_query.length))
++    die("Error running query '%s': %d %s", ds_query.str,
++	mysql_errno(mysql), mysql_error(mysql));
++  if (!(res= mysql_store_result(mysql)))
++    die("Query '%s' didn't return a result set", ds_query.str);
++
++  {
++    /* Find column number from the given column name */
++    uint i;
++    uint num_fields= mysql_num_fields(res);
++    MYSQL_FIELD *fields= mysql_fetch_fields(res);
++
++    for (i= 0; i < num_fields; i++)
++    {
++      if (strcmp(fields[i].name, ds_col.str) == 0 &&
++          strlen(fields[i].name) == ds_col.length)
++      {
++        col_no= i;
++        break;
++      }
++    }
++    if (col_no == -1)
++    {
++      mysql_free_result(res);
++      die("Could not find column '%s' in the result of '%s'",
++          ds_col.str, ds_query.str);
++    }
++    DBUG_PRINT("info", ("Found column %d with name '%s'",
++                        i, fields[i].name));
++  }
++  dynstr_free(&ds_col);
++
++  {
++    /* Get the value */
++    MYSQL_ROW row;
++    ulong rows= 0;
++    const char* value= "No such row";
++
++    while ((row= mysql_fetch_row(res)))
++    {
++      if (++rows == row_no)
++      {
++
++        DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
++                            row_no, col_no, row[col_no]));
++        /* Found the row to get */
++        if (row[col_no])
++          value= row[col_no];
++        else
++          value= "NULL";
++
++        break;
++      }
++    }
++    eval_expr(var, value, 0);
++  }
++  dynstr_free(&ds_query);
++  mysql_free_result(res);
++
++  DBUG_VOID_RETURN;
++}
++
++
+ void var_copy(VAR *dest, VAR *src)
+ {
+   dest->int_val= src->int_val;
+@@ -1463,26 +1630,47 @@
+ 
+ void eval_expr(VAR *v, const char *p, const char **p_end)
+ {
+-  static int MIN_VAR_ALLOC= 32; /* MASV why 32? */
+-  VAR *vp;
++
++  DBUG_ENTER("eval_expr");
++  DBUG_PRINT("enter", ("p: '%s'", p));
++
+   if (*p == '$')
+   {
++    VAR *vp;
+     if ((vp= var_get(p, p_end, 0, 0)))
+-    {
+       var_copy(v, vp);
+-      return;
+-    }
++    DBUG_VOID_RETURN;
+   }
+-  else if (*p == '`')
++
++  if (*p == '`')
+   {
+     var_query_set(v, p, p_end);
++    DBUG_VOID_RETURN;
+   }
+-  else
++
++  {
++    /* Check if this is a "let $var= query_get_value()" */
++    const char* get_value_str= "query_get_value";
++    const size_t len= strlen(get_value_str);
++    if (strncmp(p, get_value_str, len)==0)
++    {
++      struct st_command command;
++      memset(&command, 0, sizeof(command));
++      command.query= (char*)p;
++      command.first_word_len= len;
++      command.first_argument= command.query + len;
++      command.end= (char*)*p_end;
++      var_set_query_get_value(&command, v);
++      DBUG_VOID_RETURN;
++    }
++  }
++
+   {
+     int new_val_len = (p_end && *p_end) ?
+       (int) (*p_end - p) : (int) strlen(p);
+     if (new_val_len + 1 >= v->alloced_len)
+     {
++      static int MIN_VAR_ALLOC= 32;
+       v->alloced_len = (new_val_len < MIN_VAR_ALLOC - 1) ?
+         MIN_VAR_ALLOC : new_val_len + 1;
+       if (!(v->str_val =
+@@ -1495,9 +1683,10 @@
+     memcpy(v->str_val, p, new_val_len);
+     v->str_val[new_val_len] = 0;
+     v->int_val=atoi(p);
++    DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
+     v->int_dirty=0;
+   }
+-  return;
++  DBUG_VOID_RETURN;
+ }
+ 
+ 
+@@ -3432,7 +3621,6 @@
+   int con_port= port;
+   char *con_options;
+   bool con_ssl= 0, con_compress= 0;
+-  char *ptr;
+ 
+   static DYNAMIC_STRING ds_connection_name;
+   static DYNAMIC_STRING ds_host;
+@@ -3460,20 +3648,7 @@
+   DBUG_ENTER("do_connect");
+   DBUG_PRINT("enter",("connect: %s", command->first_argument));
+ 
+-  /* Remove parenteses around connect arguments */
+-  if ((ptr= strstr(command->first_argument, "(")))
+-  {
+-    /* Replace it with a space */
+-    *ptr= ' ';
+-    if ((ptr= strstr(command->first_argument, ")")))
+-    {
+-      /* Replace it with \0 */
+-      *ptr= 0;
+-    }
+-    else
+-      die("connect - argument list started with '(' must be ended with ')'");
+-  }
+-
++  strip_parentheses(command);
+   check_command_args(command, command->first_argument, connect_args,
+                      sizeof(connect_args)/sizeof(struct command_arg),
+                      ',');
+@@ -4173,16 +4348,12 @@
+     DBUG_RETURN(0);
+   }
+   if (!(*command_ptr= command=
+-        (struct st_command*) my_malloc(sizeof(*command), MYF(MY_WME))) ||
++        (struct st_command*) my_malloc(sizeof(*command),
++                                       MYF(MY_WME|MY_ZEROFILL))) ||
+       insert_dynamic(&q_lines, (gptr) &command))
+     die(NullS);
+-
+-  command->require_file[0]= 0;
+-  command->first_word_len= 0;
+-  command->query_len= 0;
+-
+   command->type= Q_UNKNOWN;
+-  command->query_buf= command->query= 0;
++
+   read_command_buf[0]= 0;
+   if (read_line(read_command_buf, sizeof(read_command_buf)))
+   {
+diff -urN mysql-4.1.23/cmd-line-utils/libedit/el_term.h mysql-4.1/cmd-line-utils/libedit/el_term.h
+--- mysql-4.1.23/cmd-line-utils/libedit/el_term.h	2007-12-02 20:38:26.000000000 +0100
++++ mysql-4.1/cmd-line-utils/libedit/el_term.h	2007-06-04 16:42:35.000000000 +0200
+@@ -90,6 +90,16 @@
+ extern char* tgetstr(char*, char**);
+ #endif
+ 
++
++#if !HAVE_DECL_TGOTO
++/*
++  'tgoto' is not declared in the system header files, this causes
++  problems on 64-bit systems. The function returns a 64 bit pointer
++  but caller see it as "int" and it's thus truncated to 32-bit
++*/
++extern char* tgoto(const char*, int, int);
++#endif
++
+ protected void	term_move_to_line(EditLine *, int);
+ protected void	term_move_to_char(EditLine *, int);
+ protected void	term_clear_EOL(EditLine *, int);
+diff -urN mysql-4.1.23/configure.in mysql-4.1/configure.in
+--- mysql-4.1.23/configure.in	2007-12-02 20:38:26.000000000 +0100
++++ mysql-4.1/configure.in	2007-06-18 22:10:51.000000000 +0200
+@@ -5,7 +5,7 @@
+ AC_CANONICAL_SYSTEM
+ # The Docs Makefile.am parses this line!
+ # remember to also change ndb version below and update version.c in ndb
+-AM_INIT_AUTOMAKE(mysql, 4.1.23)
++AM_INIT_AUTOMAKE(mysql, 4.1.24)
+ AM_CONFIG_HEADER(config.h)
+ 
+ PROTOCOL_VERSION=10
+@@ -21,7 +21,7 @@
+ # ndb version
+ NDB_VERSION_MAJOR=4
+ NDB_VERSION_MINOR=1
+-NDB_VERSION_BUILD=23
++NDB_VERSION_BUILD=24
+ NDB_VERSION_STATUS=""
+ 
+ # Set all version vars based on $VERSION. How do we do this more elegant ?
+@@ -1960,6 +1960,19 @@
+ fi
+ AC_SUBST(TERMCAP_LIB)
+ 
++# Check if the termcap function 'tgoto' is already declared in
++# system header files or if it need to be declared locally
++AC_CHECK_DECLS(tgoto,,,[
++#ifdef HAVE_CURSES_H
++# include <curses.h>
++#elif HAVE_NCURSES_H
++# include <ncurses.h>
++#endif
++#ifdef HAVE_TERM_H
++# include <term.h>
++#endif
++])
++
+ LIBEDIT_LOBJECTS=""
+ AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"])
+ AC_CHECK_FUNC(strvis,   ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"])
+diff -urN mysql-4.1.23/Docs/INSTALL-BINARY mysql-4.1/Docs/INSTALL-BINARY
+--- mysql-4.1.23/Docs/INSTALL-BINARY	1970-01-01 01:00:00.000000000 +0100
++++ mysql-4.1/Docs/INSTALL-BINARY	2007-11-02 01:29:32.000000000 +0100
+@@ -0,0 +1,8 @@
++
++You can find information about how to install binary distributions at
++
++  http://dev.mysql.com/doc/refman/4.1/en/quick-standard-installation.html
++
++The MySQL Reference Manual is also available in various formats on
++http://dev.mysql.com/doc; if you're interested in the DocBook XML
++sources go to http://svn.mysql.com.
+diff -urN mysql-4.1.23/Docs/Makefile.am mysql-4.1/Docs/Makefile.am
+--- mysql-4.1.23/Docs/Makefile.am	2007-12-02 20:38:26.000000000 +0100
++++ mysql-4.1/Docs/Makefile.am	2007-11-02 13:13:51.000000000 +0100
+@@ -14,14 +14,7 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ 
+-noinst_SCRIPTS =	Support/generate-text-files.pl
+-
+-EXTRA_DIST =		$(noinst_SCRIPTS) mysql.info INSTALL-BINARY
+-
+-TXT_FILES=		../INSTALL-SOURCE ../INSTALL-WIN-SOURCE \
+-			INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
+-
+-all-local:		$(TXT_FILES)
++EXTRA_DIST =		mysql.info INSTALL-BINARY
+ 
+ # make sure that "make install" installs the info page, too
+ # automake only seems to take care of this automatically,
+@@ -33,26 +26,5 @@
+ uninstall-local:
+ 	@RM@ -f $(DESTDIR)$(infodir)/mysql.info
+ 
+-# This target is not used in builds, just for convinience
+-CLEAN_FILES:		$(TXT_FILES)
+-	touch $(TXT_FILES)
+-
+-GT = $(srcdir)/Support/generate-text-files.pl
+-
+-../INSTALL-SOURCE:	$(srcdir)/mysql.info $(GT)
+-	perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@
+-
+-../INSTALL-WIN-SOURCE:	$(srcdir)/mysql.info $(GT)
+-	perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@
+-
+-# We put the description for the binary installation here so that
+-# people who download source wont have to see it. It is moved up to
+-# the toplevel by the script that makes the binary tar files.
+-INSTALL-BINARY:	$(srcdir)/mysql.info $(GT)
+-	perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@
+-
+-../support-files/MacOSX/ReadMe.txt:	$(srcdir)/mysql.info $(GT)
+-	perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@
+-
+ # Don't update the files from bitkeeper
+ %::SCCS/s.%
+diff -urN mysql-4.1.23/Docs/mysql.info mysql-4.1/Docs/mysql.info
+--- mysql-4.1.23/Docs/mysql.info	2007-12-02 20:38:26.000000000 +0100
++++ mysql-4.1/Docs/mysql.info	2007-11-02 01:31:55.000000000 +0100
+@@ -1,27 +1,4 @@
+-This is mysql.info, produced by makeinfo version 4.8 from manual.texi.
+ 
+-START-INFO-DIR-ENTRY
+-* mysql: (mysql).               MySQL documentation.
+-END-INFO-DIR-ENTRY
+-
+-
+-File: mysql.info,  Node: Top,  Next: (dir),  Prev: (dir),  Up: (dir)
+-
+-This is an empty placeholder file for the MySQL manual.
+-
+-The MySQL manual is now maintained in a separate BitKeeper source tree!
+-Please see `http://www.mysql.com/doc/en/Installing_source_tree.html'
+-for more info on how to work with BitKeeper.
+-
+-This file will be replaced with the current `mysql.info' when building
+-the official source distribution.
+-
+-You can find a specific manual for any older version of MySQL in the
+-binary or source distribution for that version.
+-
+-
+-
+-Tag Table:
+-Node: Top166
+-
+-End Tag Table
++The MySQL Reference Manual is available in various formats on
++http://dev.mysql.com/doc; if you're interested in the DocBook XML
++sources go to http://svn.mysql.com.
+diff -urN mysql-4.1.23/Docs/Support/generate-text-files.pl mysql-4.1/Docs/Support/generate-text-files.pl
+--- mysql-4.1.23/Docs/Support/generate-text-files.pl	2007-12-02 20:38:25.000000000 +0100
++++ mysql-4.1/Docs/Support/generate-text-files.pl	1970-01-01 01:00:00.000000000 +0100
+@@ -1,43 +0,0 @@
+-#!/usr/bin/perl -w -*- perl -*-
+-# Generate text files from top directory from the manual.
+-
+-$from = shift(@ARGV);
+-$fnode = shift(@ARGV);
+-$tnode = shift(@ARGV);
+-
+-open(IN, "$from") || die "Cannot open $from: $!";
+-
+-$in = 0;
+-
+-while (<IN>)
+-{
+-  if ($in)
+-  {
+-    if (/Node: $tnode,/ || /\[index/)
+-    {
+-      $in = 0;
+-    }
+-    elsif (/^File: mysql.info/ || (/^/))
+-    {
+-      # Just Skip node beginnings
+-    }
+-    else
+-    {
+-      print;
+-    }
+-  }
+-  else
+-  {
+-    if (/Node: $fnode,/)
+-    {
+-      $in = 1;
+-      # Skip first empty line
+-      <IN>;
+-    }
+-  }
+-}
+-
+-close(IN);
+-
+-die "Could not find node \"$tnode\"" if ($in == 1);
+-exit 0;
+diff -urN mysql-4.1.23/heap/hp_delete.c mysql-4.1/heap/hp_delete.c
+--- mysql-4.1.23/heap/hp_delete.c	2007-12-02 20:38:25.000000000 +0100
++++ mysql-4.1/heap/hp_delete.c	2007-09-13 12:39:15.000000000 +0200
+@@ -73,10 +73,7 @@
+   int res;
+ 
+   if (flag) 
+-  {
+     info->last_pos= NULL; /* For heap_rnext/heap_rprev */
+-    info->lastkey_len= 0;
+-  }
+ 
+   custom_arg.keyseg= keyinfo->seg;
+   custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
+diff -urN mysql-4.1.23/heap/hp_rfirst.c mysql-4.1/heap/hp_rfirst.c
+--- mysql-4.1.23/heap/hp_rfirst.c	2007-12-02 20:38:51.000000000 +0100
++++ mysql-4.1/heap/hp_rfirst.c	2007-09-13 12:39:15.000000000 +0200
+@@ -36,6 +36,17 @@
+ 	     sizeof(byte*));
+       info->current_ptr = pos;
+       memcpy(record, pos, (size_t)share->reclength);
++      /*
++        If we're performing index_first on a table that was taken from
++        table cache, info->lastkey_len is initialized to previous query.
++        Thus we set info->lastkey_len to proper value for subsequent
++        heap_rnext() calls.
++        This is needed for DELETE queries only, otherwise this variable is
++        not used.
++        Note that the same workaround may be needed for heap_rlast(), but
++        for now heap_rlast() is never used for DELETE queries.
++      */
++      info->lastkey_len= 0;
+       info->update = HA_STATE_AKTIV;
+     }
+     else
+diff -urN mysql-4.1.23/heap/hp_rnext.c mysql-4.1/heap/hp_rnext.c
+--- mysql-4.1.23/heap/hp_rnext.c	2007-12-02 20:38:52.000000000 +0100
++++ mysql-4.1/heap/hp_rnext.c	2007-09-13 12:39:15.000000000 +0200
+@@ -34,11 +34,40 @@
+     heap_rb_param custom_arg;
+ 
+     if (info->last_pos)
++    {
++      /*
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list