mariadb/mysql-test/t/partition_innodb_stmt.test

61 lines
1.2 KiB
Text
Raw Normal View History

--source include/have_partition.inc
Bug#39084: Getting intermittent errors with statement-based binary logging Problem was that partitioning cached the table flags. These flags could change due to TRANSACTION LEVEL changes. Solution was to remove the cache and always return the table flags from the first partition (if the handler was initialized). mysql-test/r/partition_innodb_stmt.result: Bug#39084: Getting intermittent errors with statement-based binary logging New test result file. mysql-test/t/partition_innodb_stmt.test: Bug#39084: Getting intermittent errors with statement-based binary logging New test file. sql/ha_partition.cc: Bug#39084: Getting intermittent errors with statement-based binary logging Removed m_table_flags, and added m_handler_status. Added checks that all partitions have the same table flags. Moved some variable initializations. Updated some comments. Fixed typo initialise -> initialize Changed HA_EXTTA_NO_READCHECK to do nothing, since it is only used in ha_open, which is called for every partition in ::open anyway. sql/ha_partition.h: Bug#39084: Getting intermittent errors with statement-based binary logging Removed m_table_flags, and added m_handler_status. Always return the first partitions table flags, instead of using cached table flags. Added define of enabled/disabled partitioning table flags Fixed type initialise -> initialize Updated some comments. sql/handler.cc: Bug#39084: Getting intermittent errors with statement-based binary logging Fixed type initialise -> initialize. sql/handler.h: Bug#39084: Getting intermittent errors with statement-based binary logging Added comment to understand where the cached value is set.
2008-10-29 21:20:04 +01:00
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
--echo # connection default
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
CREATE TABLE t1
(
id SMALLINT NOT NULL,
PRIMARY KEY (id)
) ENGINE=innodb
PARTITION BY RANGE (id)
(
PARTITION p1 VALUES LESS THAN (2),
PARTITION p2 VALUES LESS THAN (4),
PARTITION p3 VALUES LESS THAN (10)
);
INSERT INTO t1 VALUES (1),(2),(3);
--echo # Test READ COMMITTED -> REPEATABLE READ
FLUSH TABLES;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
SELECT * FROM t1;
connect (con1, localhost, root,,);
connection con1;
--echo #connection con1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
INSERT INTO t1 VALUES(7);
COMMIT;
connection default;
--echo # connection default
COMMIT;
FLUSH TABLES;
--echo # Test REPEATABLE READ -> READ COMMITTED
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
SELECT * FROM t1;
connection con1;
--echo # connection con1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
--error ER_BINLOG_LOGGING_IMPOSSIBLE
INSERT INTO t1 VALUES(9);
COMMIT;
disconnect con1;
connection default;
COMMIT;
DROP TABLE t1;