Commit 08b43c99 authored by unknown's avatar unknown

BUG#23051 (READ COMMITTED breaks mixed and statement-based replication):

Minor fixes to get proper detection of transaction isolation level when
inside external_lock().


mysql-test/t/disabled.def:
  Enabling innodb.test again.
mysql-test/t/innodb.test:
  Fixing some error codes. Test currently requires MIXED or ROW mode since
  READ-COMMITTED and READ-UNCOMMITTED are not safe for STATEMENT mode, i.e.,
  when the binary log is enabled.
storage/innobase/handler/ha_innodb.cc:
  Using tx_isolation since trx->isolation_level is not defined when
  inside external_lock().
parent bbb089cc
......@@ -19,7 +19,6 @@ im_instance_conf : Bug#20294 2007-05-30 alik Instance manager tests
im_life_cycle : BUG#27851 Instance manager dies on ASSERT in ~Thread_registry() or from not being able to close a mysqld instance.
im_instance_conf : BUG#28743 Instance manager generates warnings in test suite
im_utils : BUG#28743 Instance manager generates warnings in test suite
innodb : Disabling test case awaiting reply from Innobase
concurrent_innodb : BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
......
......@@ -15,6 +15,10 @@
-- source include/have_innodb.inc
-- source include/have_log_bin.inc
# Disabling it temporarily for statement-based logging since some
# tests are not safe while binlog is on.
-- source include/have_binlog_format_mixed_or_row.inc
#
# Small basic test with ignore
#
......@@ -775,7 +779,7 @@ CREATE TABLE `t2` (
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
reset master;
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
UPDATE t2,t1 SET t2.a=t1.a+2;
# check
select * from t2 /* must be (3,1), (4,4) */;
......@@ -787,7 +791,7 @@ delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
insert into t2 values (1,2),(3,4),(4,4);
reset master;
--error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
show master status /* there must be no UPDATE query event */;
......
......@@ -6267,16 +6267,17 @@ ha_innobase::external_lock(
if (lock_type == F_WRLCK)
{
ulong const binlog_format= thd->variables.binlog_format;
if (trx->isolation_level <= TRX_ISO_READ_COMMITTED &&
ulong const tx_isolation = thd_tx_isolation(current_thd);
if (tx_isolation <= ISO_READ_COMMITTED &&
binlog_format == BINLOG_FORMAT_STMT)
{
char buf[256];
bool const read_uncommitted =
trx->isolation_level == TRX_ISO_READ_UNCOMMITTED;
my_snprintf(buf, sizeof(buf),
"Transaction level 'READ %sCOMMITTED' in"
"Transaction level '%s' in"
" InnoDB is not safe for binlog mode '%s'",
read_uncommitted ? "UN" : "",
tx_isolation_names[tx_isolation],
binlog_format_names[binlog_format]);
my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
return HA_ERR_LOGGING_IMPOSSIBLE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment