mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#3023 (Use locks in a statement-like manner):
Table maps are now written on aquiring locks to tables and released at the end of each logical statement. mysql-test/extra/binlog_tests/ctype_cp932.test: Disabling cleanup code mysql-test/r/binlog_row_blackhole.result: Result change mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change mysql-test/r/binlog_stm_ctype_cp932.result: Result change mysql-test/r/rpl_row_charset.result: Result change mysql-test/r/rpl_row_create_table.result: Result change mysql-test/t/rpl_row_create_table.test: Binlog position change sql/handler.cc: Writing table map after external_lock() sql/handler.h: Adding class for table operation hooks. sql/log.cc: Adding binlog_write_table_map() to THD. Removing write_table_map() from MYSQL_LOG. sql/log.h: Minor interface changes to move table map writing. sql/log_event.cc: Removing pre-allocation of memory for buffers. Allowing ULONG_MAX as table id denoting an event to ignore (only used to transfer flags). Adding code to collect tables while seeing table maps and lock collected tables when seeing a binrow event. Debriding code as a result of the above changes. sql/log_event.h: Minor interface changes. sql/mysql_priv.h: Adding hooks argument to create_table_from_items(). sql/parse_file.cc: Minor fix to avoid crash in debug printout. sql/rpl_rli.h: Adding list of tables to lock to RLI structure. sql/slave.cc: Using list of tables to lock from RLI structure. sql/sql_acl.cc: Removing redundant pending events flush. sql/sql_base.cc: Moving pending event flush. Using flag to guard to clear statement transaction only if this is the original open tables state. sql/sql_class.cc: Adding flag for open tables state. Removing redundant pending events flushes. Write a dummy event to indicate that the tables to lock should be emptied on the slave. sql/sql_class.h: Adding open tables state flags. Adding binlog_write_table_map() function to THD. Changes to select_create() to support new locking scheme. sql/sql_insert.cc: Adding rollback of statement transaction on error. It can now contain events after locking tables. sql/sql_load.cc: Removing redundant pending event flush. sql/sql_table.cc: Adding hooks argument to create_table_from_items(). Calling prelock hook before starting to lock tables. sql/sql_update.cc: Removing a compiler warning. sql/table.h: Minor changes.
This commit is contained in:
@ -127,7 +127,7 @@ NULL 5 10
|
||||
NULL 6 12
|
||||
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
|
||||
ERROR 23000: Duplicate entry '2' for key 1
|
||||
SHOW BINLOG EVENTS FROM 1256;
|
||||
SHOW BINLOG EVENTS FROM 1326;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
CREATE TABLE t7 (a INT, b INT UNIQUE);
|
||||
INSERT INTO t7 SELECT a,b FROM tt3;
|
||||
@ -137,11 +137,11 @@ a b
|
||||
1 2
|
||||
2 4
|
||||
3 6
|
||||
SHOW BINLOG EVENTS FROM 1256;
|
||||
SHOW BINLOG EVENTS FROM 1326;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 1256 Query 1 1356 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
|
||||
master-bin.000001 1356 Table_map 1 1396 test.t7
|
||||
master-bin.000001 1396 Write_rows 1 1452
|
||||
master-bin.000001 1326 Query 1 1426 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
|
||||
master-bin.000001 1426 Table_map 1 1466 test.t7
|
||||
master-bin.000001 1466 Write_rows 1 1522
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
a b
|
||||
1 2
|
||||
@ -154,10 +154,10 @@ INSERT INTO t7 SELECT a,b FROM tt4;
|
||||
ROLLBACK;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
SHOW BINLOG EVENTS FROM 1452;
|
||||
SHOW BINLOG EVENTS FROM 1522;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 1452 Table_map 1 1492 test.t7
|
||||
master-bin.000001 1492 Write_rows 1 1548
|
||||
master-bin.000001 1522 Table_map 1 1562 test.t7
|
||||
master-bin.000001 1562 Write_rows 1 1618
|
||||
SELECT * FROM t7 ORDER BY a,b;
|
||||
a b
|
||||
1 2
|
||||
@ -191,10 +191,10 @@ Create Table CREATE TABLE `t9` (
|
||||
`a` int(11) default NULL,
|
||||
`b` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SHOW BINLOG EVENTS FROM 1548;
|
||||
SHOW BINLOG EVENTS FROM 1618;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 1548 Query 1 1634 use `test`; CREATE TABLE t8 LIKE t4
|
||||
master-bin.000001 1634 Query 1 1773 use `test`; CREATE TABLE `t9` (
|
||||
master-bin.000001 1618 Query 1 1704 use `test`; CREATE TABLE t8 LIKE t4
|
||||
master-bin.000001 1704 Query 1 1843 use `test`; CREATE TABLE `t9` (
|
||||
`a` int(11) default NULL,
|
||||
`b` int(11) default NULL
|
||||
)
|
||||
|
Reference in New Issue
Block a user