Commit 0260e3dc authored by unknown's avatar unknown
Browse files

Merge


configure.in:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
storage/ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
sql/sql_table.cc:
  SCCS merged
parents 54e99aa5 b50eb4cd
Loading
Loading
Loading
Loading
+24 −41
Original line number Diff line number Diff line
This is a release of MySQL, a GPL (free) SQL database server (more
licence information in the PUBLIC file and in the reference manual).
This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at MySQL AB.

Please read the "Upgrading from..." section in the manual first, if you are
migrating from older versions of MySQL!
License information can be found in these files:
- For GPL (free) distributions, see the COPYING file.
- For commercial distributions, see the MySQLEULA.txt file.

The latest information about MySQL can be found at:
http://www.mysql.com

To see what it can do take a look at the features section in the
manual.
For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http:/dev.mysql.com/doc

For installation instructions see the Installation chapter in the
manual.
Some manual sections of special interest:

For future plans see the TODO appendix in the manual.
- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installation chapter.
- For future plans, see the TODO appendix.
- For the new features/bugfix history, see the News appendix.
- For the currently known bugs/misfeatures (known errors) see the problems
  appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

New features/bug fixes history is in the news appendix in the manual.

For the currently known bugs/misfeatures (known errors) see the bugs
appendix in the manual.

For examples of SQL and benchmarking information see the bench
directory.

The manual mentioned above can be found in the Docs directory. The
manual is available in the following formats: as plain ASCII text in
Docs/manual.txt, in HTML format in Docs/manual_toc.html, as GNU Info in
Docs/mysql.info and as PostScript in Docs/manual.ps.

MySQL is brought to you by the MySQL team at MySQL AB

For a list of developers and other contributors, see the Credits appendix
in the manual.
A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Send bug (error) reports, questions and comments to the mailing list
at mysql@lists.mysql.com

Please use the 'mysqlbug' script when posting bug reports or questions
about MySQL. mysqlbug will gather some information about your system
and start your editor with a form in which you can describe your
problem. Bug reports might be silently ignored by the MySQL
maintainers if there is not a good reason included in the report as to
why mysqlbug has not been used. A report that says 'MySQL does not
work for me. Why?' is not considered a valid bug report.

The mysqlbug script can be found in the 'scripts' directory of the
distribution, that is '<where-you-installed-mysql>/scripts'.
Bug or error reports should be sent to http://bugs.mysql.com.
+2 −1
Original line number Diff line number Diff line
@@ -2382,7 +2382,8 @@ int read_line(char *buf, int size)
    if (feof(cur_file->file))
    {
  found_eof:
      if (cur_file->file != stdin){
      if (cur_file->file != stdin)
      {
	my_fclose(cur_file->file, MYF(0));
        cur_file->file= 0;
      }
+2 −2
Original line number Diff line number Diff line
@@ -343,7 +343,7 @@ case $default_charset in
      default_charset_default_collation="ucs2_general_ci"
      define(UCSC1, ucs2_general_ci ucs2_bin)
      define(UCSC2, ucs2_czech_ci ucs2_danish_ci)
      define(UCSC3, ucs2_estonian_ci ucs2_icelandic_ci)
      define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_icelandic_ci)
      define(UCSC4, ucs2_latvian_ci ucs2_lithuanian_ci)
      define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci)
      define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci)
@@ -367,7 +367,7 @@ case $default_charset in
      else
        define(UTFC1, utf8_general_ci utf8_bin)
        define(UTFC2, utf8_czech_ci utf8_danish_ci)
        define(UTFC3, utf8_estonian_ci utf8_icelandic_ci)
        define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_icelandic_ci)
        define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
        define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
        define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
+31 −71
Original line number Diff line number Diff line
@@ -323,19 +323,19 @@ case "$target_os" in
       ;;
     esac
  ;;
  sysv5UnixWare*) 
  sysv5UnixWare* | sysv5OpenUNIX8*) 
    if test "$GCC" != "yes"; then
      # We are using built-in inline function
      # Use the built-in alloca()
      CFLAGS="$CFLAGS -Kalloca"
    fi
    CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
  ;;
  sysv5OpenUNIX8*) 
  sysv5SCO_SV6.0.0*)
    if test "$GCC" != "yes"; then
      # We are using built-in inline function
      # Use the built-in alloca()
      CFLAGS="$CFLAGS -Kalloca"
      CXXFLAGS="$CFLAGS -Kalloca"
    fi
    CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA"
  ;;
esac
AC_SUBST(CC)
@@ -1048,6 +1048,15 @@ case $SYSTEM_TYPE in
      MAX_C_OPTIMIZE="-O"
    fi
    ;;
  *darwin9*)
    if test "$ac_cv_prog_gcc" = "yes"
    then
      FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT"
      CFLAGS="$CFLAGS $FLAGS"
      CXXFLAGS="$CXXFLAGS $FLAGS"
      MAX_C_OPTIMIZE="-O"
    fi
    ;;
  *freebsd*)
    AC_MSG_WARN([Adding fix for interrupted reads])
    OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'`
@@ -1360,8 +1369,6 @@ then
          if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
          then
            AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
          else
            AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
          fi
          AC_MSG_RESULT("yes")
          # We must have cc
@@ -1387,87 +1394,40 @@ then
    AC_MSG_RESULT("no")
  fi
fi
# Hack for SCO UnixWare7
#
if test "$with_named_thread" = "no"
then
  AC_MSG_CHECKING("SCO UnixWare7 native threads")
  if expr "$SYSTEM_TYPE" : ".*UnixWare*" > /dev/null
  then
    if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
    then
      MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
      if expr "$CC" : ".*gcc.*"
        then
          with_named_thread="-pthread -lsocket -lnsl"
      else
        with_named_thread="-Kthread -lsocket -lnsl"
      fi
      if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
      then
        AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1])
      else
        AC_DEFINE(HAVE_UNIXWARE7_POSIX, [1])
      fi
      # We must have cc
      AC_MSG_CHECKING("for gcc")
      if expr "$CC" : ".*gcc.*"
      then
	CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
	CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
      else
	CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
	CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
      fi
      AC_MSG_RESULT("yes")
    else
      AC_MSG_ERROR([configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual.]) 
    fi
  else
    AC_MSG_RESULT("no")
  fi
fi

# Hack for Caldera OpenUNIX8
#
# Check for SCO threading libraries
#
if test "$with_named_thread" = "no"
then
  AC_MSG_CHECKING("OpenUNIX8 native threads")
  if expr "$SYSTEM_TYPE" : ".*OpenUNIX*" > /dev/null
  AC_MSG_CHECKING([SCO OpenServer 6, UnixWare 7 or OpenUNIX 8 native threads])
  if expr "$SYSTEM_TYPE" : ".*UnixWare.*" > /dev/null || \
     expr "$SYSTEM_TYPE" : ".*SCO_SV6.*" > /dev/null || \
     expr "$SYSTEM_TYPE" : ".*OpenUNIX.*" > /dev/null
  then
    if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so
    then
      MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK
      if expr "$CC" : ".*gcc.*"
      if expr "$CC" : ".*gcc.*" > /dev/null
      then
        with_named_thread="-pthread -lsocket -lnsl"
	CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
	CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
      else
        with_named_thread="-Kthread -lsocket -lnsl"
	CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
	CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK";
      fi
      if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null
      then
        AC_DEFINE([HAVE_UNIXWARE7_THREADS], [1],
                  [UNIXWARE7 threads are not posix])
      else
        AC_DEFINE([HAVE_UNIXWARE7_POSIX], [1],
                  [new UNIXWARE7 threads that are not yet posix])
        AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1], [Have UnixWare 7 (or similar) almost-POSIX threading library])
      fi
      # We must have cc
      AC_MSG_CHECKING("for gcc")
      if expr "$CC" : ".*gcc.*"
      then
	CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
	CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
      else
 	CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
 	CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"
      fi
      AC_MSG_RESULT("yes")
      AC_MSG_RESULT(yes)
    else
      AC_MSG_ERROR([configure: error: Can't find thread libs on Caldera OpenUNIX 8. See the Installation chapter in the Reference Manual.]) 
      AC_MSG_ERROR([configure: error: Can't find thread library on SCO/Caldera system. See the Installation chapter in the Reference Manual.]) 
    fi
  else
    AC_MSG_RESULT("no")
    AC_MSG_RESULT(no)
  fi
fi

@@ -2510,7 +2470,7 @@ then
      AC_CONFIG_FILES(storage/bdb/Makefile)

      echo "CONFIGURING FOR BERKELEY DB" 
      bdb_conf_flags="--disable-shared"
      bdb_conf_flags="--disable-shared --build=$build_alias"
      if test $with_debug = "yes"
      then
        bdb_conf_flags="$bdb_conf_flags --enable-debug --enable-diagnostic"
+200 −178
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
  Published with a permission.
*/

// needed to have access to 64 bit file functions
/* needed to have access to 64 bit file functions */
#define _LARGEFILE_SOURCE
#define _LARGEFILE64_SOURCE

@@ -35,7 +35,7 @@
#include <sys/stat.h>
#include <unistd.h>

// all of these ripped from InnoDB code from MySQL 4.0.22
/* all of these ripped from InnoDB code from MySQL 4.0.22 */
#define UT_HASH_RANDOM_MASK     1463735687
#define UT_HASH_RANDOM_MASK2    1653893711
#define FIL_PAGE_LSN          16 
@@ -46,14 +46,15 @@
#define FIL_PAGE_SPACE_OR_CHKSUM 0
#define UNIV_PAGE_SIZE          (2 * 8192)

// command line argument to do page checks (that's it)
// another argument to specify page ranges... seek to right spot and go from there
/* command line argument to do page checks (that's it) */
/* another argument to specify page ranges... seek to right spot and go from there */

typedef unsigned long int ulint;
typedef unsigned char byte;

/* innodb function in name; modified slightly to not have the ASM version (lots of #ifs that didn't apply) */
ulint mach_read_from_4(byte *b) {
ulint mach_read_from_4(byte *b)
{
  return( ((ulint)(b[0]) << 24)
          + ((ulint)(b[1]) << 16)
          + ((ulint)(b[2]) << 8)
@@ -82,7 +83,8 @@ ut_fold_binary(
    ulint   i;
    ulint   fold= 0;

    for (i = 0; i < len; i++) {
    for (i= 0; i < len; i++)
    {
      fold= ut_fold_ulint_pair(fold, (ulint)(*str));

      str++;
@@ -132,28 +134,31 @@ buf_calc_page_old_checksum(
}


int main(int argc, char **argv) {
    FILE *f; // our input file
    byte *p; // storage of pages read
    int bytes; // bytes read count
    ulint ct; // current page number (0 based)
    int now; // current time
    int lastt; // last time
    ulint oldcsum, oldcsumfield, csum, csumfield, logseq, logseqfield; // ulints for checksum storage
    struct stat st; // for stat, if you couldn't guess
    unsigned long long int size; // size of file (has to be 64 bits)
    ulint pages; // number of pages in file
    ulint start_page = 0, end_page = 0, use_end_page = 0; // for starting and ending at certain pages
int main(int argc, char **argv)
{
  FILE *f;                     /* our input file */
  byte *p;                     /* storage of pages read */
  int bytes;                   /* bytes read count */
  ulint ct;                    /* current page number (0 based) */
  int now;                     /* current time */
  int lastt;                   /* last time */
  ulint oldcsum, oldcsumfield, csum, csumfield, logseq, logseqfield; /* ulints for checksum storage */
  struct stat st;              /* for stat, if you couldn't guess */
  unsigned long long int size; /* size of file (has to be 64 bits) */
  ulint pages;                 /* number of pages in file */
  ulint start_page= 0, end_page= 0, use_end_page= 0; /* for starting and ending at certain pages */
  off_t offset= 0;
    int just_count = 0; // if true, just print page count
  int just_count= 0;          /* if true, just print page count */
  int verbose= 0;
  int debug= 0;
  int c;
  int fd;

    // remove arguments
    while ((c = getopt(argc, argv, "cvds:e:p:")) != -1) {
        switch (c) {
  /* remove arguments */
  while ((c= getopt(argc, argv, "cvds:e:p:")) != -1)
  {
    switch (c)
    {
    case 'v':
      verbose= 1;
      break;
@@ -186,11 +191,12 @@ int main(int argc, char **argv) {
    }
  }

    // debug implies verbose...
  /* debug implies verbose... */
  if (debug) verbose= 1;

    // make sure we have the right arguments
    if (optind >= argc) {
  /* make sure we have the right arguments */
  if (optind >= argc)
  {
    printf("InnoDB offline file checksum utility.\n");
    printf("usage: %s [-c] [-s <start page>] [-e <end page>] [-p <page>] [-v] [-d] <filename>\n", argv[0]);
    printf("\t-c\tprint the count of pages in the file\n");
@@ -202,99 +208,115 @@ int main(int argc, char **argv) {
    return 1;
  }

    // stat the file to get size and page count
    if (stat(argv[optind], &st)) {
  /* stat the file to get size and page count */
  if (stat(argv[optind], &st))
  {
    perror("error statting file");
    return 1;
  }
  size= st.st_size;
  pages= size / UNIV_PAGE_SIZE;
    if (just_count) {
  if (just_count)
  {
    printf("%lu\n", pages);
    return 0;
    } else if (verbose) {
  }
  else if (verbose)
  {
    printf("file %s= %llu bytes (%lu pages)...\n", argv[1], size, pages);
    printf("checking pages in range %lu to %lu\n", start_page, use_end_page ? end_page : (pages - 1));
  }

    // open the file for reading
  /* open the file for reading */
  f= fopen(argv[optind], "r");
    if (!f) {
  if (!f)
  {
    perror("error opening file");
    return 1;
  }

    // seek to the necessary position
    if (start_page) {
  /* seek to the necessary position */
  if (start_page)
  {
    fd= fileno(f);
        if (!fd) {
    if (!fd)
    {
      perror("unable to obtain file descriptor number");
      return 1;
    }

    offset= (off_t)start_page * (off_t)UNIV_PAGE_SIZE;

        if (lseek(fd, offset, SEEK_SET) != offset) {
    if (lseek(fd, offset, SEEK_SET) != offset)
    {
      perror("unable to seek to necessary offset");
      return 1;
    }
  }

    // allocate buffer for reading (so we don't realloc every time)
  /* allocate buffer for reading (so we don't realloc every time) */
  p= (byte *)malloc(UNIV_PAGE_SIZE);

    // main checksumming loop
  /* main checksumming loop */
  ct= start_page;
  lastt= 0;
    while (!feof(f)) {
  while (!feof(f))
  {
    bytes= fread(p, 1, UNIV_PAGE_SIZE, f);
    if (!bytes && feof(f)) return 0;
        if (bytes != UNIV_PAGE_SIZE) {
    if (bytes != UNIV_PAGE_SIZE)
    {
      fprintf(stderr, "bytes read (%d) doesn't match universal page size (%d)\n", bytes, UNIV_PAGE_SIZE);
      return 1;
    }

        // check the "stored log sequence numbers"
    /* check the "stored log sequence numbers" */
    logseq= mach_read_from_4(p + FIL_PAGE_LSN + 4);
    logseqfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM + 4);
    if (debug)
      printf("page %lu: log sequence number: first = %lu; second = %lu\n", ct, logseq, logseqfield);
        if (logseq != logseqfield) {
    if (logseq != logseqfield)
    {
      fprintf(stderr, "page %lu invalid (fails log sequence number check)\n", ct);
      return 1;
    }

        // check old method of checksumming
    /* check old method of checksumming */
    oldcsum= buf_calc_page_old_checksum(p);
    oldcsumfield= mach_read_from_4(p + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM);
    if (debug)
      printf("page %lu: old style: calculated = %lu; recorded = %lu\n", ct, oldcsum, oldcsumfield);
        if (oldcsumfield != mach_read_from_4(p + FIL_PAGE_LSN) && oldcsumfield != oldcsum) {
    if (oldcsumfield != mach_read_from_4(p + FIL_PAGE_LSN) && oldcsumfield != oldcsum)
    {
      fprintf(stderr, "page %lu invalid (fails old style checksum)\n", ct);
      return 1;
    }

        // now check the new method
    /* now check the new method */
    csum= buf_calc_page_new_checksum(p);
    csumfield= mach_read_from_4(p + FIL_PAGE_SPACE_OR_CHKSUM);
    if (debug)
      printf("page %lu: new style: calculated = %lu; recorded = %lu\n", ct, csum, csumfield);
        if (csumfield != 0 && csum != csumfield) {
    if (csumfield != 0 && csum != csumfield)
    {
      fprintf(stderr, "page %lu invalid (fails new style checksum)\n", ct);
      return 1;
    }

        // end if this was the last page we were supposed to check
    /* end if this was the last page we were supposed to check */
    if (use_end_page && (ct >= end_page))
      return 0;

        // do counter increase and progress printing
    /* do counter increase and progress printing */
    ct++;
        if (verbose) {
            if (ct % 64 == 0) {
    if (verbose)
    {
      if (ct % 64 == 0)
      {
        now= time(0);
        if (!lastt) lastt= now;
                if (now - lastt >= 1) {
        if (now - lastt >= 1)
        {
          printf("page %lu okay: %.3f%% done\n", (ct - 1), (float) ct / pages * 100);
          lastt= now;
        }
Loading