Commit cca511f0 authored by Joerg Bruehe's avatar Joerg Bruehe
Browse files

Merge main 5.1 and the 5.1 version of the fix for bug#40546

parents fb7e23eb e66ea9eb
Loading
Loading
Loading
Loading
+25 −8
Original line number Diff line number Diff line
@@ -13,34 +13,51 @@ path=`dirname $0`

# Default to gcc for CC and CXX
if test -z "$CXX" ; then
  export CXX=gcc
  CXX=gcc
  # Set some required compile options
  if test -z "$CXXFLAGS" ; then
    export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
    CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
  fi
fi

if test -z "$CC" ; then
  export CC=gcc
  CC=gcc
fi


# Use ccache, if available
if ccache -V > /dev/null 2>&1
then
  if ! (echo "$CC" | grep "ccache" > /dev/null)
  if echo "$CC" | grep "ccache" > /dev/null
  then
    export CC="ccache $CC"
    :
  else
    CC="ccache $CC"
  fi
  if ! (echo "$CXX" | grep "ccache" > /dev/null)
  if echo "$CXX" | grep "ccache" > /dev/null
  then
    export CXX="ccache $CXX"
    :
  else
    CXX="ccache $CXX"
  fi
fi

if test -z "$MAKE"
then
  if gmake -v > /dev/null 2>&1
  then
    MAKE="gmake"
  else
    MAKE="make"
  fi
fi

export CC CXX MAKE

# Make sure to enable all features that affect "make dist"
# Remember that configure restricts the man pages to the configured features !
./configure \
  --with-embedded-server \
  --with-ndbcluster
make
$MAKE
+38 −28
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
#
# When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 5.1.29)
AM_INIT_AUTOMAKE(mysql, 5.1.30)
AM_CONFIG_HEADER([include/config.h:config.h.in])

PROTOCOL_VERSION=10
@@ -405,12 +405,15 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln)
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
case $SYSTEM_TYPE in
  *netware*) ;;
  *)
    # If ln -f does not exists use -s (AFS systems)
    if test -n "$LN_CP_F"; then
      LN_CP_F="$LN_CP_F -s"
    fi
fi
    ;;
esac

AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm)
@@ -1642,14 +1645,16 @@ else
  OPTIMIZE_CXXFLAGS="-O"
fi

if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then
case $SYSTEM_TYPE in
  *netware*)
    DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
    DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
    DEBUG_OPTIMIZE_CC="-DDEBUG"
    DEBUG_OPTIMIZE_CXX="-DDEBUG"
    OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
    OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
fi
    ;;
esac

# If the user specified CFLAGS, we won't add any optimizations
if test -n "$SAVE_CFLAGS"
@@ -1915,7 +1920,9 @@ MYSQL_TZNAME
# Do the c++ compiler have a bool type
MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then
case $SYSTEM_TYPE in
  *netware*) ;;
  *)
    MYSQL_CHECK_LONGLONG_TO_FLOAT
    if test "$ac_cv_conv_longlong_to_float" != "yes"
    then
@@ -1923,7 +1930,8 @@ then
 If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
    again])
    fi
fi
    ;;
esac
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
AC_CHECK_TYPES([u_int32_t])
@@ -2549,11 +2557,12 @@ readline_h_ln_cmd=""
readline_link=""
want_to_use_readline="no"

if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null
then
case $SYSTEM_TYPE in
  *netware*)
    # For NetWare, do not need readline
    echo "Skipping readline"
else
    ;;
  *)
    if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
    then
	readline_topdir="cmd-line-utils"
@@ -2606,7 +2615,8 @@ else
	      be built with libreadline. Please use --with-libedit to use
	      the bundled version of libedit instead.])
    fi
fi
    ;;
esac

AC_SUBST(readline_dir)
AC_SUBST(readline_topdir)
+99 −0
Original line number Diff line number Diff line
@@ -471,3 +471,102 @@ source include/diff_tables.inc;
connection master;
drop table t1;
sync_slave_with_master;

#
# BUG#40004: Replication failure with no PK + no indexes
#

# The test cases are taken from the bug report. It is difficult to
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
# with the test cases we have.

connection master;

eval CREATE TABLE t1 (a int) ENGINE=$type;

INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT INTO t1 ( a ) VALUES ( 2 );
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT INTO t1 ( a ) VALUES ( 5 );

UPDATE t1 SET a = 5 WHERE a = 9;
DELETE FROM t1 WHERE a < 6;
UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;

sync_slave_with_master;

let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;

connection master;
drop table t1;
sync_slave_with_master;

#
# Bug #39752: Replication failure on RBR + MyISAM + no PK
#

# The test cases are taken from the bug report. It is difficult to
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
# with the test cases we have.

connection master;

--disable_warnings
eval CREATE TABLE t1 (a bit) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
INSERT INTO t1 ( a ) VALUES ( 5 );
DELETE FROM t1 WHERE a < 2 LIMIT 4;
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 9 );
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 8 );
UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
INSERT INTO t1 ( a ) VALUES ( 4 );
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
DELETE FROM t1 WHERE a = 4 LIMIT 7;
UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
DELETE FROM t1 WHERE a < 0 LIMIT 5;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
DELETE FROM t1 WHERE a < 8 LIMIT 8;
INSERT INTO t1 ( a ) VALUES ( 6 );
DELETE FROM t1 WHERE a < 6 LIMIT 7;
UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 7 );
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT INTO t1 ( a ) VALUES ( 6 );
UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
DELETE FROM t1 WHERE a = 2 LIMIT 9;
DELETE FROM t1 WHERE a = 1 LIMIT 4;
UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
INSERT INTO t1 ( a ) VALUES ( 0 );
DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
--enable_warnings

sync_slave_with_master;

let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;

connection master;
drop table t1;
sync_slave_with_master;
+12 −0
Original line number Diff line number Diff line
@@ -1222,4 +1222,16 @@ ALTER TABLE t1 CHANGE d c varchar(10);
affected rows: 0
info: Records: 0  Duplicates: 0  Warnings: 0
DROP TABLE t1;
CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY, 
b ENUM('a', 'b', 'c') NOT NULL);
INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a');
ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL;
SELECT * FROM t1;
a	b
1	a
2	c
3	b
4	b
5	a
DROP TABLE t1;
End of 5.1 tests
+3 −0
Original line number Diff line number Diff line
SELECT @@GLOBAL.binlog_format;
@@GLOBAL.binlog_format
STATEMENT
'#---------------------BS_STVARS_002_01----------------------#'
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
Loading