summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorunknown <mats@kindahl-laptop.dnsalias.net>2007-06-12 22:14:54 +0200
committerunknown <mats@kindahl-laptop.dnsalias.net>2007-06-12 22:14:54 +0200
commit95d678f84166348a46688d6f6c4f7f59abbfc058 (patch)
tree8f3cbdbb202fc2e5f1959f002cb2721b328aa458 /storage/innobase
parentfac5ba8b4452de1830a2a5a847f6c230fc25031a (diff)
parent492ebf924b40ac847201fa6dc3cb44731dbac210 (diff)
downloadmariadb-git-95d678f84166348a46688d6f6c4f7f59abbfc058.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 sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysql_priv.h: Auto merged sql/set_var.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_parse.cc: Auto merged storage/archive/ha_archive.h: Auto merged storage/blackhole/ha_blackhole.h: Auto merged storage/csv/ha_tina.h: Auto merged storage/example/ha_example.h: Auto merged storage/federated/ha_federated.h: Auto merged storage/heap/ha_heap.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 storage/myisammrg/ha_myisammrg.h: Auto merged sql/share/errmsg.txt: SCCS merged
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/handler/ha_innodb.cc40
-rw-r--r--storage/innobase/handler/ha_innodb.h4
2 files changed, 42 insertions, 2 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 86cd7a758a9..3ec729fe3f8 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 1c864445ac0..c727243bfd3 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 |