summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorunknown <mats@kindahl-laptop.dnsalias.net>2007-06-12 22:02:46 +0200
committerunknown <mats@kindahl-laptop.dnsalias.net>2007-06-12 22:02:46 +0200
commit492ebf924b40ac847201fa6dc3cb44731dbac210 (patch)
treee252590c0287c7b25e8b7d291290be7d7a77d932 /storage
parente319a0493461000f9eeabceed7f2c5d57cfc44cd (diff)
parentccbada0864161294ca351b2a9b6cfac5d4ce6153 (diff)
downloadmariadb-git-492ebf924b40ac847201fa6dc3cb44731dbac210.tar.gz
Merge kindahl-laptop.dnsalias.net:/home/bkroot/mysql-5.1-rpl
into kindahl-laptop.dnsalias.net:/home/bk/b23051-mysql-5.1-rpl BitKeeper/deleted/.del-binlog_row_blackhole.result: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/share/errmsg.txt: Auto merged storage/blackhole/ha_blackhole.h: Auto merged storage/innobase/handler/ha_innodb.cc: Auto merged storage/innobase/handler/ha_innodb.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged mysql-test/t/partition_hash.test: Manual merge sql/handler.h: Manual merge sql/set_var.cc: Manual merge sql/sql_class.h: Manual merge sql/sql_insert.cc: Manual merge sql/sql_parse.cc: Manual merge
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.h1
-rw-r--r--storage/blackhole/ha_blackhole.h1
-rw-r--r--storage/csv/ha_tina.h3
-rw-r--r--storage/example/ha_example.h7
-rw-r--r--storage/federated/ha_federated.h1
-rw-r--r--storage/heap/ha_heap.h1
-rw-r--r--storage/innobase/handler/ha_innodb.cc40
-rw-r--r--storage/innobase/handler/ha_innodb.h4
-rw-r--r--storage/myisam/ha_myisam.cc1
-rw-r--r--storage/myisammrg/ha_myisammrg.h1
10 files changed, 56 insertions, 4 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 1fd4df7ea78..034dbea789f 100644
--- a/storage/blackhole/ha_blackhole.h
+++ b/storage/blackhole/ha_blackhole.h
@@ -53,6 +53,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/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 30226fc6eb9..816df97ef8c 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -958,6 +958,7 @@ ha_innobase::ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
HA_CAN_SQL_HANDLER |
HA_PRIMARY_KEY_REQUIRED_FOR_POSITION |
HA_PRIMARY_KEY_IN_READ_INDEX |
+ HA_BINLOG_ROW_CAPABLE |
HA_CAN_GEOMETRY | HA_PARTIAL_COLUMN_READ |
HA_TABLE_SCAN_ON_INDEX),
start_of_scan(0),
@@ -2268,6 +2269,45 @@ ha_innobase::get_row_type() const
return(ROW_TYPE_NOT_USED);
}
+
+
+/********************************************************************
+Get the table flags to use for the statement. */
+handler::Table_flags
+ha_innobase::table_flags() const
+{
+ THD *const thd= current_thd;
+ /* We are using thd->variables.tx_isolation here instead of
+ trx->isolation_level since store_lock() has not been called
+ yet.
+
+ The trx->isolation_level is set inside store_lock() (which
+ is called from mysql_lock_tables()) until after this
+ function has been called (which is called in lock_tables()
+ before that function calls mysql_lock_tables()). */
+ ulong const tx_isolation= thd->variables.tx_isolation;
+ if (tx_isolation <= ISO_READ_COMMITTED)
+ {
+ ulong const binlog_format= thd->variables.binlog_format;
+ /* Statement based binlogging does not work in these
+ isolation levels since the necessary locks cannot
+ be taken */
+ if (binlog_format == BINLOG_FORMAT_STMT)
+ {
+ char buf[256];
+ my_snprintf(buf, sizeof(buf),
+ "Transaction level '%s' in InnoDB is"
+ " not safe for binlog mode '%s'",
+ tx_isolation_names[tx_isolation],
+ binlog_format_names[binlog_format]);
+ my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
+ }
+ return int_table_flags;
+ }
+
+ return int_table_flags | HA_BINLOG_STMT_CAPABLE;
+}
+
/********************************************************************
Gives the file extension of an InnoDB single-table tablespace. */
static const char* ha_innobase_exts[] = {
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index 90fc7727044..72e3c937423 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -54,7 +54,7 @@ class ha_innobase: public handler
ulong upd_and_key_val_buff_len;
/* the length of each of the previous
two buffers */
- ulong int_table_flags;
+ Table_flags int_table_flags;
uint primary_key;
ulong start_of_scan; /* this is set to 1 when we are
starting a table scan but have not
@@ -84,7 +84,7 @@ class ha_innobase: public handler
const char* table_type() const { return("InnoDB");}
const char *index_type(uint key_number) { return "BTREE"; }
const char** bas_ext() const;
- ulonglong table_flags() const { return int_table_flags; }
+ Table_flags table_flags() const;
ulong index_flags(uint idx, uint part, bool all_parts) const
{
return (HA_READ_NEXT |
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 56e428b1bc1..047e2363f1c 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);