Below is the list of changes that have just been committed into a local
5.1 repository of tim. When tim does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-20 13:53:39-06:00, tsmith@stripped +31 -0
Merge siva.hindu.god:/usr/home/tim/m/bk/50
into siva.hindu.god:/usr/home/tim/m/bk/51
MERGE: 1.1810.2078.74
client/mysqldump.c@stripped, 2006-10-20 13:49:56-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.214.1.33
client/mysqltest.c@stripped, 2006-10-20 13:49:56-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.155.9.62
mysql-test/extra/rpl_tests/rpl_log.test@stripped, 2006-10-20 13:49:56-06:00,
tsmith@stripped +0 -1
Auto merged
MERGE: 1.27.4.2
mysql-test/extra/rpl_tests/rpl_log.test@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/t/rpl_log.test -> mysql-test/extra/rpl_tests/rpl_log.test
mysql-test/extra/rpl_tests/rpl_max_relay_size.test@stripped, 2006-10-20 13:49:56-06:00,
tsmith@stripped +0 -5
Auto merged
MERGE: 1.16.2.2
mysql-test/extra/rpl_tests/rpl_max_relay_size.test@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/t/rpl_max_relay_size.test ->
mysql-test/extra/rpl_tests/rpl_max_relay_size.test
mysql-test/include/mix1.inc@stripped, 2006-10-20 13:50:29-06:00, tsmith@stripped +0 -8
Manual merge (use local)
MERGE: 1.3.4.6
mysql-test/include/mix1.inc@stripped, 2006-10-20 13:49:55-06:00, tsmith@stripped +0
-0
Merge rename: mysql-test/t/innodb_mysql.test -> mysql-test/include/mix1.inc
mysql-test/lib/mtr_cases.pl@stripped, 2006-10-20 13:49:56-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.12.1.17
mysql-test/lib/mtr_misc.pl@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.12.1.4
mysql-test/mysql-test-run.pl@stripped, 2006-10-20 13:49:56-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.30.1.105
mysql-test/r/create.result@stripped, 2006-10-20 13:51:16-06:00, tsmith@stripped +0 -0
SCCS merged
MERGE: 1.107.1.16
mysql-test/r/innodb_mysql.result@stripped, 2006-10-20 13:51:56-06:00, tsmith@stripped
+0 -6
!bkm
Manual merge (use local)
MERGE: 1.3.4.7
mysql-test/r/mysqltest.result@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.24.1.14
mysql-test/r/rpl_000015.result@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.34.1.2
mysql-test/r/rpl_000015.result@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/r/rpl000015.result -> mysql-test/r/rpl_000015.result
mysql-test/r/rpl_change_master.result@stripped, 2006-10-20 13:49:57-06:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.17.1.1
mysql-test/r/rpl_err_ignoredtable.result@stripped, 2006-10-20 13:49:57-06:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.20.2.2
mysql-test/r/rpl_err_ignoredtable.result@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/r/rpl_error_ignored_table.result ->
mysql-test/r/rpl_err_ignoredtable.result
mysql-test/r/rpl_loaddata.result@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped
+0 -0
Auto merged
MERGE: 1.28.1.4
mysql-test/r/rpl_replicate_do.result@stripped, 2006-10-20 13:49:57-06:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.30.1.3
mysql-test/r/rpl_stm_log.result@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped
+0 -0
Auto merged
MERGE: 1.62.5.2
mysql-test/r/rpl_stm_log.result@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/r/rpl_log.result -> mysql-test/r/rpl_stm_log.result
mysql-test/r/rpl_stm_max_relay_size.result@stripped, 2006-10-20 13:49:57-06:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.20.2.2
mysql-test/r/rpl_stm_max_relay_size.result@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/r/rpl_max_relay_size.result ->
mysql-test/r/rpl_stm_max_relay_size.result
mysql-test/t/create.test@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.71.1.11
mysql-test/t/lock_multi.test@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.13.1.5
mysql-test/t/mysqltest.test@stripped, 2006-10-20 13:49:57-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.24.1.23
mysql-test/t/rpl_000015.test@stripped, 2006-10-20 13:49:58-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.31.2.2
mysql-test/t/rpl_000015.test@stripped, 2006-10-20 13:49:55-06:00, tsmith@stripped
+0 -0
Merge rename: mysql-test/t/rpl000015.test -> mysql-test/t/rpl_000015.test
mysql-test/t/rpl_change_master.test@stripped, 2006-10-20 13:49:58-06:00,
tsmith@stripped +0 -1
Auto merged
MERGE: 1.14.1.1
mysql-test/t/rpl_drop_db.test@stripped, 2006-10-20 13:49:58-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.6.1.2
mysql-test/t/rpl_err_ignoredtable.test@stripped, 2006-10-20 13:49:58-06:00,
tsmith@stripped +0 -1
Auto merged
MERGE: 1.21.1.2
mysql-test/t/rpl_err_ignoredtable.test@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/t/rpl_error_ignored_table.test ->
mysql-test/t/rpl_err_ignoredtable.test
mysql-test/t/rpl_loaddata.test@stripped, 2006-10-20 13:49:58-06:00, tsmith@stripped +0
-2
Auto merged
MERGE: 1.21.1.3
mysql-test/t/rpl_replicate_do.test@stripped, 2006-10-20 13:49:58-06:00,
tsmith@stripped +0 -1
Auto merged
MERGE: 1.22.1.3
mysql-test/t/rpl_stm_log-master.opt@stripped, 2006-10-20 13:49:58-06:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.3.1.2
mysql-test/t/rpl_stm_log-master.opt@stripped, 2006-10-20 13:49:55-06:00,
tsmith@stripped +0 -0
Merge rename: mysql-test/t/rpl_log-master.opt ->
mysql-test/t/rpl_stm_log-master.opt
mysql-test/t/sp.test@stripped, 2006-10-20 13:53:28-06:00, tsmith@stripped +0 -3
Manual merge (use local)
MERGE: 1.174.1.30
mysql-test/t/view.test@stripped, 2006-10-20 13:49:58-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.126.1.42
sql/sql_class.cc@stripped, 2006-10-20 13:49:58-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.223.1.29
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tsmith
# Host: siva.hindu.god
# Root: /usr/home/tim/m/bk/51/RESYNC
--- 1.3.4.5/mysql-test/t/innodb_mysql.test 2006-10-20 13:53:49 -06:00
+++ 1.15/mysql-test/include/mix1.inc 2006-10-20 13:53:49 -06:00
@@ -1,9 +1,44 @@
--- source include/have_innodb.inc
+# include/mix1.inc
+#
+# The variables
+# $engine_type -- storage engine to be tested
+# $other_engine_type -- storage engine <> $engine_type
+# $other_engine_type must point to an all
+# time available storage engine
+# 2006-08 MySQL 5.1 MyISAM and MEMORY only
+# $test_foreign_keys -- 0, skip foreign key tests
+# -- 1, do not skip foreign key tests
+# have to be set before sourcing this script.
+#
+# Note: The comments/expectations refer to InnoDB.
+# They might be not valid for other storage engines.
+#
+# Last update:
+# 2006-08-15 ML refactoring of t/innodb_mysql.test
+# - shift main code of t/innodb_mysql.test to include/mix1.inc
+# - replace hardcoded assignment of storage engine by
+# use of $engine_type and $other_engine_type variables
+# - remove redundant replay testcase of
+# Bug#12882 min/max inconsistent on empty table
+# - corrected analyze table t1; to analyze table t4;
+# Much older versions of this test show that the table
+# where just some indexes have been created must be used.
+#
+
+eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
-drop table if exists t1,t2;
+drop table if exists t1,t2,t1m,t1i,t2m,t2i,t4;
--enable_warnings
+#
+# Bug#17530: Incorrect key truncation on table creation caused server crash.
+#
+create table t1(f1 varchar(800) binary not null, key(f1))
+ character set utf8 collate utf8_general_ci;
+insert into t1 values('aaa');
+drop table t1;
+
# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
# (repeatable only w/innodb).
create table t1 (
@@ -11,8 +46,8 @@ create table t1 (
org_id int(11) default null,
unique key contacts$c_id (c_id),
key contacts$org_id (org_id)
-) engine=innodb;
-insert into t1 values
+);
+insert into t1 values
(2,null),(120,null),(141,null),(218,7), (128,1),
(151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
(246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
@@ -35,7 +70,7 @@ create table t2 (
unique key t2$slai_id (slai_id),
key t2$owner_id (owner_id),
key t2$sla_id (sla_id)
-) engine=innodb;
+);
insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
(1,3,1,1), (3,3,10,2), (4,3,3,6), (5,3,2,5), (6,3,8,3), (7,3,9,7),
(8,3,6,8), (9,3,4,9), (10,3,5,10), (11,3,11,11), (12,3,7,12);
@@ -43,17 +78,17 @@ insert into t2(slai_id, owner_tbl, owner
flush tables;
select si.slai_id
from t1 c join t2 si on
- ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
- ( si.owner_tbl = 2 and si.owner_id = c.c_id))
-where
+ ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+ ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
c.c_id = 218 and expiredate is null;
-
+
select * from t1 where org_id is null;
select si.slai_id
from t1 c join t2 si on
- ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
- ( si.owner_tbl = 2 and si.owner_id = c.c_id))
-where
+ ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+ ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
c.c_id = 218 and expiredate is null;
drop table t1, t2;
@@ -62,14 +97,14 @@ drop table t1, t2;
# Bug#17212: results not sorted correctly by ORDER BY when using index
# (repeatable only w/innodb because of index props)
#
-CREATE TABLE t1 (a int, b int, KEY b (b)) Engine=InnoDB;
-CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b)) Engine=InnoDB;
-CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
- UNIQUE KEY b (b,c), KEY a (a,b,c)) Engine=InnoDB;
+CREATE TABLE t1 (a int, b int, KEY b (b));
+CREATE TABLE t2 (a int, b int, PRIMARY KEY (a,b));
+CREATE TABLE t3 (a int, b int, c int, PRIMARY KEY (a),
+ UNIQUE KEY b (b,c), KEY a (a,b,c));
INSERT INTO t1 VALUES (1, 1);
-INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
-INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
+INSERT INTO t1 SELECT a + 1, b + 1 FROM t1;
+INSERT INTO t1 SELECT a + 2, b + 2 FROM t1;
INSERT INTO t2 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t2 SELECT a + 1, b FROM t2;
@@ -81,13 +116,13 @@ INSERT INTO t3 SELECT a + 4, a + 4, 3 FR
# demonstrate a problem when a must-use-sort table flag
# (sort_by_table=1) is being neglected.
-SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
- t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+ t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 2;
# demonstrate the problem described in the bug report
-SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
- t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
+SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
+ t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5;
DROP TABLE t1, t2, t3;
@@ -105,9 +140,9 @@ CREATE TABLE `t2` (
`id4` INT NOT NULL,
UNIQUE (`id2`,`id4`),
KEY (`id1`)
-) ENGINE=InnoDB;
+);
-INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
(1,1,1,0),
(1,1,2,1),
(5,1,2,2),
@@ -117,6 +152,8 @@ INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`
SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND
`id3` = 2);
DROP TABLE t1, t2;
+
+#
# Bug #22728 - Handler_rollback value is growing
#
flush status;
@@ -132,44 +169,24 @@ show /*!50002 GLOBAL */ status like 'Han
connection default;
drop table t1;
disconnect con1;
+
--echo End of 4.1 tests
+
+
#
# Bug #12882 min/max inconsistent on empty table
#
--disable_warnings
-create table t1m (a int) engine=myisam;
-create table t1i (a int) engine=innodb;
-create table t2m (a int) engine=myisam;
-create table t2i (a int) engine=innodb;
+eval create table t1m (a int) engine = $other_engine_type;
+create table t1i (a int);
+eval create table t2m (a int) engine = $other_engine_type;
+create table t2i (a int);
--enable_warnings
insert into t2m values (5);
insert into t2i values (5);
-# test with MyISAM
-select min(a) from t1m;
-select min(7) from t1m;
-select min(7) from DUAL;
-explain select min(7) from t2m join t1m;
-select min(7) from t2m join t1m;
-
-select max(a) from t1m;
-select max(7) from t1m;
-select max(7) from DUAL;
-explain select max(7) from t2m join t1m;
-select max(7) from t2m join t1m;
-
-select 1, min(a) from t1m where a=99;
-select 1, min(a) from t1m where 1=99;
-select 1, min(1) from t1m where a=99;
-select 1, min(1) from t1m where 1=99;
-
-select 1, max(a) from t1m where a=99;
-select 1, max(a) from t1m where 1=99;
-select 1, max(1) from t1m where a=99;
-select 1, max(1) from t1m where 1=99;
-
-# test with InnoDB
+# test with $engine_type
select min(a) from t1i;
select min(7) from t1i;
select min(7) from DUAL;
@@ -192,7 +209,7 @@ select 1, max(a) from t1i where 1=99;
select 1, max(1) from t1i where a=99;
select 1, max(1) from t1i where 1=99;
-# mixed MyISAM/InnoDB test
+# mixed $engine_type/$other_engine_type test
explain select count(*), min(7), max(7) from t1m, t1i;
select count(*), min(7), max(7) from t1m, t1i;
@@ -205,13 +222,13 @@ select count(*), min(7), max(7) from t2m
drop table t1m, t1i, t2m, t2i;
#
-# Bug #12672: primary key implcitly included in every innodb index
+# Bug #12882: primary key implcitly included in every innodb index
# (was part of group_min_max.test)
#
-create table t1 (
+eval create table t1 (
a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64)
default ' '
-);
+) ENGINE = $other_engine_type;
insert into t1 (a1, a2, b, c, d) values
('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
@@ -249,49 +266,49 @@ insert into t1 (a1, a2, b, c, d) values
--disable_warnings
create table t4 (
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16)
not null, d char(16), dummy char(64) default ' '
-) engine=innodb;
+);
--enable_warnings
insert into t4 (a1, a2, b, c, d, dummy) select * from t1;
create index idx12672_0 on t4 (a1);
create index idx12672_1 on t4 (a1,a2,b,c);
create index idx12672_2 on t4 (a1,a2,b);
-analyze table t1;
+analyze table t4;
select distinct a1 from t4 where pk_col not in (1,2,3,4);
drop table t1,t4;
#
-# Bug #6142: a problem with the empty innodb table
+# Bug #6142: a problem with the empty innodb table
# (was part of group_min_max.test)
#
--disable_warnings
create table t1 (
a varchar(30), b varchar(30), primary key(a), key(b)
-) engine=innodb;
+);
--enable_warnings
select distinct a from t1;
drop table t1;
#
-# Bug #9798: group by with rollup
+# Bug #9798: group by with rollup
# (was part of group_min_max.test)
#
--disable_warnings
-create table t1(a int, key(a)) engine=innodb;
+create table t1(a int, key(a));
--enable_warnings
insert into t1 values(1);
select a, count(a) from t1 group by a with rollup;
drop table t1;
#
-# Bug #13293 Wrongly used index results in endless loop.
+# Bug #13293 Wrongly used index results in endless loop.
# (was part of group_min_max.test)
#
-create table t1 (f1 int, f2 char(1), primary key(f1,f2)) engine=innodb;
+create table t1 (f1 int, f2 char(1), primary key(f1,f2));
insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
alter table t1 drop primary key, add primary key (f2, f1);
explain select distinct f1 a, f1 b from t1;
@@ -300,29 +317,134 @@ drop table t1;
#
# Test for bug #17164: ORed FALSE blocked conversion of outer join into join
-#
+#
CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
- INDEX (name)) ENGINE=InnoDB;
-CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
- FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
+ INDEX (name));
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11));
+# CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
+# FOREIGN KEY (fkey) REFERENCES t2(id));
+if ($test_foreign_keys)
+{
+ ALTER TABLE t2 ADD FOREIGN KEY (fkey) REFERENCES t2(id);
+}
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
EXPLAIN
-SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%';
EXPLAIN
-SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
WHERE t1.name LIKE 'A%' OR FALSE;
DROP TABLE t1,t2;
#
+# Test of behaviour with CREATE ... SELECT
+#
+
+CREATE TABLE t1 (a int, b int);
+insert into t1 values (1,1),(1,2);
+--error 1062
+CREATE TABLE t2 (primary key (a)) select * from t1;
+# This should give warning
+drop table if exists t2;
+--error 1062
+CREATE TEMPORARY TABLE t2 (primary key (a)) select * from t1;
+# This should give warning
+drop table if exists t2;
+CREATE TABLE t2 (a int, b int, primary key (a));
+BEGIN;
+INSERT INTO t2 values(100,100);
+--error 1062
+CREATE TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+SELECT * from t2;
+ROLLBACK;
+SELECT * from t2;
+TRUNCATE table t2;
+--error 1062
+INSERT INTO t2 select * from t1;
+SELECT * from t2;
+drop table t2;
+
+CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a));
+BEGIN;
+INSERT INTO t2 values(100,100);
+--error 1062
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+SELECT * from t2;
+COMMIT;
+BEGIN;
+INSERT INTO t2 values(101,101);
+--error 1062
+CREATE TEMPORARY TABLE IF NOT EXISTS t2 (primary key (a)) select * from t1;
+SELECT * from t2;
+ROLLBACK;
+SELECT * from t2;
+TRUNCATE table t2;
+--error 1062
+INSERT INTO t2 select * from t1;
+SELECT * from t2;
+drop table t1,t2;
+
+#
# Bug#17530: Incorrect key truncation on table creation caused server crash.
#
-create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
+create table t1(f1 varchar(800) binary not null, key(f1))
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
+
+# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
+# UPDATE": if the row is updated, it's like a regular UPDATE:
+# LAST_INSERT_ID() is not affected.
+CREATE TABLE `t2` (
+ `k` int(11) NOT NULL auto_increment,
+ `a` int(11) default NULL,
+ `c` int(11) default NULL,
+ PRIMARY KEY (`k`),
+ UNIQUE KEY `idx_1` (`a`)
+);
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+insert into t2 ( a ) values ( 7 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+select * from t2;
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+# test again when last_insert_id() is 0 initially
+select last_insert_id(0);
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1;
+select last_insert_id();
+select * from t2;
+
+# Test of LAST_INSERT_ID() when autogenerated will fail:
+# last_insert_id() should not change
+insert ignore into t2 values (null,6,1),(10,8,1);
+select last_insert_id();
+# First and second autogenerated will fail, last_insert_id() should
+# point to third
+insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
+select last_insert_id();
+select * from t2;
+
+# Test of the workaround which enables people to know the id of the
+# updated row in INSERT ON DUPLICATE KEY UPDATE, by using
+# LAST_INSERT_ID(autoinc_col) in the UPDATE clause.
+
+insert into t2 ( a ) values ( 6 ) on duplicate key update c =
+ifnull( c,
+0 ) + 1, k=last_insert_id(k);
+select last_insert_id();
+select * from t2;
+
+drop table t2;
--- 1.20.2.1/mysql-test/r/rpl_error_ignored_table.result 2006-10-20 13:53:49 -06:00
+++ 1.27/mysql-test/r/rpl_err_ignoredtable.result 2006-10-20 13:53:49 -06:00
@@ -5,13 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (a int primary key);
+create table t4 (a int primary key);
insert into t1 values (1),(1);
-ERROR 23000: Duplicate entry '1' for key 1
-show slave status;
-Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 288 # # master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 288 # None 0 No #
+Got one of the listed errors
+insert into t4 values (1),(2);
show tables like 't1';
Tables_in_test (t1)
+show tables like 't4';
+Tables_in_test (t4)
+t4
+SELECT * FROM test.t4 ORDER BY a;
+a
+1
+2
drop table t1;
select get_lock('crash_lock%20C', 10);
get_lock('crash_lock%20C', 10)
@@ -26,14 +32,11 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
-show binlog events from 98;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # use `test`; create table t1 (a int primary key)
-master-bin.000001 # Query 1 # use `test`; insert into t1 values (1),(1)
-master-bin.000001 # Query 1 # use `test`; drop table t1
-master-bin.000001 # Query 1 # use `test`; create table t2 (a int primary key)
-master-bin.000001 # Query 1 # use `test`; insert into t2 values(1)
-master-bin.000001 # Query 1 # use `test`; create table t3 (id int)
-master-bin.000001 # Query 1 # use `test`; insert into t3 values(connection_id())
-master-bin.000001 # Query 1 # use `test`; update t2 set a = a + 1 +
get_lock('crash_lock%20C', 10)
-master-bin.000001 # Query 1 # use `test`; drop table t2,t3
+insert into t4 values (3),(4);
+SELECT * FROM test.t4 ORDER BY a;
+a
+1
+2
+3
+4
+DROP TABLE test.t4;
--- 1.20.2.1/mysql-test/r/rpl_max_relay_size.result 2006-10-20 13:53:49 -06:00
+++ 1.24/mysql-test/r/rpl_stm_max_relay_size.result 2006-10-20 13:53:49 -06:00
@@ -27,7 +27,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 72952
+Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -36,13 +36,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 72952
+Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -70,7 +70,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 72952
+Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -79,13 +79,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 72952
+Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -113,7 +113,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 72952
+Read_Master_Log_Pos 72956
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -122,13 +122,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 72952
+Exec_Master_Log_Pos 72956
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -162,7 +162,7 @@ Slave_SQL_Running No
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
@@ -194,7 +194,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 73038
+Read_Master_Log_Pos 73042
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -203,13 +203,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 73038
+Exec_Master_Log_Pos 73042
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -233,7 +233,7 @@ Master_User root
Master_Port MASTER_PORT
Connect_Retry 1
Master_Log_File master-bin.000001
-Read_Master_Log_Pos 73114
+Read_Master_Log_Pos 73118
Relay_Log_File #
Relay_Log_Pos #
Relay_Master_Log_File master-bin.000001
@@ -242,13 +242,13 @@ Slave_SQL_Running Yes
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
-Replicate_Ignore_Table
+Replicate_Ignore_Table #
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
Last_Errno 0
Last_Error
Skip_Counter 0
-Exec_Master_Log_Pos 73114
+Exec_Master_Log_Pos 73118
Relay_Log_Space #
Until_Condition None
Until_Log_File
@@ -263,8 +263,8 @@ Seconds_Behind_Master #
flush logs;
show master status;
File master-bin.000002
-Position 98
-Binlog_Do_DB
+Position 102
+Binlog_Do_DB <Binlog_Ignore_DB>
Binlog_Ignore_DB
#
# End of 4.1 tests
--- 1.21.1.1/mysql-test/t/rpl_error_ignored_table.test 2006-10-20 13:53:49 -06:00
+++ 1.26/mysql-test/t/rpl_err_ignoredtable.test 2006-10-20 13:53:49 -06:00
@@ -1,24 +1,27 @@
# Test for
# Bug #797: If a query is ignored on slave (replicate-ignore-table) the slave
# still checks that it has the same error as on the master.
+##########################################################################
+# 2006-02-07 JBM Added error code 1022 for NDB Engine + ORDER BY
+##########################################################################
+
+-- source include/master-slave.inc
-source include/master-slave.inc;
connection master;
create table t1 (a int primary key);
+create table t4 (a int primary key);
# generate an error that goes to the binlog
---error 1062
+--error 1022, 1062
insert into t1 values (1),(1);
+insert into t4 values (1),(2);
save_master_pos;
connection slave;
# as the t1 table is ignored on the slave, the slave should be able to sync
sync_with_master;
-# The port number is different when doing the release build with
-# Do-compile, hence we have to replace the port number here accordingly
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
-show slave status;
# check that the table has been ignored, because otherwise the test is nonsense
show tables like 't1';
+show tables like 't4';
+SELECT * FROM test.t4 ORDER BY a;
connection master;
drop table t1;
save_master_pos;
@@ -44,17 +47,20 @@ real_sleep 2;
select (@id := id) - id from t3;
kill @id;
drop table t2,t3;
+insert into t4 values (3),(4);
connection master;
--error 0,1053,2013
reap;
connection master1;
---replace_column 2 # 5 #
-show binlog events from 98;
save_master_pos;
connection slave;
-# SQL slave thread should not have stopped (because table of the killed
-# query is in the ignore list).
sync_with_master;
+SELECT * FROM test.t4 ORDER BY a;
+connection master1;
+DROP TABLE test.t4;
+save_master_pos;
+connection slave;
+sync_with_master;
# End of 4.1 tests
# Adding comment for force manual merge 5.0 -> wl1012. delete me if needed
--- 1.16.2.1/mysql-test/t/rpl_max_relay_size.test 2006-10-20 13:53:49 -06:00
+++ 1.19/mysql-test/extra/rpl_tests/rpl_max_relay_size.test 2006-10-20 13:53:49 -06:00
@@ -3,7 +3,9 @@
# for relay logs too).
# Test of manual relay log rotation with FLUSH LOGS.
-source include/master-slave.inc;
+# Requires statement logging
+-- source include/master-slave.inc
+
connection slave;
stop slave;
connection master;
@@ -38,7 +40,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
@@ -53,7 +55,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
@@ -68,7 +70,7 @@ select @@global.max_relay_log_size;
start slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
@@ -82,7 +84,7 @@ reset slave;
# (to make sure it does not crash).
flush logs;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
@@ -103,7 +105,7 @@ save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
@@ -118,13 +120,14 @@ save_master_pos;
connection slave;
sync_with_master;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
--vertical_results
show slave status;
connection master;
# test that the absence of relay logs does not make a master crash
flush logs;
+-- replace_column 3 <Binlog_Ignore_DB>
show master status;
--echo #
--- 1.45/mysql-test/lib/mtr_cases.pl 2006-10-20 13:53:50 -06:00
+++ 1.46/mysql-test/lib/mtr_cases.pl 2006-10-20 13:53:50 -06:00
@@ -263,9 +263,6 @@ sub collect_one_test_case($$$$$$$) {
return;
}
- # ----------------------------------------------------------------------
- # Skip some tests but include in list, just mark them to skip
- # ----------------------------------------------------------------------
my $tinfo= {};
$tinfo->{'name'}= $tname;
@@ -273,6 +270,10 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'component_id'} = $component_id;
push(@$cases, $tinfo);
+ # ----------------------------------------------------------------------
+ # Skip some tests but include in list, just mark them to skip
+ # ----------------------------------------------------------------------
+
if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) )
{
$tinfo->{'skip'}= 1;
@@ -356,8 +357,9 @@ sub collect_one_test_case($$$$$$$) {
$value= mtr_match_prefix($opt, "--default-time-zone=");
if ( defined $value )
{
- $tinfo->{'timezone'}= "";
- # Fallthrough, add this option
+ # Set timezone for this test case to something different
+ $tinfo->{'timezone'}= "GMT-8";
+ # Fallthrough, add the --default-time-zone option
}
# The --restart option forces a restart even if no special
--- 1.17/mysql-test/lib/mtr_misc.pl 2006-10-20 13:53:50 -06:00
+++ 1.18/mysql-test/lib/mtr_misc.pl 2006-10-20 13:53:50 -06:00
@@ -14,6 +14,7 @@ sub mtr_path_exists(@);
sub mtr_script_exists(@);
sub mtr_file_exists(@);
sub mtr_exe_exists(@);
+sub mtr_exe_maybe_exists(@);
sub mtr_copy_dir($$);
sub mtr_same_opts($$);
sub mtr_cmp_opts($$);
@@ -110,8 +111,9 @@ sub mtr_file_exists (@) {
return "";
}
-sub mtr_exe_exists (@) {
+sub mtr_exe_maybe_exists (@) {
my @path= @_;
+
map {$_.= ".exe"} @path if $::glob_win32;
foreach my $path ( @path )
{
@@ -124,6 +126,16 @@ sub mtr_exe_exists (@) {
return $path if -x $path;
}
}
+ return "";
+}
+
+sub mtr_exe_exists (@) {
+ my @path= @_;
+ if (my $path= mtr_exe_maybe_exists(@path))
+ {
+ return $path;
+ }
+ # Could not find exe, show error
if ( @path == 1 )
{
mtr_error("Could not find $path[0]");
--- 1.201/mysql-test/mysql-test-run.pl 2006-10-20 13:53:50 -06:00
+++ 1.202/mysql-test/mysql-test-run.pl 2006-10-20 13:53:50 -06:00
@@ -1313,9 +1313,8 @@ sub executable_setup () {
}
# Look for language files and charsetsdir, use same share
- my $path_share= mtr_path_exists("$glob_basedir/share",
+ my $path_share= mtr_path_exists("$glob_basedir/share/mysql",
"$glob_basedir/sql/share",
- "$glob_basedir/share/mysql",
"$glob_basedir/share");
$path_language= mtr_path_exists("$path_share/english");
@@ -1373,31 +1372,31 @@ sub executable_setup () {
{
# Look for ndb tols and binaries
my $ndb_path= mtr_path_exists("$glob_basedir/ndb",
- "$glob_basedir/storage/ndb");
+ "$glob_basedir/storage/ndb",
+ "$glob_basedir/bin");
$path_ndb_tools_dir= mtr_path_exists("$ndb_path/tools",
- "$glob_basedir/bin");
+ "$ndb_path");
$exe_ndb_mgm=
mtr_exe_exists("$ndb_path/src/mgmclient/ndb_mgm",
- "$glob_basedir/bin/ndb_mgm");
+ "$ndb_path/ndb_mgm");
$exe_ndb_mgmd=
mtr_exe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
- "$glob_basedir/bin/ndb_mgmd");
+ "$ndb_path/ndb_mgmd");
$exe_ndb_waiter=
mtr_exe_exists("$ndb_path/tools/ndb_waiter",
- "$glob_basedir/bin/ndb_waiter");
+ "$ndb_path/ndb_waiter");
$exe_ndbd=
mtr_exe_exists("$ndb_path/src/kernel/ndbd",
- "$glob_basedir/bin/ndbd");
+ "$ndb_path/ndbd");
- if ( $mysql_version_id >= 50000 )
- {
- $path_ndb_examples_dir=
- mtr_path_exists("$ndb_path/ndbapi-examples",
- "$ndb_path/examples");
- $exe_ndb_example=
- mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
- }
+ # May not exist
+ $path_ndb_examples_dir=
+ mtr_file_exists("$ndb_path/ndbapi-examples",
+ "$ndb_path/examples");
+ # May not exist
+ $exe_ndb_example=
+ mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");
}
# Look for the udf_example library
@@ -1420,27 +1419,20 @@ sub executable_setup () {
}
- if ( $glob_win32 and $mysql_version_id < 50000 )
+ # Look for mysql_client_test executable which may _not_ exist in
+ # some versions, test using it should be skipped
+ if ( $glob_use_embedded_server )
{
- # Skip looking for exe_mysql_client_test as its not built by default
- # in 4.1 for windows.
- $exe_mysql_client_test= "unavailable";
+ $exe_mysql_client_test=
+
mtr_exe_maybe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
}
else
{
- # Look for mysql_client_test executable
- if ( $glob_use_embedded_server )
- {
- $exe_mysql_client_test=
- mtr_exe_exists("$glob_basedir/libmysqld/examples/mysql_client_test_embedded");
- }
- else
- {
- $exe_mysql_client_test=
- mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
- "$glob_basedir/tests/release/mysql_client_test",
- "$glob_basedir/tests/debug/mysql_client_test");
- }
+ $exe_mysql_client_test=
+ mtr_exe_maybe_exists("$glob_basedir/tests/mysql_client_test",
+ "$glob_basedir/tests/release/mysql_client_test",
+ "$glob_basedir/tests/debug/mysql_client_test",
+ "$glob_basedir/bin");
}
}
@@ -2041,6 +2033,14 @@ sub check_ndbcluster_support ($) {
if ( ! $mysqld_variables->{'ndb-connectstring'} )
{
mtr_report("Skipping ndbcluster, mysqld not compiled with ndbcluster");
+ $opt_skip_ndbcluster= 1;
+ $opt_skip_ndbcluster_slave= 1;
+ return;
+ }
+ elsif ( -e "$glob_basedir/bin" && ! -f "$glob_basedir/bin/ndbd")
+ {
+ # Binary dist with a mysqld that supports ndb, but no ndbd found
+ mtr_report("Skipping ndbcluster, can't fint binaries");
$opt_skip_ndbcluster= 1;
$opt_skip_ndbcluster_slave= 1;
return;
--- 1.46/mysql-test/r/mysqltest.result 2006-10-20 13:53:50 -06:00
+++ 1.47/mysql-test/r/mysqltest.result 2006-10-20 13:53:50 -06:00
@@ -518,4 +518,6 @@ hello
mysqltest: At line 1: Max delimiter length(16) exceeded
hello
hello
+mysqltest: At line 1: test of die
+Some output
End of tests
--- 1.57/mysql-test/t/mysqltest.test 2006-10-20 13:53:50 -06:00
+++ 1.58/mysql-test/t/mysqltest.test 2006-10-20 13:53:50 -06:00
@@ -1548,5 +1548,19 @@ perl;
print "hello\n";
EOF
+# ----------------------------------------------------------------------------
+# test for die
+# ----------------------------------------------------------------------------
+
+--error 1
+--exec echo "die test of die;" | $MYSQL_TEST 2>&1
+
+
+# ----------------------------------------------------------------------------
+# test for exit
+# ----------------------------------------------------------------------------
+
+--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
+
--echo End of tests
--- 1.21/mysql-test/t/lock_multi.test 2006-10-20 13:53:50 -06:00
+++ 1.22/mysql-test/t/lock_multi.test 2006-10-20 13:53:50 -06:00
@@ -244,7 +244,10 @@ DROP DATABASE mysqltest_1;
# Bug #17264: MySQL Server freeze
#
connection locker;
+# Disable warnings to allow test to run also without InnoDB
+--disable_warnings
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1))
engine=innodb;
+--enable_warnings
lock tables t1 write;
connection writer;
--sleep 2
--- 1.239/client/mysqltest.c 2006-10-20 13:53:50 -06:00
+++ 1.240/client/mysqltest.c 2006-10-20 13:53:50 -06:00
@@ -264,7 +264,7 @@ enum enum_commands {
Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
- Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE,
+ Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -345,6 +345,8 @@ const char *command_names[]=
"copy_file",
"perl",
"die",
+ /* Don't execute any more commands, compare result */
+ "exit",
0
};
@@ -5429,7 +5431,7 @@ void mark_progress(struct st_command* co
int main(int argc, char **argv)
{
struct st_command *command;
- my_bool q_send_flag= 0;
+ my_bool q_send_flag= 0, abort_flag= 0;
uint command_executed= 0, last_command_executed= 0;
char save_file[FN_REFLEN];
MY_STAT res_info;
@@ -5549,7 +5551,7 @@ int main(int argc, char **argv)
open_file(opt_include);
}
- while (!read_command(&command))
+ while (!read_command(&command) && !abort_flag)
{
int current_line_inc = 1, processed = 0;
if (command->type == Q_UNKNOWN || command->type == Q_COMMENT_WITH_COMMAND)
@@ -5777,7 +5779,12 @@ int main(int argc, char **argv)
die("Parsing is already enabled");
break;
case Q_DIE:
+ /* Abort test with error code and error message */
die("%s", command->first_argument);
+ break;
+ case Q_EXIT:
+ /* Stop processing any more commands */
+ abort_flag= 1;
break;
case Q_RESULT:
--- 1.34.1.1/mysql-test/r/rpl000015.result 2006-10-20 13:53:50 -06:00
+++ 1.37/mysql-test/r/rpl_000015.result 2006-10-20 13:53:50 -06:00
@@ -1,7 +1,7 @@
reset master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 98
+master-bin.000001 102
reset slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
@@ -17,11 +17,16 @@ Slave_IO_State Master_Host Master_User M
start slave;
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 98 # # master-bin.000001 Yes Yes 0 0 98 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 7 master-bin.000001 102 # # master-bin.000001 Yes Yes 0 0 102 # None 0 No #
drop table if exists t1;
-create table t1 (n int);
+create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
-select * from t1;
+SELECT * FROM t1 ORDER BY n;
+n
+10
+45
+90
+SELECT * FROM t1 ORDER BY n;
n
10
45
--- 1.62.5.1/mysql-test/r/rpl_log.result 2006-10-20 13:53:50 -06:00
+++ 1.72/mysql-test/r/rpl_stm_log.result 2006-10-20 13:53:50 -06:00
@@ -8,99 +8,96 @@ stop slave;
reset master;
reset slave;
reset master;
-create table t1(n int not null auto_increment primary key);
+create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
-create table t1 (word char(20) not null);
+create table t1 (word char(20) not null)ENGINE=MyISAM;
load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1;
count(*)
69
-drop table t1;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null
auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-master-bin.000001 338 Query 1 414 use `test`; drop table t1
-master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile
'../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
-master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
-show binlog events from 98 limit 1;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null
auto_increment primary key)
-show binlog events from 98 limit 2;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null
auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-show binlog events from 98 limit 2,1;
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment
primary key)ENGINE=MyISAM
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not
null)ENGINE=MyISAM
+master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile
'../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+show binlog events from 102 limit 1;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment
primary key)ENGINE=MyISAM
+show binlog events from 102 limit 2;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment
primary key)ENGINE=MyISAM
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+show binlog events from 102 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
flush logs;
-create table t5 (a int);
-drop table t5;
+create table t3 (a int)ENGINE=MyISAM;
start slave;
+
+let $result_pattern=
'%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
+
+--source include/wait_slave_status.inc
flush logs;
stop slave;
-create table t1 (n int);
-insert into t1 values (1);
-drop table t1;
+create table t2 (n int)ENGINE=MyISAM;
+insert into t2 values (1);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null
auto_increment primary key)
-master-bin.000001 219 Intvar 1 247 INSERT_ID=1
-master-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-master-bin.000001 338 Query 1 414 use `test`; drop table t1
-master-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-master-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-master-bin.000001 1121 Execute_load_query 1 1269 use `test`; load data infile
'../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
-master-bin.000001 1269 Query 1 1345 use `test`; drop table t1
-master-bin.000001 1345 Rotate 1 1389 master-bin.000002;pos=4
+master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment
primary key)ENGINE=MyISAM
+master-bin.000001 # Intvar 1 # INSERT_ID=1
+master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+master-bin.000001 # Query 1 # use `test`; drop table t1
+master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not
null)ENGINE=MyISAM
+master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+master-bin.000001 # Execute_load_query 1 # use `test`; load data infile
'../std_data_ln/words.dat' into table t1 ignore 1 lines ;file_id=1
+master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000002 4 Format_desc 1 98 Server ver: VERSION, Binlog ver: 4
-master-bin.000002 98 Query 1 184 use `test`; create table t5 (a int)
-master-bin.000002 184 Query 1 260 use `test`; drop table t5
-master-bin.000002 260 Query 1 346 use `test`; create table t1 (n int)
-master-bin.000002 346 Query 1 434 use `test`; insert into t1 values (1)
-master-bin.000002 434 Query 1 510 use `test`; drop table t1
+master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
+master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+master-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show binary logs;
Log_name File_size
-master-bin.000001 1389
-master-bin.000002 510
+master-bin.000001 1343
+master-bin.000002 388
start slave;
show binary logs;
Log_name File_size
-slave-bin.000001 1552
-slave-bin.000002 348
+slave-bin.000001 1443
+slave-bin.000002 289
show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 98 Query 1 219 use `test`; create table t1(n int not null auto_increment
primary key)
-slave-bin.000001 219 Intvar 1 247 INSERT_ID=1
-slave-bin.000001 247 Query 1 338 use `test`; insert into t1 values (NULL)
-slave-bin.000001 338 Query 1 414 use `test`; drop table t1
-slave-bin.000001 414 Query 1 517 use `test`; create table t1 (word char(20) not null)
-slave-bin.000001 517 Begin_load_query 1 1121 ;file_id=1;block_len=581
-slave-bin.000001 1121 Execute_load_query 1 1271 use `test`; load data INFILE
'../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
-slave-bin.000001 1271 Query 1 1347 use `test`; drop table t1
-slave-bin.000001 1347 Query 1 1433 use `test`; create table t5 (a int)
-slave-bin.000001 1433 Query 1 1509 use `test`; drop table t5
-slave-bin.000001 1509 Rotate 2 1552 slave-bin.000002;pos=4
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment
primary key)ENGINE=MyISAM
+slave-bin.000001 # Intvar 1 # INSERT_ID=1
+slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL)
+slave-bin.000001 # Query 1 # use `test`; drop table t1
+slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not
null)ENGINE=MyISAM
+slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581
+slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE
'../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1
+slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
+slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000002 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
-slave-bin.000002 98 Query 1 184 use `test`; create table t1 (n int)
-slave-bin.000002 184 Query 1 272 use `test`; insert into t1 values (1)
-slave-bin.000002 272 Query 1 348 use `test`; drop table t1
+slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
+slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1)
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes 0 0 510 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 388 # # master-bin.000002 Yes Yes # 0 0 388 # None 0 No #
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
reset master;
@@ -108,10 +105,10 @@ set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
-slave-bin.000001 4 Format_desc 2 98 Server ver: VERSION, Binlog ver: 4
-slave-bin.000001 98 Intvar 2 126 LAST_INSERT_ID=1
-slave-bin.000001 126 Intvar 2 154 INSERT_ID=5
-slave-bin.000001 154 Query 2 289 use `test`; insert into t1 values (NULL,
last_insert_id()), (NULL, last_insert_id())
+slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
+slave-bin.000001 # Intvar 2 # LAST_INSERT_ID=1
+slave-bin.000001 # Intvar 2 # INSERT_ID=5
+slave-bin.000001 # Query 2 # use `test`; insert into t1 values (NULL, last_insert_id()),
(NULL, last_insert_id())
select * from t1;
a b
1 1
--- 1.31.2.1/mysql-test/t/rpl000015.test 2006-10-20 13:53:50 -06:00
+++ 1.35/mysql-test/t/rpl_000015.test 2006-10-20 13:53:50 -06:00
@@ -1,3 +1,9 @@
+#####################
+# Change Author: JBM
+# Change Date: 2006-01-17
+# Change: added order by in select
+#####################
+
connect (master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (slave,localhost,root,,test,$SLAVE_MYPORT,slave.sock);
connection master;
@@ -30,12 +36,12 @@ connection master;
--disable_warnings
drop table if exists t1;
--enable_warnings
-create table t1 (n int);
+create table t1 (n int, PRIMARY KEY(n));
insert into t1 values (10),(45),(90);
sync_slave_with_master;
-select * from t1;
+connection slave;
+SELECT * FROM t1 ORDER BY n;
connection master;
+SELECT * FROM t1 ORDER BY n;
drop table t1;
sync_slave_with_master;
-
-# End of 4.1 tests
--- 1.27.4.1/mysql-test/t/rpl_log.test 2006-10-20 13:53:50 -06:00
+++ 1.40/mysql-test/extra/rpl_tests/rpl_log.test 2006-10-20 13:53:50 -06:00
@@ -1,4 +1,5 @@
-source include/master-slave.inc;
+# Requires statement logging
+-- source include/master-slave.inc
# Clean up old slave's binlogs.
# The slave is started with --log-slave-updates
@@ -29,18 +30,25 @@ let $VERSION=`select version()`;
connection master;
reset master;
-create table t1(n int not null auto_increment primary key);
+eval create table t1(n int not null auto_increment primary key)ENGINE=$engine_type;
insert into t1 values (NULL);
drop table t1;
-create table t1 (word char(20) not null);
+eval create table t1 (word char(20) not null)ENGINE=$engine_type;
load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1;
-drop table t1;
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
-show binlog events from 98 limit 1;
-show binlog events from 98 limit 2;
-show binlog events from 98 limit 2,1;
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+show binlog events from 102 limit 1;
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+show binlog events from 102 limit 2;
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
+show binlog events from 102 limit 2,1;
flush logs;
# We need an extra update before doing save_master_pos.
@@ -59,8 +67,7 @@ flush logs;
# To make it predictable, we do a useless update now, but which has the
# interest of making the slave catch both rotate events.
-create table t5 (a int);
-drop table t5;
+eval create table t3 (a int)ENGINE=$engine_type;
# Sync slave and force it to start on another binary log
@@ -70,6 +77,8 @@ connection slave;
# to go into the relay log (the master always sends a fake one when replication
# starts).
start slave;
+let $result_pattern=
'%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
+--source include/wait_slave_status.inc
sync_with_master;
flush logs;
stop slave;
@@ -77,12 +86,15 @@ connection master;
# Create some entries for second log
-create table t1 (n int);
-insert into t1 values (1);
-drop table t1;
+eval create table t2 (n int)ENGINE=$engine_type;
+insert into t2 values (1);
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002';
show binary logs;
save_master_pos;
@@ -91,11 +103,15 @@ start slave;
sync_with_master;
show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000001' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'slave-bin.000002' from 4;
--replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 #
show slave status;
# Need to recode the following
@@ -109,6 +125,12 @@ show slave status;
--error 1220
show binlog events in 'slave-bin.000005' from 4;
+# The table drops caused Cluster Replication wrapper to fail as event ID would never be
the same.# Moving drops here.
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
#
# Bug #6880: LAST_INSERT_ID() within a statement
#
@@ -119,9 +141,11 @@ reset master;
set insert_id=5;
insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id());
--replace_result $VERSION VERSION
+--replace_column 2 # 5 #
+--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events;
select * from t1;
drop table t1;
# End of 4.1 tests
-# Adding comment for force manual merge 5.0 -> wl1012: Delete me
+
| Thread |
|---|
| • bk commit into 5.1 tree (tsmith:1.2328) | tim | 20 Oct |