Browse Source
Manual merge from mysql-trunk-merge.
Manual merge from mysql-trunk-merge.
Conflicts: - configure.in - include/m_string.h - mysql-test/extra/rpl_tests/rpl_row_func003.test - mysql-test/r/mysqlbinlog.result - mysql-test/r/union.result - mysql-test/suite/binlog/r/binlog_killed_simulate.result - mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/r/rpl_loaddata_fatal.result - mysql-test/suite/rpl/r/rpl_loaddata_map.result - mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result - mysql-test/suite/rpl/r/rpl_stm_log.result - mysql-test/suite/rpl/t/rpl_optimize.test - mysql-test/t/mysqlbinlog.test - mysql-test/t/union.test - sql/rpl_utility.h - sql/sql_union.cc - strings/Makefile.ampull/374/head
78 changed files with 1486 additions and 237 deletions
-
2client/mysql.cc
-
13configure.in
-
1extra/yassl/taocrypt/include/asn.hpp
-
123extra/yassl/taocrypt/src/asn.cpp
-
9include/m_string.h
-
14mysql-test/extra/rpl_tests/rpl_loaddata.test
-
6mysql-test/extra/rpl_tests/rpl_row_func003.test
-
16mysql-test/include/truncate_file.inc
-
7mysql-test/r/alter_table.result
-
20mysql-test/r/count_distinct.result
-
6mysql-test/r/fulltext_order_by.result
-
11mysql-test/r/func_concat.result
-
22mysql-test/r/ps.result
-
16mysql-test/r/sp.result
-
23mysql-test/r/sp_sync.result
-
60mysql-test/r/union.result
-
15mysql-test/r/user_var.result
-
2mysql-test/suite/binlog/r/binlog_killed_simulate.result
-
2mysql-test/suite/binlog/r/binlog_stm_blackhole.result
-
4mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
-
5mysql-test/suite/binlog/r/binlog_unsafe.result
-
25mysql-test/suite/binlog/t/binlog_unsafe.test
-
14mysql-test/suite/rpl/r/rpl_drop_temp.result
-
18mysql-test/suite/rpl/r/rpl_geometry.result
-
2mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
-
17mysql-test/suite/rpl/r/rpl_loaddata.result
-
2mysql-test/suite/rpl/r/rpl_loaddata_map.result
-
25mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
-
1mysql-test/suite/rpl/r/rpl_misc_functions.result
-
24mysql-test/suite/rpl/r/rpl_myisam_null_values.result
-
1mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
-
1mysql-test/suite/rpl/r/rpl_row_func003.result
-
56mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
-
21mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
-
6mysql-test/suite/rpl/r/rpl_stm_log.result
-
32mysql-test/suite/rpl/t/rpl_drop_temp.test
-
26mysql-test/suite/rpl/t/rpl_geometry.test
-
106mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
-
8mysql-test/suite/rpl/t/rpl_misc_functions.test
-
53mysql-test/suite/rpl/t/rpl_myisam_null_values.test
-
4mysql-test/suite/rpl/t/rpl_nondeterministic_functions.test
-
3mysql-test/suite/rpl/t/rpl_optimize.test
-
171mysql-test/suite/rpl/t/rpl_row_tbl_metadata.test
-
2mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result
-
1mysql-test/suite/rpl_ndb/r/rpl_ndb_func003.result
-
12mysql-test/t/alter_table.test
-
19mysql-test/t/count_distinct.test
-
5mysql-test/t/fulltext_order_by.test
-
13mysql-test/t/func_concat.test
-
16mysql-test/t/ps.test
-
19mysql-test/t/sp.test
-
58mysql-test/t/sp_sync.test
-
55mysql-test/t/union.test
-
20mysql-test/t/user_var.test
-
3sql/field.cc
-
144sql/ha_partition.cc
-
12sql/ha_partition.h
-
24sql/item.h
-
10sql/item_create.cc
-
2sql/item_func.cc
-
5sql/item_func.h
-
4sql/item_strfunc.cc
-
58sql/log_event.cc
-
39sql/log_event_old.cc
-
11sql/sp_head.cc
-
15sql/sql_acl.cc
-
6sql/sql_load.cc
-
26sql/sql_parse.cc
-
9sql/sql_repl.cc
-
3sql/sql_select.cc
-
10sql/sql_servers.cc
-
31sql/sql_union.cc
-
6sql/sql_update.cc
-
4strings/Makefile.am
-
6strings/strmov.c
-
3support-files/Makefile.am
-
28support-files/MySQL-shared-compat.spec.sh
-
51support-files/mysql.spec.sh
@ -0,0 +1,16 @@ |
|||
# truncate a giving file, all contents of the file are be cleared |
|||
|
|||
if (`SELECT 'x$file' = 'x'`) |
|||
{ |
|||
--echo Please assign a file name to $file!! |
|||
exit; |
|||
} |
|||
|
|||
let TRUNCATE_FILE= $file; |
|||
|
|||
perl; |
|||
use Env; |
|||
Env::import('TRUNCATE_FILE'); |
|||
open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file"; |
|||
close FILE; |
|||
EOF |
|||
@ -0,0 +1,23 @@ |
|||
Tests of syncronization of stored procedure execution. |
|||
# |
|||
# Bug#48157: crash in Item_field::used_tables |
|||
# |
|||
CREATE TABLE t1 AS SELECT 1 AS a, 1 AS b; |
|||
CREATE TABLE t2 AS SELECT 1 AS a, 1 AS b; |
|||
CREATE PROCEDURE p1() |
|||
BEGIN |
|||
UPDATE t1 JOIN t2 USING( a, b ) SET t1.b = 1, t2.b = 1; |
|||
END| |
|||
LOCK TABLES t1 WRITE, t2 WRITE; |
|||
SET DEBUG_SYNC = 'multi_update_reopen_tables SIGNAL parked WAIT_FOR go'; |
|||
CALL p1(); |
|||
DROP TABLE t1, t2; |
|||
SET DEBUG_SYNC = 'now WAIT_FOR parked'; |
|||
CREATE TABLE t1 AS SELECT 1 AS a, 1 AS b; |
|||
CREATE TABLE t2 AS SELECT 1 AS a, 1 AS b; |
|||
SET DEBUG_SYNC = 'now SIGNAL go'; |
|||
# Without the DEBUG_SYNC supplied in the same patch as this test in the |
|||
# code, this test statement will hang. |
|||
DROP TABLE t1, t2; |
|||
DROP PROCEDURE p1; |
|||
SET DEBUG_SYNC = 'RESET'; |
|||
@ -0,0 +1,18 @@ |
|||
stop slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
reset master; |
|||
reset slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
start slave; |
|||
create table t1(a varchar(100), |
|||
b multipoint not null, |
|||
c varchar(256)); |
|||
insert into t1 set |
|||
a='hello', |
|||
b=geomfromtext('multipoint(1 1)'), |
|||
c='geometry'; |
|||
create table t2 (a int(11) not null auto_increment primary key, |
|||
b geometrycollection default null, |
|||
c decimal(10,0)); |
|||
insert into t2(c) values (null); |
|||
drop table t1, t2; |
|||
@ -0,0 +1,25 @@ |
|||
stop slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
reset master; |
|||
reset slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
start slave; |
|||
FLUSH LOGS; |
|||
CREATE TABLE t1(c1 INT); |
|||
FLUSH LOGS; |
|||
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); |
|||
Last_IO_Error |
|||
Got fatal error 1236 from master when reading data from binary log: 'could not find next log' |
|||
CREATE TABLE t2(c1 INT); |
|||
FLUSH LOGS; |
|||
CREATE TABLE t3(c1 INT); |
|||
FLUSH LOGS; |
|||
CREATE TABLE t4(c1 INT); |
|||
START SLAVE IO_THREAD; |
|||
SHOW TABLES; |
|||
Tables_in_test |
|||
t1 |
|||
t2 |
|||
t3 |
|||
t4 |
|||
DROP TABLE t1, t2, t3, t4; |
|||
@ -0,0 +1,24 @@ |
|||
stop slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
reset master; |
|||
reset slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
start slave; |
|||
CREATE TABLE t1 (c1 BIT, c2 INT); |
|||
INSERT INTO `t1` VALUES ( 1, 1 ); |
|||
UPDATE t1 SET c1=NULL where c2=1; |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
DELETE FROM t1 WHERE c2=1 LIMIT 1; |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (c1 CHAR); |
|||
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; |
|||
SELECT * FROM t1; |
|||
c1 |
|||
w |
|||
# should trigger switch to row due to LIMIT |
|||
UPDATE t1 SET c1=NULL WHERE c1='w' LIMIT 2; |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
DELETE FROM t1 LIMIT 2; |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
DROP TABLE t1; |
|||
@ -0,0 +1,26 @@ |
|||
source include/master-slave.inc; |
|||
source include/have_binlog_format_row.inc; |
|||
|
|||
# |
|||
# Bug#48776, Bug#43784 |
|||
# |
|||
create table t1(a varchar(100), |
|||
b multipoint not null, |
|||
c varchar(256)); |
|||
|
|||
insert into t1 set |
|||
a='hello', |
|||
b=geomfromtext('multipoint(1 1)'), |
|||
c='geometry'; |
|||
|
|||
create table t2 (a int(11) not null auto_increment primary key, |
|||
b geometrycollection default null, |
|||
c decimal(10,0)); |
|||
|
|||
insert into t2(c) values (null); |
|||
|
|||
sync_slave_with_master; |
|||
|
|||
connection master; |
|||
drop table t1, t2; |
|||
source include/master-slave-end.inc; |
|||
@ -0,0 +1,106 @@ |
|||
source include/master-slave.inc; |
|||
|
|||
# |
|||
# BUG#28421 Infinite loop on slave relay logs |
|||
# |
|||
# That, manually deleteing one or more entries from 'master-bin.index', will |
|||
# cause master infinitely loop to send one binlog file. |
|||
# |
|||
# Manually changing index file is a illegal action, so when this happen, we |
|||
# send a fatal error to slave and close the dump session. |
|||
|
|||
FLUSH LOGS; |
|||
# Now, 2 entries in index file. |
|||
# ./master-bin.000001 |
|||
# ./master-bin.000002 |
|||
|
|||
CREATE TABLE t1(c1 INT); |
|||
# Now, the current dump file(master-bin.000002) is the second line of index |
|||
# file |
|||
sync_slave_with_master; |
|||
# Now, all events has been replicate to slave. As current dump file |
|||
# (master-bin.000002) is the last binlog file, so master is waiting for new |
|||
# events. |
|||
|
|||
connection master; |
|||
# Delete './master-bin.000001' from index file. |
|||
let $MYSQLD_DATADIR= `SELECT @@DATADIR`; |
|||
let $file= $MYSQLD_DATADIR/master-bin.index; |
|||
source include/truncate_file.inc; |
|||
|
|||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) |
|||
{ |
|||
append_file $MYSQLD_DATADIR/master-bin.index; |
|||
./master-bin.000002 |
|||
EOF |
|||
sleep 0.00000001; |
|||
} |
|||
|
|||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) |
|||
{ |
|||
append_file $MYSQLD_DATADIR/master-bin.index; |
|||
.\master-bin.000002 |
|||
EOF |
|||
sleep 0.00000001; |
|||
} |
|||
|
|||
# Now, only 1 entry in index file. ./master-bin.000002 |
|||
|
|||
# Generate master-bin.000003, but it is in the second line. |
|||
FLUSH LOGS; |
|||
# Now, 2 entries in index file. |
|||
# ./master-bin.000002 |
|||
# ./master-bin.000003 |
|||
|
|||
# Now, master know that new binlog file(master-bin.000003) has been generated. |
|||
# It expects that the new binlog file is in third line of index file, but |
|||
# there is no third line in index file. It is so strange that master sends an |
|||
# error to slave. |
|||
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); |
|||
connection slave; |
|||
source include/wait_for_slave_io_to_stop.inc; |
|||
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1); |
|||
echo Last_IO_Error; |
|||
echo $last_error; |
|||
|
|||
connection master; |
|||
|
|||
source include/truncate_file.inc; |
|||
|
|||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`) |
|||
{ |
|||
append_file $MYSQLD_DATADIR/master-bin.index; |
|||
./master-bin.000001 |
|||
./master-bin.000002 |
|||
./master-bin.000003 |
|||
EOF |
|||
sleep 0.00000001; |
|||
} |
|||
|
|||
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`) |
|||
{ |
|||
append_file $MYSQLD_DATADIR/master-bin.index; |
|||
.\master-bin.000001 |
|||
.\master-bin.000002 |
|||
.\master-bin.000003 |
|||
EOF |
|||
sleep 0.00000001; |
|||
} |
|||
|
|||
CREATE TABLE t2(c1 INT); |
|||
FLUSH LOGS; |
|||
CREATE TABLE t3(c1 INT); |
|||
FLUSH LOGS; |
|||
CREATE TABLE t4(c1 INT); |
|||
|
|||
connection slave; |
|||
START SLAVE IO_THREAD; |
|||
source include/wait_for_slave_io_to_start.inc; |
|||
|
|||
connection master; |
|||
sync_slave_with_master; |
|||
SHOW TABLES; |
|||
|
|||
connection master; |
|||
DROP TABLE t1, t2, t3, t4; |
|||
source include/master-slave-end.inc; |
|||
@ -0,0 +1,53 @@ |
|||
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on delete cant find record |
|||
# BUG#49482: RBR: Replication may break on deletes when MyISAM tables + char field are used |
|||
|
|||
-- source include/master-slave.inc |
|||
-- source include/have_binlog_format_mixed_or_row.inc |
|||
|
|||
-- connection master |
|||
CREATE TABLE t1 (c1 BIT, c2 INT); |
|||
INSERT INTO `t1` VALUES ( 1, 1 ); |
|||
UPDATE t1 SET c1=NULL where c2=1; |
|||
-- 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 |
|||
DELETE FROM t1 WHERE c2=1 LIMIT 1; |
|||
-- 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 |
|||
|
|||
-- connection master |
|||
|
|||
CREATE TABLE t1 (c1 CHAR); |
|||
|
|||
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ; |
|||
SELECT * FROM t1; |
|||
-- echo # should trigger switch to row due to LIMIT |
|||
UPDATE t1 SET c1=NULL WHERE c1='w' LIMIT 2; |
|||
-- 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 |
|||
DELETE FROM t1 LIMIT 2; |
|||
-- 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 |
|||
@ -0,0 +1,58 @@ |
|||
# This test should work in embedded server after mysqltest is fixed |
|||
-- source include/not_embedded.inc |
|||
|
|||
--echo Tests of syncronization of stored procedure execution. |
|||
|
|||
--source include/have_debug_sync.inc |
|||
|
|||
--echo # |
|||
--echo # Bug#48157: crash in Item_field::used_tables |
|||
--echo # |
|||
|
|||
CREATE TABLE t1 AS SELECT 1 AS a, 1 AS b; |
|||
CREATE TABLE t2 AS SELECT 1 AS a, 1 AS b; |
|||
|
|||
DELIMITER |; |
|||
|
|||
CREATE PROCEDURE p1() |
|||
BEGIN |
|||
UPDATE t1 JOIN t2 USING( a, b ) SET t1.b = 1, t2.b = 1; |
|||
END| |
|||
|
|||
DELIMITER ;| |
|||
|
|||
connect (con1,localhost,root,,); |
|||
connect (con2,localhost,root,,); |
|||
|
|||
connection con1; |
|||
LOCK TABLES t1 WRITE, t2 WRITE; |
|||
|
|||
connection con2; |
|||
LET $ID= `select connection_id()`; |
|||
SET DEBUG_SYNC = 'multi_update_reopen_tables SIGNAL parked WAIT_FOR go'; |
|||
--send CALL p1() |
|||
|
|||
connection con1; |
|||
let $wait_condition= SELECT 1 FROM information_schema.processlist WHERE ID = $ID AND |
|||
state = "Locked"; |
|||
--source include/wait_condition.inc |
|||
DROP TABLE t1, t2; |
|||
SET DEBUG_SYNC = 'now WAIT_FOR parked'; |
|||
CREATE TABLE t1 AS SELECT 1 AS a, 1 AS b; |
|||
CREATE TABLE t2 AS SELECT 1 AS a, 1 AS b; |
|||
SET DEBUG_SYNC = 'now SIGNAL go'; |
|||
|
|||
connection con2; |
|||
--reap |
|||
|
|||
disconnect con1; |
|||
disconnect con2; |
|||
connection default; |
|||
|
|||
--echo # Without the DEBUG_SYNC supplied in the same patch as this test in the |
|||
--echo # code, this test statement will hang. |
|||
DROP TABLE t1, t2; |
|||
DROP PROCEDURE p1; |
|||
|
|||
SET DEBUG_SYNC = 'RESET'; |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue