mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge 5.1->5.2
This commit is contained in:
@ -29,3 +29,32 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
drop table t1;
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE t1
|
||||
###############################################
|
||||
RESET MASTER;
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
###############################################
|
||||
### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
###############################################
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
###############################################
|
||||
|
@ -48,12 +48,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -77,12 +77,12 @@ Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t2)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
@ -413,7 +413,6 @@ master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
master-bin.000001 # Query # # COMMIT
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Table_map # # table_id: # (test.t1)
|
||||
master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
||||
|
@ -1,3 +1,4 @@
|
||||
drop table if exists t1;
|
||||
create table t1 (a int, b int) engine=innodb;
|
||||
begin;
|
||||
insert into t1 values (1,2);
|
||||
@ -5,10 +6,11 @@ commit;
|
||||
show binlog events;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 106 Server ver: #, Binlog ver: #
|
||||
master-bin.000001 106 Query 1 213 use `test`; create table t1 (a int, b int) engine=innodb
|
||||
master-bin.000001 213 Query 1 281 BEGIN
|
||||
master-bin.000001 281 Query 1 371 use `test`; insert into t1 values (1,2)
|
||||
master-bin.000001 371 Xid 1 398 COMMIT /* XID */
|
||||
master-bin.000001 106 Query 1 192 use `test`; drop table if exists t1
|
||||
master-bin.000001 192 Query 1 299 use `test`; create table t1 (a int, b int) engine=innodb
|
||||
master-bin.000001 299 Query 1 367 BEGIN
|
||||
master-bin.000001 367 Query 1 457 use `test`; insert into t1 values (1,2)
|
||||
master-bin.000001 457 Xid 1 484 COMMIT /* XID */
|
||||
drop table t1;
|
||||
drop table if exists t1, t2;
|
||||
reset master;
|
||||
|
@ -44,10 +44,10 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(3)
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(4)
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
@ -70,10 +70,10 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(5)
|
||||
master-bin.000001 # Query # # use `test`; savepoint my_savepoint
|
||||
master-bin.000001 # Query # # SAVEPOINT my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(6)
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint
|
||||
master-bin.000001 # Query # # ROLLBACK TO my_savepoint
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(7)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
delete from t1;
|
||||
|
@ -48,3 +48,16 @@ SET GLOBAL log_warnings = @old_log_warnings;
|
||||
# Count the number of times the "Unsafe" message was printed
|
||||
# to the error log.
|
||||
Occurrences: 1
|
||||
create table t1 (n1 int, n2 int, n3 int,
|
||||
key (n1, n2, n3),
|
||||
key (n2, n3, n1),
|
||||
key (n3, n1, n2));
|
||||
insert into t1 values (1,1,1);
|
||||
insert into t1 values (RAND()*1000+10, RAND()*1000+10, RAND()*1000+10);
|
||||
update t1 set n1=rand() where n1=1;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
delete from t1 where n2=1 + rand()*0;
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
drop table t1;
|
||||
|
@ -29,3 +29,14 @@ a
|
||||
6
|
||||
8
|
||||
drop table foo;
|
||||
RESET MASTER;
|
||||
create database b51226;
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
use b51226;
|
||||
create temporary table t1(i int);
|
||||
create temporary table t1(i int);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
insert into t1 values(1);
|
||||
DROP DATABASE b51226;
|
||||
FLUSH LOGS;
|
||||
|
@ -380,8 +380,6 @@ INSERT INTO t1 VALUES (VERSION());
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
INSERT INTO t1 VALUES (RAND());
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
DELETE FROM t1;
|
||||
SET TIME_ZONE= '+03:00';
|
||||
SET TIMESTAMP=1000000;
|
||||
|
@ -40,3 +40,40 @@ commit;
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#51251
|
||||
#
|
||||
# The test case checks if truncating a temporary table created with
|
||||
# engine InnoDB will not cause the truncate statement to be binlogged.
|
||||
|
||||
# Before patch for BUG#51251, the TRUNCATE statements below would be
|
||||
# binlogged, which would cause the slave to fail with "table does not
|
||||
# exist".
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TABLE t1 ( c1 int , primary key (c1)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS t2 LIKE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t2'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
CREATE TEMPORARY TABLE t1 (c1 int) Engine=InnoDB;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
TRUNCATE t1;
|
||||
DROP TEMPORARY TABLE t1;
|
||||
|
||||
-- echo ###############################################
|
||||
-- echo ### assertion: No event for 'TRUNCATE TABLE t1'
|
||||
-- echo ###############################################
|
||||
-- source include/show_binlog_events.inc
|
||||
-- echo ###############################################
|
||||
|
@ -202,7 +202,7 @@ eval kill query $ID;
|
||||
rollback;
|
||||
|
||||
connection con2;
|
||||
--error 0,ER_QUERY_INTERRUPTED
|
||||
--error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT
|
||||
reap;
|
||||
# todo 1,2 above
|
||||
rollback;
|
||||
|
@ -1,3 +1,10 @@
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_binlog_format_mixed.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# REQUIREMENT
|
||||
# replace_regex should replace output of SHOW BINLOG EVENTS
|
||||
|
||||
@ -12,7 +19,4 @@ drop table t1;
|
||||
# This is a wrapper for binlog.test so that the same test case can be used
|
||||
# For both statement and row based bin logs 9/19/2005 [jbm]
|
||||
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/have_binlog_format_mixed.inc
|
||||
-- source extra/binlog_tests/binlog.test
|
||||
|
||||
|
@ -115,3 +115,19 @@ perl;
|
||||
print "Occurrences: $count\n";
|
||||
close(FILE);
|
||||
EOF
|
||||
|
||||
#
|
||||
# Check how RAND() can be used with replication
|
||||
#
|
||||
|
||||
create table t1 (n1 int, n2 int, n3 int,
|
||||
key (n1, n2, n3),
|
||||
key (n2, n3, n1),
|
||||
key (n3, n1, n2));
|
||||
insert into t1 values (1,1,1);
|
||||
# This should work fine
|
||||
insert into t1 values (RAND()*1000+10, RAND()*1000+10, RAND()*1000+10);
|
||||
# This should need row based logging.
|
||||
update t1 set n1=rand() where n1=1;
|
||||
delete from t1 where n2=1 + rand()*0;
|
||||
drop table t1;
|
||||
|
@ -82,3 +82,69 @@ select * from foo;
|
||||
|
||||
# clean up
|
||||
drop table foo;
|
||||
|
||||
#################################################################
|
||||
# BUG#51226
|
||||
#################################################################
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
-- let $dbname=b51226
|
||||
|
||||
connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
|
||||
#
|
||||
# action: on con1 create the database and the tmp table
|
||||
#
|
||||
-- connection con1
|
||||
-- eval create database $dbname
|
||||
-- eval use $dbname
|
||||
create temporary table t1(i int);
|
||||
|
||||
#
|
||||
# action: on con1 create the tmp table
|
||||
#
|
||||
-- connection con2
|
||||
-- eval use $dbname
|
||||
create temporary table t1(i int);
|
||||
|
||||
# action: at this point, the last event binlogged contains the
|
||||
# pseudo_thread_id from con2. So now we switch to con1, issue
|
||||
# a statement that fails and close the connection (which logs
|
||||
# implicitely a DROP TEMPORARY TABLE).
|
||||
#
|
||||
# Before the patch this would not log con1's pseudo_thread_id
|
||||
# because the failing statement would reset THD context
|
||||
# (unsetting the thread_specific_used flag, and consequently,
|
||||
# causing the DROP event to be logged without pseudo_thread_id
|
||||
# in its header).
|
||||
|
||||
-- connection con1
|
||||
-- error 1050
|
||||
create temporary table t1(i int);
|
||||
-- disconnect con1
|
||||
|
||||
-- connection default
|
||||
-- let $wait_binlog_event= DROP
|
||||
-- source include/wait_for_binlog_event.inc
|
||||
|
||||
# action: insert in the t1. This would cause the the test to fail,
|
||||
# because when replaying the binlog the previous implicit drop
|
||||
# temp table would have been executed under the wrong
|
||||
# pseudo_thread_id, dropping the tmp table on con2.
|
||||
-- connection con2
|
||||
insert into t1 values(1);
|
||||
-- disconnect con2
|
||||
|
||||
-- connection default
|
||||
-- let $wait_binlog_event= DROP
|
||||
-- source include/wait_for_binlog_event.inc
|
||||
|
||||
-- eval DROP DATABASE $dbname
|
||||
FLUSH LOGS;
|
||||
|
||||
# assertion: assert that when replaying the binary log will succeed,
|
||||
# instead of failing with "Table 'XXX.YYY' doesn't exist"
|
||||
-- let $MYSQLD_DATADIR= `select @@datadir`
|
||||
-- exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL
|
||||
|
Reference in New Issue
Block a user