List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:May 22 2007 1:16pm
Subject:bk commit into 5.1 tree (mats:1.2579)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mats. When mats 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@stripped, 2007-05-22 15:16:12+02:00, mats@stripped +16 -0
  WL#3303 (RBR: Engine-controlled logging format):
  
  Adding support to allow engines to tell what formats they can handle.
  The server will generate an error if it is not possible to log the
  statement according to the logging mode in effect.
  
  Adding flags to several storage engines to state what they can handle.
  
  Changes to NDB handler removing code that forces row-based mode and
  adding flag saying that NDB can only handle row format.

  mysql-test/r/binlog_multi_engine.result@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +74 -0
    New BitKeeper file ``mysql-test/r/binlog_multi_engine.result''

  mysql-test/r/binlog_multi_engine.result@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +0 -0

  mysql-test/t/binlog_multi_engine.test@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +54 -0
    New BitKeeper file ``mysql-test/t/binlog_multi_engine.test''

  mysql-test/t/binlog_multi_engine.test@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +0 -0

  sql/ha_ndbcluster.cc@stripped, 2007-05-22 15:16:05+02:00, mats@stripped +1 -3
    Removing statements that switch to row-based format.

  sql/ha_partition.cc@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +6 -1
    Archive can handle both row- and statement-based logging format.

  sql/handler.h@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +10 -1
    Adding handlerton flags to indicate that the engine is row- and/or
    statement-logging capable.

  sql/log.cc@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +1 -0
    The binary log is capable of handling both row- and statement-format.

  sql/share/errmsg.txt@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +6 -0
    Adding error messages for when row- and/or statement-based logging
    formats cannot be used.

  sql/sql_base.cc@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +83 -6
    Adding business logic in lock_tables() to decide when an error should
    be thrown because logging is not possible.
    Add logic to switch to row format when that is allowed and possible.

  storage/archive/ha_archive.cc@stripped, 2007-05-22 15:16:06+02:00, mats@stripped +1 -0
    Archive can handle both row- and statement-based logging format.

  storage/blackhole/ha_blackhole.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -0
    Archive can only handle statement-based logging format.

  storage/csv/ha_tina.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -0
    CSV can handle both row- and statement-based logging format.

  storage/example/ha_example.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +6 -0
    Archive can only handle statement-based logging format (generates error
    for write_row(), so this is not strictly true).

  storage/federated/ha_federated.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -0
    Federated can handle both row- and statement-based logging format.

  storage/heap/ha_heap.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -1
    Heap can handle both row- and statement-based logging format.

  storage/myisam/ha_myisam.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -0
    MyISAM can handle both row- and statement-based logging format.

  storage/myisammrg/ha_myisammrg.cc@stripped, 2007-05-22 15:16:07+02:00, mats@stripped +1 -0
    MyISAM can handle both row- and statement-based logging format.

# 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:	mats
# Host:	kindahl-laptop.dnsalias.net
# Root:	/home/bk/w3303-mysql-5.1-rpl

--- 1.111/storage/heap/ha_heap.cc	2007-05-22 15:16:22 +02:00
+++ 1.112/storage/heap/ha_heap.cc	2007-05-22 15:16:22 +02:00
@@ -44,7 +44,7 @@
   heap_hton->create=     heap_create_handler;
   heap_hton->panic=      heap_panic;
   heap_hton->flags=      HTON_CAN_RECREATE;
-
+  heap_hton->flags|=     HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.217/storage/myisam/ha_myisam.cc	2007-05-22 15:16:22 +02:00
+++ 1.218/storage/myisam/ha_myisam.cc	2007-05-22 15:16:22 +02:00
@@ -2060,6 +2060,7 @@
   myisam_hton->create= myisam_create_handler;
   myisam_hton->panic= myisam_panic;
   myisam_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
+  myisam_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.118/storage/myisammrg/ha_myisammrg.cc	2007-05-22 15:16:22 +02:00
+++ 1.119/storage/myisammrg/ha_myisammrg.cc	2007-05-22 15:16:22 +02:00
@@ -620,6 +620,7 @@
   myisammrg_hton->create= myisammrg_create_handler;
   myisammrg_hton->panic= myisammrg_panic;
   myisammrg_hton->flags=  HTON_CAN_RECREATE|HTON_NO_PARTITION;
+  myisammrg_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
 
   return 0;
 }

--- 1.256/sql/handler.h	2007-05-22 15:16:22 +02:00
+++ 1.257/sql/handler.h	2007-05-22 15:16:22 +02:00
@@ -687,7 +687,7 @@
 };
 
 
-/* Possible flags of a handlerton */
+/* Possible flags of a handlerton (there can be 32 of them) */
 #define HTON_NO_FLAGS                 0
 #define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
 #define HTON_ALTER_NOT_SUPPORTED     (1 << 1) //Engine does not support alter
@@ -698,6 +698,15 @@
 #define HTON_TEMPORARY_NOT_SUPPORTED (1 << 6) //Having temporary tables not supported
 #define HTON_SUPPORT_LOG_TABLES      (1 << 7) //Engine supports log tables
 #define HTON_NO_PARTITION            (1 << 8) //You can not partition these tables
+/*
+  Engine is capable of row-format and statement-format logging,
+  respectively
+*/
+#define HTON_BINLOG_ROW_CAPABLE      (1 << 9)
+#define HTON_BINLOG_STMT_CAPABLE     (1 << 10)
+
+#define HTON_BINLOG_FLAGS \
+  (HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE)
 
 typedef struct st_thd_trans
 {

--- 1.279/sql/log.cc	2007-05-22 15:16:23 +02:00
+++ 1.280/sql/log.cc	2007-05-22 15:16:23 +02:00
@@ -1425,6 +1425,7 @@
   binlog_hton->rollback= binlog_rollback;
   binlog_hton->prepare= binlog_prepare;
   binlog_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
+  binlog_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.397/sql/sql_base.cc	2007-05-22 15:16:23 +02:00
+++ 1.398/sql/sql_base.cc	2007-05-22 15:16:23 +02:00
@@ -3585,14 +3585,91 @@
     in prelocked mode.
   */
   DBUG_ASSERT(!thd->prelocked_mode || !thd->lex->requires_prelocking());
-
   *need_reopen= FALSE;
 
-  /*
-    CREATE ... SELECT UUID() locks no tables, we have to test here.
-  */
-  if (thd->lex->is_stmt_unsafe())
-    thd->set_current_stmt_binlog_row_based_if_mixed();
+  if (mysql_bin_log.is_open() && (thd->options | OPTION_BIN_LOG))
+  {
+    /*
+      Compute the capabilities vector for the involved storage engines
+      and mask out the flags for the binary log. Right now, the binlog
+      flags only include the capabilities of the storage engines, so
+      this is safe.
+    */
+    uint32 binlog_flags= ~0UL;
+    for (table= tables; table; table= table->next_global)
+    {
+      DBUG_PRINT("info", ("table_name: %s; flags: 0x%0lx",
+                          table->table_name,
+                          (ulong) table->table->s->db_type->flags));
+      DBUG_PRINT("info", ("binlog_flags: 0x%lx", (ulong) binlog_flags));
+      binlog_flags &= table->table->s->db_type->flags;
+    }
+    binlog_flags&= HTON_BINLOG_FLAGS;
+    DBUG_PRINT("info", ("binlog_flags: 0x%0lx", (ulong) binlog_flags));
+    DBUG_PRINT("info", ("thd->variables.binlog_format: %d",
+                        thd->variables.binlog_format));
+
+    /*
+      We have three alternatives that prevent the statement from being
+      loggable:
+
+      1. If there are no capabilities left (all flags are clear) it is
+         not possible to log the statement at all, so we roll back the
+         statement and report an error.
+
+      2. Statement mode is set, but the capabilities indicate that
+         statement format is not possible.
+
+      3. Row mode is set, but the capabilities indicate that row
+         format is not possible.
+
+      4. Statement is unsafe, but the capabilities indicate that row
+         format is not possible.
+    */
+    int error= 0;
+    if (binlog_flags == 0)
+    {
+      error= ER_BINLOG_ENGINES_INCOMPATIBLE;
+    }
+    else if (thd->variables.binlog_format == BINLOG_FORMAT_STMT &&
+             (binlog_flags & HTON_BINLOG_STMT_CAPABLE) == 0)
+    {
+      error= ER_BINLOG_STMT_FORMAT_FORBIDDEN;
+    }
+    else if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW ||
+              thd->lex->is_stmt_unsafe()) &&
+             (binlog_flags & HTON_BINLOG_ROW_CAPABLE) == 0)
+    {
+      error= ER_BINLOG_ROW_FORMAT_FORBIDDEN;
+    }
+
+    DBUG_PRINT("info", ("error: %d", error));
+
+    if (error)
+    {
+      ha_rollback_stmt(thd);
+      my_error(error, MYF(0));
+      DBUG_RETURN(-1);
+    }
+
+    /*
+      We switch to row-based format if we are in mixed mode and one of
+      the following are true:
+
+      1. If the statement is unsafe
+      2. If statement format cannot be used
+
+      Observe that point to cannot be decided before the tables
+      involved in a statement has been checked, i.e., we cannot put
+      this code in reset_current_stmt_binlog_row_based(), it has to be
+      here.
+     */
+    if (thd->lex->is_stmt_unsafe() ||
+        (binlog_flags | HTON_BINLOG_STMT_CAPABLE) == 0)
+    {
+      thd->set_current_stmt_binlog_row_based_if_mixed();
+    }
+  }
 
   if (!tables && !thd->lex->requires_prelocking())
     DBUG_RETURN(0);

--- 1.155/sql/share/errmsg.txt	2007-05-22 15:16:23 +02:00
+++ 1.156/sql/share/errmsg.txt	2007-05-22 15:16:23 +02:00
@@ -6062,3 +6062,9 @@
 ER_BINLOG_UNSAFE_STATEMENT
         eng "Statement is not safe to log in statement format."
+ER_BINLOG_ENGINES_INCOMPATIBLE
+        eng "It is not possible to log anything with this combination of engines"
+ER_BINLOG_STMT_FORMAT_FORBIDDEN
+        eng "Cannot switch to statement format and only statement format is possible"
+ER_BINLOG_ROW_FORMAT_FORBIDDEN
+        eng "Cannot switch to row format and only row format is possible"

--- 1.138/storage/archive/ha_archive.cc	2007-05-22 15:16:23 +02:00
+++ 1.139/storage/archive/ha_archive.cc	2007-05-22 15:16:23 +02:00
@@ -167,6 +167,7 @@
   archive_hton->db_type= DB_TYPE_ARCHIVE_DB;
   archive_hton->create= archive_create_handler;
   archive_hton->flags= HTON_NO_FLAGS;
+  archive_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   archive_hton->discover= archive_discover;
 
   if (pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST))

--- 1.76/storage/csv/ha_tina.cc	2007-05-22 15:16:23 +02:00
+++ 1.77/storage/csv/ha_tina.cc	2007-05-22 15:16:23 +02:00
@@ -113,6 +113,7 @@
   tina_hton->create= tina_create_handler;
   tina_hton->flags= (HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES | 
                      HTON_NO_PARTITION);
+  tina_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.55/storage/example/ha_example.cc	2007-05-22 15:16:23 +02:00
+++ 1.56/storage/example/ha_example.cc	2007-05-22 15:16:23 +02:00
@@ -135,6 +135,12 @@
   example_hton->db_type= DB_TYPE_EXAMPLE_DB;
   example_hton->create=  example_create_handler;
   example_hton->flags=   HTON_CAN_RECREATE;
+  /*
+    We are saying that this engine is just row capable to have an
+    engine that can only handle row-based logging. This is used in
+    testing.
+  */
+  example_hton->flags|=  HTON_BINLOG_ROW_CAPABLE;
 
   DBUG_RETURN(0);
 }

--- 1.49/storage/blackhole/ha_blackhole.cc	2007-05-22 15:16:23 +02:00
+++ 1.50/storage/blackhole/ha_blackhole.cc	2007-05-22 15:16:23 +02:00
@@ -212,6 +212,7 @@
   blackhole_hton->db_type= DB_TYPE_BLACKHOLE_DB;
   blackhole_hton->create= blackhole_create_handler;
   blackhole_hton->flags= HTON_CAN_RECREATE;
+  blackhole_hton->flags|= HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.438/sql/ha_ndbcluster.cc	2007-05-22 15:16:23 +02:00
+++ 1.439/sql/ha_ndbcluster.cc	2007-05-22 15:16:23 +02:00
@@ -4444,7 +4444,6 @@
       DBUG_PRINT("warning", ("ops_pending != 0L"));
     m_ops_pending= 0;
   }
-  thd->set_current_stmt_binlog_row_based_if_mixed();
   DBUG_RETURN(error);
 }
 
@@ -4494,7 +4493,6 @@
   m_active_trans= trans;
   // Start of statement
   m_ops_pending= 0;    
-  thd->set_current_stmt_binlog_row_based_if_mixed();
 
   DBUG_RETURN(error);
 }
@@ -6983,6 +6981,7 @@
     ndbcluster_binlog_init_handlerton();
 #endif
     h->flags=            HTON_CAN_RECREATE | HTON_TEMPORARY_NOT_SUPPORTED;
+    h->flags=            HTON_BINLOG_ROW_CAPABLE;
     h->discover=         ndbcluster_discover;
     h->find_files= ndbcluster_find_files;
     h->table_exists_in_engine= ndbcluster_table_exists_in_engine;
@@ -8788,7 +8787,6 @@
   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
 
   /* Signal successful initialization */
   ndb_util_thread_running= 1;
--- New file ---
+++ mysql-test/r/binlog_multi_engine.result	07/05/22 15:16:07
CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
CREATE TABLE t1e (e INT, f INT) ENGINE=EXAMPLE;
Warnings:
Warning	1286	Unknown table engine 'EXAMPLE'
SET SESSION BINLOG_FORMAT=STATEMENT;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;
SET SESSION BINLOG_FORMAT=MIXED;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
ERROR HY000: Cannot switch to row format and only row format is possible
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
ERROR HY000: Cannot switch to row format and only row format is possible
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;
ERROR HY000: Cannot switch to row format and only row format is possible
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;
SHOW BINLOG EVENTS;
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	4	Format_desc	1	106	Server ver: 5.1.18-beta-debug-log, Binlog ver: 4
master-bin.000001	106	Query	1	214	use `test`; CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM
master-bin.000001	214	Query	1	325	use `test`; CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE
master-bin.000001	325	Query	1	434	use `test`; CREATE TABLE t1e (e INT, f INT) ENGINE=EXAMPLE
master-bin.000001	434	Query	1	546	use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	546	Query	1	112	use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	658	Query	1	770	use `test`; INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	770	Query	1	107	use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
master-bin.000001	877	Query	1	984	use `test`; UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f
master-bin.000001	984	Query	1	107	use `test`; UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c
master-bin.000001	1091	Query	1	1166	use `test`; TRUNCATE t1m
master-bin.000001	1166	Query	1	1241	use `test`; TRUNCATE t1b
master-bin.000001	1241	Query	1	1316	use `test`; TRUNCATE t1e
master-bin.000001	1316	Query	1	1428	use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	1428	Query	1	112	use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	1540	Query	1	1652	use `test`; INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2)
master-bin.000001	1652	Query	1	107	use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
master-bin.000001	1759	Query	1	1866	use `test`; UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f
master-bin.000001	1866	Query	1	107	use `test`; UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c
master-bin.000001	1973	Query	1	2048	use `test`; TRUNCATE t1m
master-bin.000001	2048	Query	1	2123	use `test`; TRUNCATE t1b
master-bin.000001	2123	Query	1	2198	use `test`; TRUNCATE t1e
master-bin.000001	2198	Table_map	1	2239	table_id: 23 (test.t1m)
master-bin.000001	2239	Write_rows	1	2304	table_id: 23 flags: STMT_END_F
master-bin.000001	2304	Table_map	1	2345	table_id: 25 (test.t1e)
master-bin.000001	2345	Write_rows	1	2410	table_id: 25 flags: STMT_END_F
master-bin.000001	2410	Table_map	1	2451	table_id: 23 (test.t1m)
master-bin.000001	2451	Table_map	1	2492	table_id: 25 (test.t1e)
master-bin.000001	2492	Update_rows	1	2558	table_id: 23
master-bin.000001	2558	Update_rows	1	2660	table_id: 25 flags: STMT_END_F
master-bin.000001	2660	Query	1	2735	use `test`; TRUNCATE t1m
master-bin.000001	2735	Query	1	2810	use `test`; TRUNCATE t1b
master-bin.000001	2810	Query	1	2885	use `test`; TRUNCATE t1e
DROP TABLE t1m, t1b, t1e;

--- New file ---
+++ mysql-test/t/binlog_multi_engine.test	07/05/22 15:16:07
source include/have_blackhole.inc;

CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM;
CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE;
CREATE TABLE t1e (e INT, f INT) ENGINE=EXAMPLE;

SET SESSION BINLOG_FORMAT=STATEMENT;

INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);

UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;

TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;

SET SESSION BINLOG_FORMAT=MIXED;

INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);

UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;

TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;

SET SESSION BINLOG_FORMAT=ROW;

INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
error ER_BINLOG_ROW_FORMAT_FORBIDDEN;
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1e VALUES (1,1), (1,2), (2,1), (2,2);

error ER_BINLOG_ROW_FORMAT_FORBIDDEN;
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1e SET m = 2, e = 3 WHERE n = f;
error ER_BINLOG_ROW_FORMAT_FORBIDDEN;
UPDATE t1e, t1b SET e = 2, b = 3 WHERE f = c;

TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1e;

SHOW BINLOG EVENTS;

DROP TABLE t1m, t1b, t1e;


--- 1.88/sql/ha_partition.cc	2007-05-22 15:16:23 +02:00
+++ 1.89/sql/ha_partition.cc	2007-05-22 15:16:23 +02:00
@@ -87,7 +87,12 @@
   partition_hton->partition_flags= partition_flags;
   partition_hton->alter_table_flags= alter_table_flags;
   partition_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN;
-
+  /*
+    !!! Need to get the flags from the underlying engine.  This might
+    !!! mean that we need to make the HTON flags into table flags,
+    !!! since they are dependent on the db_type of the underlying engine.
+  */
+  partition_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
   return 0;
 }
 

--- 1.99/storage/federated/ha_federated.cc	2007-05-22 15:16:23 +02:00
+++ 1.100/storage/federated/ha_federated.cc	2007-05-22 15:16:23 +02:00
@@ -443,6 +443,7 @@
   federated_hton->rollback= federated_rollback;
   federated_hton->create= federated_create_handler;
   federated_hton->flags= HTON_ALTER_NOT_SUPPORTED | HTON_NO_PARTITION;
+  federated_hton->flags|= HTON_BINLOG_ROW_CAPABLE | HTON_BINLOG_STMT_CAPABLE;
 
   if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST))
     goto error;
Thread
bk commit into 5.1 tree (mats:1.2579)Mats Kindahl22 May