Below is the list of changes that have just been committed into a local
5.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2205 06/06/22 22:44:21 monty@stripped +10 -0
Fixed failure with rpl_truncate_7ndb.test when using statement based replication.
is_injective -> table_flag() HA_HAS_OWN_BINLOGGING
(Faster and easier to understand)
Allow cluster_binlogging also in mixed replication mode.
mysql-test/t/rpl_truncate_7ndb_2.test
1.1 06/06/22 22:44:18 monty@stripped +6 -0
New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2.test''
mysql-test/t/rpl_truncate_7ndb_2.test
1.0 06/06/22 22:44:18 monty@stripped +0 -0
BitKeeper file /home/my/mysql-5.1/mysql-test/t/rpl_truncate_7ndb_2.test
mysql-test/t/rpl_truncate_7ndb_2-master.opt
1.1 06/06/22 22:44:17 monty@stripped +1 -0
New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2-master.opt''
mysql-test/r/rpl_truncate_7ndb_2.result
1.1 06/06/22 22:44:17 monty@stripped +91 -0
New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb_2.result''
mysql-test/include/have_binlog_format_mixed_or_row.inc
1.1 06/06/22 22:44:17 monty@stripped +5 -0
New BitKeeper file ``mysql-test/include/have_binlog_format_mixed_or_row.inc''
sql/handler.h
1.218 06/06/22 22:44:17 monty@stripped +2 -6
is_injective -> HA_HAS_OWN_BINLOGGING
sql/handler.cc
1.243 06/06/22 22:44:17 monty@stripped +1 -1
is_injective -> HA_HAS_OWN_BINLOGGING
sql/ha_ndbcluster_binlog.cc
1.68 06/06/22 22:44:17 monty@stripped +3 -1
Use cluster binlogging also in mixed binary logging
(Using a cluster table will enforce row based replication in mixed mode, so this should be ok)
sql/ha_ndbcluster.h
1.142 06/06/22 22:44:17 monty@stripped +0 -2
Remove is_injective() (Is now a table flag)
sql/ha_ndbcluster.cc
1.332 06/06/22 22:44:17 monty@stripped +6 -2
Enforce row based replication if a cluster table is used
mysql-test/t/rpl_truncate_7ndb_2-master.opt
1.0 06/06/22 22:44:17 monty@stripped +0 -0
BitKeeper file /home/my/mysql-5.1/mysql-test/t/rpl_truncate_7ndb_2-master.opt
mysql-test/t/rpl_truncate_7ndb.test
1.5 06/06/22 22:44:17 monty@stripped +1 -0
Ensure that test is only run with mixed or row based replication
mysql-test/r/rpl_truncate_7ndb_2.result
1.0 06/06/22 22:44:17 monty@stripped +0 -0
BitKeeper file /home/my/mysql-5.1/mysql-test/r/rpl_truncate_7ndb_2.result
mysql-test/include/have_binlog_format_mixed_or_row.inc
1.0 06/06/22 22:44:17 monty@stripped +0 -0
BitKeeper file /home/my/mysql-5.1/mysql-test/include/have_binlog_format_mixed_or_row.inc
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: monty
# Host: narttu.mysql.fi
# Root: /home/my/mysql-5.1
--- 1.242/sql/handler.cc 2006-06-16 03:52:04 +03:00
+++ 1.243/sql/handler.cc 2006-06-22 22:44:17 +03:00
@@ -3305,7 +3305,7 @@
const byte *before_record,
const byte *after_record)
{
- if (table->file->is_injective())
+ if (table->file->ha_table_flags() & HA_HAS_OWN_BINLOGGING)
return 0;
bool error= 0;
THD *const thd= table->in_use;
--- 1.217/sql/handler.h 2006-06-14 22:41:56 +03:00
+++ 1.218/sql/handler.h 2006-06-22 22:44:17 +03:00
@@ -116,6 +116,8 @@
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
#define HA_NO_COPY_ON_ALTER (LL(1) << 31)
#define HA_HAS_RECORDS (LL(1) << 32) /* records() gives exact count*/
+/* Has it's own method of binlog logging */
+#define HA_HAS_OWN_BINLOGGING (LL(1) << 33)
/* bits in index_flags(index_number) for what you can do with index */
#define HA_READ_NEXT 1 /* TODO really use this flag */
@@ -1052,12 +1054,6 @@
int ha_write_row(byte * buf);
int ha_update_row(const byte * old_data, byte * new_data);
int ha_delete_row(const byte * buf);
-
- /*
- If the handler does it's own injection of the rows, this member function
- should return 'true'.
- */
- virtual bool is_injective() const { return false; }
/*
SYNOPSIS
--- 1.331/sql/ha_ndbcluster.cc 2006-06-22 12:20:19 +03:00
+++ 1.332/sql/ha_ndbcluster.cc 2006-06-22 22:44:17 +03:00
@@ -4056,6 +4056,7 @@
DBUG_PRINT("warning", ("ops_pending != 0L"));
m_ops_pending= 0;
}
+ thd->set_current_stmt_binlog_row_based_if_mixed();
DBUG_RETURN(error);
}
@@ -4105,7 +4106,8 @@
// Start of statement
m_ops_pending= 0;
-
+ thd->set_current_stmt_binlog_row_based_if_mixed();
+
DBUG_RETURN(error);
}
@@ -5452,7 +5454,8 @@
HA_CAN_BIT_FIELD | \
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION | \
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | \
- HA_PARTIAL_COLUMN_READ
+ HA_PARTIAL_COLUMN_READ | \
+ HA_HAS_OWN_BINLOGGING
ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
handler(&ndbcluster_hton, table_arg),
@@ -7954,6 +7957,7 @@
my_net_init(&thd->net, 0);
thd->main_security_ctx.master_access= ~0;
thd->main_security_ctx.priv_user = 0;
+ thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
/*
wait for mysql server to start
--- 1.141/sql/ha_ndbcluster.h 2006-06-21 10:50:35 +03:00
+++ 1.142/sql/ha_ndbcluster.h 2006-06-22 22:44:17 +03:00
@@ -661,8 +661,6 @@
bool low_byte_first() const;
- virtual bool is_injective() const { return true; }
-
const char* index_type(uint key_number);
double scan_time();
--- 1.4/mysql-test/t/rpl_truncate_7ndb.test 2006-06-16 12:10:30 +03:00
+++ 1.5/mysql-test/t/rpl_truncate_7ndb.test 2006-06-22 22:44:17 +03:00
@@ -1,6 +1,7 @@
--source include/have_ndb.inc
--source include/master-slave.inc
+--source include/have_binlog_format_mixed_or_row.inc
--disable_query_log
--disable_warnings
--- New file ---
+++ mysql-test/include/have_binlog_format_mixed_or_row.inc 06/06/22 22:44:17
--require r/have_binlog_format_row.require
--disable_query_log
--replace_result MIXED ROW
show variables like "binlog_format";
--enable_query_log
--- New file ---
+++ mysql-test/r/rpl_truncate_7ndb_2.result 06/06/22 22:44:17
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;
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
a b
1 1
2 2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
a b
1 1
2 2
3 3
**** On Master ****
TRUNCATE TABLE t1;
SELECT * FROM t1 ORDER BY a,b;
a b
**** On Slave ****
SELECT * FROM t1 ORDER BY a,b;
a b
**** On Master ****
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT
master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1
master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1
**** On Master ****
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
a b
1 1
2 2
**** On Slave ****
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
a b
1 1
2 2
3 3
**** On Master ****
DELETE FROM t1;
SELECT * FROM t1 ORDER BY a,b;
a b
**** On Slave ****
SELECT * FROM t1 ORDER BY a,b;
a b
3 3
**** On Master ****
DROP TABLE t1;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: SERVER_VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 219 Query 1 283 BEGIN
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status)
master-bin.000001 376 Write_rows 1 135 table_id: #
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 465 Query 1 530 COMMIT
master-bin.000001 530 Query 1 610 use `test`; TRUNCATE TABLE t1
master-bin.000001 610 Query 1 686 use `test`; DROP TABLE t1
master-bin.000001 686 Query 1 803 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
master-bin.000001 803 Query 1 867 BEGIN
master-bin.000001 867 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 907 Table_map 1 93 table_id: # (cluster.apply_status)
master-bin.000001 960 Write_rows 1 135 table_id: #
master-bin.000001 1002 Write_rows 1 182 table_id: # flags: STMT_END_F
master-bin.000001 1049 Query 1 1114 COMMIT
master-bin.000001 1114 Query 1 1178 BEGIN
master-bin.000001 1178 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 1218 Table_map 1 93 table_id: # (cluster.apply_status)
master-bin.000001 1271 Write_rows 1 135 table_id: #
master-bin.000001 1313 Delete_rows 1 174 table_id: # flags: STMT_END_F
master-bin.000001 1352 Query 1 1417 COMMIT
master-bin.000001 1417 Query 1 1493 use `test`; DROP TABLE t1
--- New file ---
+++ mysql-test/t/rpl_truncate_7ndb_2-master.opt 06/06/22 22:44:17
--binlog-format=mixed
--- New file ---
+++ mysql-test/t/rpl_truncate_7ndb_2.test 06/06/22 22:44:18
# Same test as rpl_truncate_7ndb.test, but with mixed mode
# This is marked with 'big_test' just because the rpl_truncate_7ndb test is
# so slow...
--source include/big_test.inc
--source t/rpl_truncate_7ndb.test
--- 1.67/sql/ha_ndbcluster_binlog.cc 2006-06-19 13:00:31 +03:00
+++ 1.68/sql/ha_ndbcluster_binlog.cc 2006-06-22 22:44:17 +03:00
@@ -3347,9 +3347,11 @@
ndb_binlog_thread_running= 1;
if (opt_bin_log)
{
- if (global_system_variables.binlog_format == BINLOG_FORMAT_ROW)
+ if (global_system_variables.binlog_format == BINLOG_FORMAT_ROW ||
+ global_system_variables.binlog_format == BINLOG_FORMAT_MIXED)
{
ndb_binlog_running= TRUE;
+ thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
}
else
{
| Thread |
|---|
| • bk commit into 5.1 tree (monty:1.2205) | monty | 22 Jun |