From 88b3697d1bf2fcdd93c42a8673b4113daf1f1af4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 12 Apr 2010 16:23:51 -0700 Subject: [PATCH] MBug#524625: OQGraph error with binary logging enabled Set the correct engine flags for OQGraph to get binlogging working. --- mysql-test/suite/oqgraph/r/binlog.result | 18 ++++++++++++ mysql-test/suite/oqgraph/t/binlog.test | 28 +++++++++++++++++++ .../oqgraph/t/{basic-master.opt => suite.opt} | 0 storage/oqgraph/ha_oqgraph.cc | 3 +- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 mysql-test/suite/oqgraph/r/binlog.result create mode 100644 mysql-test/suite/oqgraph/t/binlog.test rename mysql-test/suite/oqgraph/t/{basic-master.opt => suite.opt} (100%) diff --git a/mysql-test/suite/oqgraph/r/binlog.result b/mysql-test/suite/oqgraph/r/binlog.result new file mode 100644 index 00000000000..ee0a8c081f4 --- /dev/null +++ b/mysql-test/suite/oqgraph/r/binlog.result @@ -0,0 +1,18 @@ +drop table if exists graph; +CREATE TABLE graph ( +latch SMALLINT UNSIGNED NULL, +origid BIGINT UNSIGNED NULL, +destid BIGINT UNSIGNED NULL, +weight DOUBLE NULL, +seq BIGINT UNSIGNED NULL, +linkid BIGINT UNSIGNED NULL, +KEY (latch, origid, destid) USING HASH, +KEY (latch, destid, origid) USING HASH +) ENGINE=OQGRAPH; +SET binlog_format = row; +insert into graph(origid, destid) values (1,3), (3,1); +SET binlog_format = statement; +insert into graph(origid, destid) values (3,4), (4,3); +SET binlog_format = mixed; +insert into graph(origid, destid) values (3,5), (5,3); +drop table graph; diff --git a/mysql-test/suite/oqgraph/t/binlog.test b/mysql-test/suite/oqgraph/t/binlog.test new file mode 100644 index 00000000000..ac7c8867533 --- /dev/null +++ b/mysql-test/suite/oqgraph/t/binlog.test @@ -0,0 +1,28 @@ +-- source suite/oqgraph/include/have_oqgraph_engine.inc +-- source include/have_log_bin.inc + +--disable_warnings +drop table if exists graph; +--enable_warnings + +CREATE TABLE graph ( + latch SMALLINT UNSIGNED NULL, + origid BIGINT UNSIGNED NULL, + destid BIGINT UNSIGNED NULL, + weight DOUBLE NULL, + seq BIGINT UNSIGNED NULL, + linkid BIGINT UNSIGNED NULL, + KEY (latch, origid, destid) USING HASH, + KEY (latch, destid, origid) USING HASH + ) ENGINE=OQGRAPH; + +# MBug#524625: OQGraph error with binary logging enabled +# Test that OQGraph works with different binlogging modes. +SET binlog_format = row; +insert into graph(origid, destid) values (1,3), (3,1); +SET binlog_format = statement; +insert into graph(origid, destid) values (3,4), (4,3); +SET binlog_format = mixed; +insert into graph(origid, destid) values (3,5), (5,3); + +drop table graph; diff --git a/mysql-test/suite/oqgraph/t/basic-master.opt b/mysql-test/suite/oqgraph/t/suite.opt similarity index 100% rename from mysql-test/suite/oqgraph/t/basic-master.opt rename to mysql-test/suite/oqgraph/t/suite.opt diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc index 0b7fe293e84..e0c66134858 100644 --- a/storage/oqgraph/ha_oqgraph.cc +++ b/storage/oqgraph/ha_oqgraph.cc @@ -357,7 +357,8 @@ ulong ha_oqgraph::table_flags() const #endif { return (HA_NO_BLOBS | HA_NULL_IN_KEY | - HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED); + HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | + HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE); } ulong ha_oqgraph::index_flags(uint inx, uint part, bool all_parts) const