diff options
author | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-05-28 12:50:29 +0200 |
---|---|---|
committer | unknown <mats@kindahl-laptop.dnsalias.net> | 2007-05-28 12:50:29 +0200 |
commit | 098e15c164853fd1ba0a3f549d7a82eaa14c2816 (patch) | |
tree | 5f33520a3ea4809926952b015e31af3977e1e805 /storage | |
parent | 499a8ecd21c2542c08e273faabfffa94ebec1cfa (diff) | |
download | mariadb-git-098e15c164853fd1ba0a3f549d7a82eaa14c2816.tar.gz |
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.
Adding check that binlog flags are only used for real tables that are
opened for writing.
BitKeeper/deleted/.del-binlog_row_blackhole.result:
Rename: mysql-test/r/binlog_row_blackhole.result -> BitKeeper/deleted/.del-binlog_row_blackhole.result
BitKeeper/deleted/.del-binlog_row_blackhole.test:
Rename: mysql-test/t/binlog_row_blackhole.test -> BitKeeper/deleted/.del-binlog_row_blackhole.test
mysql-test/t/partition_hash.test:
Adding error check for statement that might fail.
sql/ha_ndbcluster.cc:
Removing statements that switch to row-based format.
Adding row capabilities.
sql/handler.h:
Adding handler/table flags to indicate that the engine is row- and/or
statement-logging capable.
Adding typedef for table_flags type.
sql/set_var.cc:
Removing code that prevents changing binlog format when NDB is active.
sql/share/errmsg.txt:
Adding error messages for when row- and/or statement-based logging
formats cannot be used.
sql/sql_base.cc:
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 needed.
---
Binlog flags should only be checked for real tables that are opened for
writing. Adding code to check that.
storage/archive/ha_archive.h:
Adding row- and statement-logging capabilities to engine.
storage/blackhole/ha_blackhole.h:
Blackhole can handle statement-format only.
storage/csv/ha_tina.h:
Adding row- and statement-logging capabilities to engine.
storage/example/ha_example.h:
For the example engine, we arbitrarily decided that it only can handle
row format.
storage/federated/ha_federated.h:
Adding row- and statement-logging capabilities to engine.
storage/heap/ha_heap.h:
Heap can handle both row- and statement-based logging format.
storage/myisam/ha_myisam.cc:
MyISAM can handle both row- and statement-based logging format.
storage/myisammrg/ha_myisammrg.h:
MyISAM can handle both row- and statement-based logging format.
mysql-test/r/binlog_multi_engine.result:
New BitKeeper file ``mysql-test/r/binlog_multi_engine.result''
mysql-test/t/binlog_multi_engine.test:
New BitKeeper file ``mysql-test/t/binlog_multi_engine.test''
Diffstat (limited to 'storage')
-rw-r--r-- | storage/archive/ha_archive.h | 1 | ||||
-rw-r--r-- | storage/blackhole/ha_blackhole.h | 1 | ||||
-rw-r--r-- | storage/csv/ha_tina.h | 3 | ||||
-rw-r--r-- | storage/example/ha_example.h | 7 | ||||
-rw-r--r-- | storage/federated/ha_federated.h | 1 | ||||
-rw-r--r-- | storage/heap/ha_heap.h | 1 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 1 | ||||
-rw-r--r-- | storage/myisammrg/ha_myisammrg.h | 1 |
8 files changed, 14 insertions, 2 deletions
diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 8fc54f6715f..b2ee9221bdd 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -87,6 +87,7 @@ public: ulonglong table_flags() const { return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_BIT_FIELD | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_FILE_BASED | HA_CAN_INSERT_DELAYED | HA_CAN_GEOMETRY); } ulong index_flags(uint idx, uint part, bool all_parts) const diff --git a/storage/blackhole/ha_blackhole.h b/storage/blackhole/ha_blackhole.h index 2af12b33077..bb12c9e04fd 100644 --- a/storage/blackhole/ha_blackhole.h +++ b/storage/blackhole/ha_blackhole.h @@ -42,6 +42,7 @@ public: ulonglong table_flags() const { return(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | + HA_BINLOG_STMT_CAPABLE | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_CAN_INSERT_DELAYED); } diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index c096f21fca2..5d2d05b72c0 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -99,7 +99,8 @@ public: const char **bas_ext() const; ulonglong table_flags() const { - return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT); + return (HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE); } ulong index_flags(uint idx, uint part, bool all_parts) const { diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index 9777a478209..97ecfb97536 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -82,7 +82,12 @@ public: */ ulonglong table_flags() const { - return 0; + /* + 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. + */ + return HA_BINLOG_ROW_CAPABLE; } /** @brief diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 4d2eefdd986..a6626b2e33e 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -128,6 +128,7 @@ public: /* fix server to be able to get remote server table flags */ return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); } diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index a2d531fc515..476efc83666 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -48,6 +48,7 @@ public: ulonglong table_flags() const { return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | HA_NO_TRANSACTIONS | HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT); } diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index d31f5b7e792..61303aaf0ae 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -474,6 +474,7 @@ void mi_check_print_warning(MI_CHECK *param, const char *fmt,...) ha_myisam::ha_myisam(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0), int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | HA_NO_TRANSACTIONS | HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 7bbe659d4b7..bb22ed13982 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -35,6 +35,7 @@ class ha_myisammrg: public handler ulonglong table_flags() const { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED | HA_ANY_INDEX_MAY_BE_UNIQUE | HA_CAN_BIT_FIELD | HA_NO_COPY_ON_ALTER); |