mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merging with 5.1-5.1.29-rc.
This commit is contained in:
25
mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
Normal file
25
mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
Normal file
@ -0,0 +1,25 @@
|
||||
flush status;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 0
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 0
|
||||
drop table if exists t1;
|
||||
create table t1 (a int) engine=innodb;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 1
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
begin;
|
||||
delete from t1;
|
||||
commit;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 2
|
||||
show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
drop table t1;
|
@ -1090,6 +1090,53 @@ master-bin.000001 295 Table_map 1 337 table_id: # (test.t1)
|
||||
master-bin.000001 337 Write_rows 1 383 table_id: # flags: STMT_END_F
|
||||
master-bin.000001 383 Query 1 452 use `test`; COMMIT
|
||||
master-bin.000001 452 Query 1 528 use `test`; drop table t1
|
||||
reset master;
|
||||
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||
USE bug39182;
|
||||
CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
|
||||
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE s1 VARCHAR(255);
|
||||
SET s1= "test";
|
||||
CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
|
||||
SELECT
|
||||
COLLATION(NAME_CONST('s1', _utf8'test')) c1,
|
||||
COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
|
||||
COLLATION(s1) c3,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
|
||||
COERCIBILITY(s1) d3;
|
||||
DROP TEMPORARY TABLE tmp1;
|
||||
END//
|
||||
CALL p1();
|
||||
c1 c2 c3 d1 d2 d3
|
||||
utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
|
||||
master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
|
||||
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
|
||||
master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
||||
BEGIN
|
||||
DECLARE s1 VARCHAR(255);
|
||||
SET s1= "test";
|
||||
CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
|
||||
SELECT
|
||||
COLLATION(NAME_CONST('s1', _utf8'test')) c1,
|
||||
COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
|
||||
COLLATION(s1) c3,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
|
||||
COERCIBILITY(s1) d3;
|
||||
DROP TEMPORARY TABLE tmp1;
|
||||
END
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
End of 5.0 tests
|
||||
reset master;
|
||||
create table t1 (id tinyint auto_increment primary key);
|
||||
|
@ -1,3 +1,4 @@
|
||||
flush status;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 0
|
||||
@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
drop table t1;
|
||||
show status like "Innodb_buffer_pool_pages_total";
|
||||
Variable_name Value
|
||||
Innodb_buffer_pool_pages_total 512
|
||||
show status like "Innodb_page_size";
|
||||
Variable_name Value
|
||||
Innodb_page_size 16384
|
||||
show status like "Innodb_rows_deleted";
|
||||
Variable_name Value
|
||||
Innodb_rows_deleted 2000
|
||||
show status like "Innodb_rows_inserted";
|
||||
Variable_name Value
|
||||
Innodb_rows_inserted 2000
|
||||
show status like "Innodb_rows_updated";
|
||||
Variable_name Value
|
||||
Innodb_rows_updated 0
|
||||
|
@ -594,6 +594,56 @@ master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
|
||||
master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
|
||||
master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
|
||||
master-bin.000001 351 Query 1 427 use `test`; drop table t1
|
||||
reset master;
|
||||
CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
|
||||
USE bug39182;
|
||||
CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
|
||||
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
CREATE PROCEDURE p1()
|
||||
BEGIN
|
||||
DECLARE s1 VARCHAR(255);
|
||||
SET s1= "test";
|
||||
CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
|
||||
SELECT
|
||||
COLLATION(NAME_CONST('s1', _utf8'test')) c1,
|
||||
COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
|
||||
COLLATION(s1) c3,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
|
||||
COERCIBILITY(s1) d3;
|
||||
DROP TEMPORARY TABLE tmp1;
|
||||
END//
|
||||
CALL p1();
|
||||
c1 c2 c3 d1 d2 d3
|
||||
utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
|
||||
master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
|
||||
DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
|
||||
master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
|
||||
BEGIN
|
||||
DECLARE s1 VARCHAR(255);
|
||||
SET s1= "test";
|
||||
CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
|
||||
SELECT
|
||||
COLLATION(NAME_CONST('s1', _utf8'test')) c1,
|
||||
COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
|
||||
COLLATION(s1) c3,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
|
||||
COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
|
||||
COERCIBILITY(s1) d3;
|
||||
DROP TEMPORARY TABLE tmp1;
|
||||
END
|
||||
master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1
|
||||
SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%")
|
||||
master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE tmp1
|
||||
DROP PROCEDURE p1;
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE bug39182;
|
||||
USE test;
|
||||
End of 5.0 tests
|
||||
reset master;
|
||||
create table t1 (id tinyint auto_increment primary key);
|
||||
|
@ -1,3 +1,4 @@
|
||||
flush status;
|
||||
show status like "binlog_cache_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_use 0
|
||||
@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
|
||||
Variable_name Value
|
||||
Binlog_cache_disk_use 1
|
||||
drop table t1;
|
||||
show status like "Innodb_buffer_pool_pages_total";
|
||||
Variable_name Value
|
||||
Innodb_buffer_pool_pages_total 512
|
||||
show status like "Innodb_page_size";
|
||||
Variable_name Value
|
||||
Innodb_page_size 16384
|
||||
show status like "Innodb_rows_deleted";
|
||||
Variable_name Value
|
||||
Innodb_rows_deleted 2000
|
||||
show status like "Innodb_rows_inserted";
|
||||
Variable_name Value
|
||||
Innodb_rows_inserted 2000
|
||||
show status like "Innodb_rows_updated";
|
||||
Variable_name Value
|
||||
Innodb_rows_updated 0
|
||||
|
71
mysql-test/suite/binlog/r/binlog_stm_row.result
Normal file
71
mysql-test/suite/binlog/r/binlog_stm_row.result
Normal file
@ -0,0 +1,71 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
SET GLOBAL BINLOG_FORMAT = STATEMENT;
|
||||
SET SESSION BINLOG_FORMAT = STATEMENT;
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
select @@SESSION.BINLOG_FORMAT;
|
||||
@@SESSION.BINLOG_FORMAT
|
||||
STATEMENT
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
#
|
||||
# Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
|
||||
# lock that will prevent the source table from being modified.
|
||||
#
|
||||
# con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
GET_LOCK('Bug#34306', 120)
|
||||
1
|
||||
# con2
|
||||
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
EXECUTE stmt;;
|
||||
# default
|
||||
INSERT INTO t2 VALUES (3);;
|
||||
# con1
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# con2
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# default
|
||||
#
|
||||
# Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
|
||||
# not prevent the source table from being modified if under RBR.
|
||||
#
|
||||
# con2
|
||||
SET SESSION BINLOG_FORMAT = ROW;
|
||||
# con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
GET_LOCK('Bug#34306', 120)
|
||||
1
|
||||
# con2
|
||||
EXECUTE stmt;;
|
||||
# default
|
||||
# con1
|
||||
INSERT INTO t2 VALUES (4);
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
RELEASE_LOCK('Bug#34306')
|
||||
1
|
||||
# con2
|
||||
# default
|
||||
# Show binlog events
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES(2)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (4)
|
||||
master-bin.000001 # Query # # use `test`; 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`; COMMIT
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
@ -33,7 +33,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
|
||||
eval select $error_code /* must return 1 as query completed before got killed*/;
|
||||
|
||||
# cleanup for the sub-case
|
||||
system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
|
||||
|
||||
|
||||
#
|
||||
@ -61,7 +61,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
|
||||
eval select $error_code /* must return 0 to mean the killed query is in */;
|
||||
|
||||
# cleanup for the sub-case
|
||||
system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
|
||||
remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
|
||||
|
||||
|
||||
drop table t1,t2;
|
||||
|
5
mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
Normal file
5
mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
Normal file
@ -0,0 +1,5 @@
|
||||
# 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/have_binlog_format_mixed.inc
|
||||
-- source extra/binlog_tests/innodb_stat.test
|
@ -21,4 +21,4 @@ select * from t2;
|
||||
|
||||
# clean up
|
||||
drop table t1,t2;
|
||||
#--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
#--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
|
@ -1,5 +1,5 @@
|
||||
# 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/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/have_binlog_format_statement.inc
|
||||
-- source extra/binlog_tests/innodb_stat.test
|
||||
|
107
mysql-test/suite/binlog/t/binlog_stm_row.test
Normal file
107
mysql-test/suite/binlog/t/binlog_stm_row.test
Normal file
@ -0,0 +1,107 @@
|
||||
--source include/have_log_bin.inc
|
||||
--source include/have_binlog_format_row_or_statement.inc
|
||||
|
||||
# Get rid of previous tests binlog
|
||||
--disable_query_log
|
||||
reset master;
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# Bug#34306: Can't make copy of log tables when server binary log is enabled
|
||||
#
|
||||
# This is an additional test for Bug#34306 in order to ensure that INSERT INTO
|
||||
# .. SELECT FROM is properly replicated under SBR and RBR and that the proper
|
||||
# read lock type are acquired.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
SET GLOBAL BINLOG_FORMAT = STATEMENT;
|
||||
SET SESSION BINLOG_FORMAT = STATEMENT;
|
||||
|
||||
CREATE TABLE t1 (a INT);
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
select @@SESSION.BINLOG_FORMAT;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(2);
|
||||
|
||||
--connect(con1,localhost,root,,)
|
||||
--connect(con2,localhost,root,,)
|
||||
|
||||
--echo #
|
||||
--echo # Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
|
||||
--echo # lock that will prevent the source table from being modified.
|
||||
--echo #
|
||||
|
||||
--connection con1
|
||||
--echo # con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
--connection con2
|
||||
--echo # con2
|
||||
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--send EXECUTE stmt;
|
||||
--connection default
|
||||
--echo # default
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "User lock" AND
|
||||
info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--source include/wait_condition.inc
|
||||
--send INSERT INTO t2 VALUES (3);
|
||||
--connection con1
|
||||
--echo # con1
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "Locked" and info = "INSERT INTO t2 VALUES (3)";
|
||||
--source include/wait_condition.inc
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--reap
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection default
|
||||
--echo # default
|
||||
--reap
|
||||
|
||||
--echo #
|
||||
--echo # Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
|
||||
--echo # not prevent the source table from being modified if under RBR.
|
||||
--echo #
|
||||
|
||||
--connection con2
|
||||
--echo # con2
|
||||
SET SESSION BINLOG_FORMAT = ROW;
|
||||
--connection con1
|
||||
--echo # con1
|
||||
SELECT GET_LOCK('Bug#34306', 120);
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--send EXECUTE stmt;
|
||||
--connection default
|
||||
--echo # default
|
||||
let $wait_condition=
|
||||
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
|
||||
state = "User lock" AND
|
||||
info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
|
||||
--source include/wait_condition.inc
|
||||
--connection con1
|
||||
--echo # con1
|
||||
INSERT INTO t2 VALUES (4);
|
||||
SELECT RELEASE_LOCK('Bug#34306');
|
||||
--connection con2
|
||||
--echo # con2
|
||||
--reap
|
||||
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
--connection default
|
||||
--echo # default
|
||||
|
||||
--echo # Show binlog events
|
||||
source include/show_binlog_events.inc;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
Reference in New Issue
Block a user