Commit aa97db19 authored by unknown's avatar unknown
Browse files

Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new


mysql-test/t/disabled.def:
  Auto merged
parents ed8b7459 14a48241
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
#
# Test of auto_increment with offset
#
#####################################
# By: JBM
# Date: 2006-02-10
# Change: NDB does not support auto inc
# in this usage. Currently there is no
# plan to implment. Skipping test when
# NDB is default engine.
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc

eval create table t1 (a int not null auto_increment,b int, primary key (a)) engine=$engine_type2 auto_increment=3;
+6 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ data LONGBLOB, PRIMARY KEY(c1))ENGINE=$engine_type;
INSERT INTO test.t1 VALUES (NULL, NULL);
INSERT INTO test.t1 VALUES (NULL, repeat('a',1*1024));
INSERT INTO test.t1 VALUES (NULL, repeat('b',16*1024));
CHECK TABLE test.t1;
--echo

--echo **** Data Insert Validation Master Section test.t1 ****
@@ -60,6 +59,9 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
--echo
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 10;
save_master_pos;
connection slave;
sync_with_master; 
@@ -155,6 +157,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=1;
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
# Sleep is needed for NDB to allow time for
# Injector thread to populate the bin log.
sleep 15;
save_master_pos;
connection slave;
sync_with_master; 
+2 −2
Original line number Diff line number Diff line
@@ -9,14 +9,14 @@ let $VERSION=`select version()`;
eval create table t1(a int not null primary key) engine=$engine_type;
insert delayed into t1 values (1),(2),(3);
flush tables;
select * from t1;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;

connection master;
--replace_result $VERSION VERSION
show binlog events;
sync_slave_with_master;
select * from t1;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
sync_slave_with_master;
+0 −159
Original line number Diff line number Diff line
-- source include/master-slave.inc

##############################################################################
#
# Let's verify that multi-update with a subselect does not cause the slave to crash
# (BUG#10442)
#
--disable_query_log
SELECT '-------- Test for BUG#9361 --------' as "";
--enable_query_log

eval CREATE TABLE t1 (
 a int unsigned not null auto_increment primary key,
 b int unsigned
) ENGINE=$engine_type;

eval CREATE TABLE t2 (
 a int unsigned not null auto_increment primary key,
 b int unsigned
) ENGINE=$engine_type;

INSERT INTO t1 VALUES (NULL, 0);
INSERT INTO t1 SELECT NULL, 0 FROM t1;

INSERT INTO t2 VALUES (NULL, 0), (NULL,1);

SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

sync_slave_with_master;
connection slave;
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;

connection master;
drop table t1,t2;

##############################################################################
#
#  Test for BUG#9361: 
#  Subselects should work inside multi-updates
#
--disable_query_log
SELECT '-------- Test 1 for BUG#9361 --------' as "";
--enable_query_log

connection master;

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

CREATE TABLE t1 (
  a1  char(30),
  a2  int,
  a3  int,
  a4  char(30),
  a5  char(30)
);

CREATE TABLE t2 (
  b1  int,
  b2  char(30)
);

# Insert one row per table
INSERT INTO t1 VALUES ('Yes', 1, NULL, 'foo', 'bar');
INSERT INTO t2 VALUES (1, 'baz');

# This should update the row in t1
UPDATE t1 a, t2 
  SET    a.a1 = 'No' 
  WHERE  a.a2 = 
    (SELECT  b1 
     FROM    t2 
     WHERE   b2 = 'baz') 
  AND a.a3 IS NULL 
  AND a.a4 = 'foo' 
  AND a.a5 = 'bar';

sync_slave_with_master;
connection slave;
SELECT * FROM t1;
SELECT * FROM t2;

connection master;
DROP TABLE t1, t2;

##############################################################################
#
# Second test for BUG#9361
#

--disable_query_log
SELECT '-------- Test 2 for BUG#9361 --------' as "";
--enable_query_log

connection master;

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
--enable_warnings

CREATE TABLE t1 (
  i   INT,
  j   INT,
  x   INT,
  y   INT,
  z   INT
);

CREATE TABLE t2 (
  i   INT,
  k   INT,
  x   INT,
  y   INT,
  z   INT
);

CREATE TABLE t3 (
  j   INT,
  k   INT,
  x   INT,
  y   INT,
  z   INT
);

INSERT INTO t1 VALUES ( 1, 2,13,14,15);
INSERT INTO t2 VALUES ( 1, 3,23,24,25);
INSERT INTO t3 VALUES ( 2, 3, 1,34,35), ( 2, 3, 1,34,36);

UPDATE      t1 AS a  
INNER JOIN  t2 AS b 
              ON a.i = b.i
INNER JOIN  t3 AS c 
              ON a.j = c.j  AND  b.k = c.k
SET         a.x = b.x, 
            a.y = b.y, 
            a.z = (
              SELECT  sum(z) 
              FROM    t3
              WHERE   y = 34 
            ) 
WHERE       b.x = 23;

sync_slave_with_master;
connection slave;

SELECT * FROM t1;

connection master;
DROP TABLE t1, t2, t3;
+4 −1
Original line number Diff line number Diff line
@@ -46,7 +46,10 @@ CALL test.p2();
SELECT release_lock("test");
SELECT * FROM test.t1; 
#show binlog events;

# Added sleep for use with NDB to ensure that
# the injector thread will populate log before
# we switch to the slave.
sleep 5;
sync_slave_with_master;
connection slave;
SELECT * FROM test.t1;
Loading