1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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''
This commit is contained in:
unknown
2007-05-28 12:50:29 +02:00
parent 499a8ecd21
commit 098e15c164
18 changed files with 271 additions and 188 deletions

View File

@@ -117,6 +117,18 @@
#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)
/*
Engine is capable of row-format and statement-format logging,
respectively
*/
#define HA_BINLOG_ROW_CAPABLE (LL(1) << 34)
#define HA_BINLOG_STMT_CAPABLE (LL(1) << 35)
/*
Set of all binlog flags. Currently only contain the capabilities
flags.
*/
#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
/* bits in index_flags(index_number) for what you can do with index */
#define HA_READ_NEXT 1 /* TODO really use this flag */
@@ -687,7 +699,7 @@ struct handlerton
};
/* 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
@@ -889,10 +901,13 @@ class handler :public Sql_alloc
{
friend class ha_partition;
public:
typedef ulonglong Table_flags;
protected:
struct st_table_share *table_share; /* The table definition */
struct st_table *table; /* The current open table */
ulonglong cached_table_flags; /* Set on init() and open() */
Table_flags cached_table_flags; /* Set on init() and open() */
virtual int index_init(uint idx, bool sorted) { active_index=idx; return 0; }
virtual int index_end() { active_index=MAX_KEY; return 0; }
@@ -905,7 +920,7 @@ class handler :public Sql_alloc
*/
virtual int rnd_init(bool scan) =0;
virtual int rnd_end() { return 0; }
virtual ulonglong table_flags(void) const =0;
virtual Table_flags table_flags(void) const =0;
void ha_statistic_increment(ulong SSV::*offset) const;
ha_rows estimation_rows_to_insert;
@@ -1115,7 +1130,7 @@ public:
{
return inited == INDEX ? ha_index_end() : inited == RND ? ha_rnd_end() : 0;
}
longlong ha_table_flags() { return cached_table_flags; }
Table_flags ha_table_flags() const { return cached_table_flags; }
/*
Signal that the table->read_set and table->write_set table maps changed