Commit d866afe5 authored by Alfranio Correia's avatar Alfranio Correia

merge mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge

parents 6f7929b1 28286c74
...@@ -12,6 +12,149 @@ connection slave; ...@@ -12,6 +12,149 @@ connection slave;
let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`;
# TINYBLOB
let $source_type = TINYBLOB;
let $target_type = TINYBLOB;
let $source_value = 'aaa';
let $target_value = 'aaa';
let $can_convert = 1;
source extra/rpl_tests/check_type.inc;
let $source_type= TINYBLOB;
let $target_type= BLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= TINYBLOB;
let $target_type= MEDIUMBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= TINYBLOB;
let $target_type= LONGBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
# BLOB
let $source_type = BLOB;
let $target_type = TINYBLOB;
let $source_value = 'aaa';
let $target_value = 'aaa';
let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= BLOB;
let $target_type= BLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= 1;
source extra/rpl_tests/check_type.inc;
let $source_type= BLOB;
let $target_type= MEDIUMBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= BLOB;
let $target_type= LONGBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
# MEDIUMBLOB
let $source_type = MEDIUMBLOB;
let $target_type = TINYBLOB;
let $source_value = 'aaa';
let $target_value = 'aaa';
let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= MEDIUMBLOB;
let $target_type= BLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= MEDIUMBLOB;
let $target_type= MEDIUMBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= 1;
source extra/rpl_tests/check_type.inc;
let $source_type= MEDIUMBLOB;
let $target_type= LONGBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_non_lossy;
source extra/rpl_tests/check_type.inc;
# LONGBLOB
let $source_type = LONGBLOB;
let $target_type = TINYBLOB;
let $source_value = 'aaa';
let $target_value = 'aaa';
let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= LONGBLOB;
let $target_type= BLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= LONGBLOB;
let $target_type= MEDIUMBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= $if_is_lossy;
source extra/rpl_tests/check_type.inc;
let $source_type= LONGBLOB;
let $target_type= LONGBLOB;
let $source_value= 'aaa';
let $target_value= 'aaa';
let $can_convert= 1;
source extra/rpl_tests/check_type.inc;
# BUG#49836 (additional tests - GEOMETRY TYPE)
let $source_type = GEOMETRY;
let $target_type = BLOB;
let $source_value = PointFromText('POINT(10 10)');
let $target_value = PointFromText('POINT(10 10)');
let $can_convert = 0;
source extra/rpl_tests/check_type.inc;
let $source_type = BLOB;
let $target_type = GEOMETRY;
let $source_value = 'aaa';
let $target_value = 'aaa';
let $can_convert = 0;
source extra/rpl_tests/check_type.inc;
let $source_type = GEOMETRY;
let $target_type = GEOMETRY;
let $source_value = PointFromText('POINT(10 10)');
let $target_value = PointFromText('POINT(10 10)');
let $can_convert = 1;
source extra/rpl_tests/check_type.inc;
let $source_type = BIT(1); let $source_type = BIT(1);
let $target_type = BIT(1); let $target_type = BIT(1);
let $source_value = b'1'; let $source_value = b'1';
...@@ -732,6 +875,7 @@ let $target_value= b'11111'; ...@@ -732,6 +875,7 @@ let $target_value= b'11111';
let $can_convert = $if_is_lossy; let $can_convert = $if_is_lossy;
source extra/rpl_tests/check_type.inc; source extra/rpl_tests/check_type.inc;
disable_warnings; disable_warnings;
source include/reset_master_and_slave.inc; source include/reset_master_and_slave.inc;
enable_warnings; enable_warnings;
......
set @save_binlog_format= @@global.binlog_format;
create table t1 (a int) engine= myisam;
create table t2 (a int) engine= innodb;
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
SET AUTOCOMMIT=1;
# Test that the session variable 'binlog_format'
# is writable outside a transaction.
set @@session.binlog_format= statement;
SELECT @@session.binlog_format;
@@session.binlog_format
STATEMENT
begin;
# Test that the session variable 'binlog_format' is read-only
# inside a transaction with no preceding updates.
set @@session.binlog_format= mixed;
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
insert into t2 values (1);
# Test that the session variable 'binlog_format' is read-only
# inside a transaction with preceding transactional updates.
set @@session.binlog_format= row;
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
commit;
begin;
insert into t1 values (2);
# Test that the session variable 'binlog_format' is read-only
# inside a transaction with preceding non-transactional updates.
set @@session.binlog_format= statement;
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
commit;
# Test that the session variable 'binlog_format' is writable
# when AUTOCOMMIT=0, before a transaction has started.
set AUTOCOMMIT=0;
set @@session.binlog_format= row;
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
insert into t1 values (4);
# Test that the session variable 'binlog_format' is read-only inside an
# AUTOCOMMIT=0 transaction with preceding non-transactional updates.
set @@session.binlog_format= statement;
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
commit;
insert into t2 values (5);
# Test that the session variable 'binlog_format' is read-only inside an
# AUTOCOMMIT=0 transaction with preceding transactional updates.
set @@session.binlog_format= row;
ERROR HY000: Cannot modify @@session.binlog_format inside a transaction
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
commit;
begin;
insert into t2 values (6);
# Test that the global variable 'binlog_format' is writable
# inside a transaction.
SELECT @@global.binlog_format;
@@global.binlog_format
ROW
set @@global.binlog_format= statement;
SELECT @@global.binlog_format;
@@global.binlog_format
STATEMENT
commit;
set @@global.binlog_format= @save_binlog_format;
create table t3(a int, b int) engine= innodb;
create table t4(a int) engine= innodb;
create table t5(a int) engine= innodb;
create trigger tr2 after insert on t3 for each row begin
insert into t4(a) values(1);
set @@session.binlog_format= statement;
insert into t4(a) values(2);
insert into t5(a) values(3);
end |
# Test that the session variable 'binlog_format' is read-only
# in sub-statements.
insert into t3(a,b) values(1,1);
ERROR HY000: Cannot change the binary logging format inside a stored function or trigger
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
...@@ -123,7 +123,7 @@ Binlog_cache_disk_use 0 ...@@ -123,7 +123,7 @@ Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 1 Binlog_cache_use 2
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -132,7 +132,7 @@ delete from t1; ...@@ -132,7 +132,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 2 Binlog_cache_use 4
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
......
...@@ -9,7 +9,7 @@ drop table if exists t1; ...@@ -9,7 +9,7 @@ drop table if exists t1;
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 1 Binlog_cache_use 2
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -18,7 +18,7 @@ delete from t1; ...@@ -18,7 +18,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 2 Binlog_cache_use 4
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
......
...@@ -9,7 +9,7 @@ drop table if exists t1; ...@@ -9,7 +9,7 @@ drop table if exists t1;
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 1 Binlog_cache_use 2
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -18,7 +18,7 @@ delete from t1; ...@@ -18,7 +18,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 2 Binlog_cache_use 4
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
......
...@@ -9,7 +9,7 @@ drop table if exists t1; ...@@ -9,7 +9,7 @@ drop table if exists t1;
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 1 Binlog_cache_use 2
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
...@@ -18,7 +18,7 @@ delete from t1; ...@@ -18,7 +18,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 2 Binlog_cache_use 4
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
......
#
# BUG#47863
# This test verifies if the session variable 'binlog_format'
# is read-only inside a transaction and in sub-statements.
#
source include/have_innodb.inc;
source include/have_binlog_format_row.inc;
set @save_binlog_format= @@global.binlog_format;
create table t1 (a int) engine= myisam;
create table t2 (a int) engine= innodb;
SELECT @@session.binlog_format;
SET AUTOCOMMIT=1;
--echo # Test that the session variable 'binlog_format'
--echo # is writable outside a transaction.
set @@session.binlog_format= statement;
SELECT @@session.binlog_format;
begin;
--echo # Test that the session variable 'binlog_format' is read-only
--echo # inside a transaction with no preceding updates.
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
set @@session.binlog_format= mixed;
insert into t2 values (1);
--echo # Test that the session variable 'binlog_format' is read-only
--echo # inside a transaction with preceding transactional updates.
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
set @@session.binlog_format= row;
commit;
begin;
insert into t1 values (2);
--echo # Test that the session variable 'binlog_format' is read-only
--echo # inside a transaction with preceding non-transactional updates.
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
set @@session.binlog_format= statement;
commit;
--echo # Test that the session variable 'binlog_format' is writable
--echo # when AUTOCOMMIT=0, before a transaction has started.
set AUTOCOMMIT=0;
set @@session.binlog_format= row;
SELECT @@session.binlog_format;
insert into t1 values (4);
--echo # Test that the session variable 'binlog_format' is read-only inside an
--echo # AUTOCOMMIT=0 transaction with preceding non-transactional updates.
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
set @@session.binlog_format= statement;
SELECT @@session.binlog_format;
commit;
insert into t2 values (5);
--echo # Test that the session variable 'binlog_format' is read-only inside an
--echo # AUTOCOMMIT=0 transaction with preceding transactional updates.
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
set @@session.binlog_format= row;
SELECT @@session.binlog_format;
commit;
begin;
insert into t2 values (6);
--echo # Test that the global variable 'binlog_format' is writable
--echo # inside a transaction.
SELECT @@global.binlog_format;
set @@global.binlog_format= statement;
SELECT @@global.binlog_format;
commit;
set @@global.binlog_format= @save_binlog_format;
create table t3(a int, b int) engine= innodb;
create table t4(a int) engine= innodb;
create table t5(a int) engine= innodb;
delimiter |;
eval create trigger tr2 after insert on t3 for each row begin
insert into t4(a) values(1);
set @@session.binlog_format= statement;
insert into t4(a) values(2);
insert into t5(a) values(3);
end |
delimiter ;|
--echo # Test that the session variable 'binlog_format' is read-only
--echo # in sub-statements.
--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT
insert into t3(a,b) values(1,1);
SELECT @@session.binlog_format;
drop table t1;
drop table t2;
drop table t3;
drop table t4;
drop table t5;
...@@ -69,6 +69,25 @@ RESET MASTER; ...@@ -69,6 +69,25 @@ RESET MASTER;
include/start_slave.inc include/start_slave.inc
**** Result of conversions **** **** Result of conversions ****
Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
TINYBLOB TINYBLOB <Correct value>
TINYBLOB BLOB <Correct error>
TINYBLOB MEDIUMBLOB <Correct error>
TINYBLOB LONGBLOB <Correct error>
BLOB TINYBLOB <Correct error>
BLOB BLOB <Correct value>
BLOB MEDIUMBLOB <Correct error>
BLOB LONGBLOB <Correct error>
MEDIUMBLOB TINYBLOB <Correct error>
MEDIUMBLOB BLOB <Correct error>
MEDIUMBLOB MEDIUMBLOB <Correct value>
MEDIUMBLOB LONGBLOB <Correct error>
LONGBLOB TINYBLOB <Correct error>
LONGBLOB BLOB <Correct error>
LONGBLOB MEDIUMBLOB <Correct error>
LONGBLOB LONGBLOB <Correct value>
GEOMETRY BLOB <Correct error>
BLOB GEOMETRY <Correct error>
GEOMETRY GEOMETRY <Correct value>
BIT(1) BIT(1) <Correct value> BIT(1) BIT(1) <Correct value>
DATE DATE <Correct value> DATE DATE <Correct value>
ENUM('master',' ENUM('master',' <Correct value> ENUM('master',' ENUM('master',' <Correct value>
...@@ -171,6 +190,25 @@ BIT(5) BIT(6) <Correct error> ...@@ -171,6 +190,25 @@ BIT(5) BIT(6) <Correct error>
BIT(6) BIT(5) <Correct error> BIT(6) BIT(5) <Correct error>
BIT(5) BIT(12) <Correct error> BIT(5) BIT(12) <Correct error>
BIT(12) BIT(5) <Correct error> BIT(12) BIT(5) <Correct error>
TINYBLOB TINYBLOB ALL_NON_LOSSY <Correct value>
TINYBLOB BLOB ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
BLOB TINYBLOB ALL_NON_LOSSY <Correct error>
BLOB BLOB ALL_NON_LOSSY <Correct value>
BLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
BLOB LONGBLOB ALL_NON_LOSSY <Correct value>
MEDIUMBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
MEDIUMBLOB BLOB ALL_NON_LOSSY <Correct error>
MEDIUMBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct value>
MEDIUMBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
LONGBLOB TINYBLOB ALL_NON_LOSSY <Correct error>
LONGBLOB BLOB ALL_NON_LOSSY <Correct error>
LONGBLOB MEDIUMBLOB ALL_NON_LOSSY <Correct error>
LONGBLOB LONGBLOB ALL_NON_LOSSY <Correct value>
GEOMETRY BLOB ALL_NON_LOSSY <Correct error>
BLOB GEOMETRY ALL_NON_LOSSY <Correct error>
GEOMETRY GEOMETRY ALL_NON_LOSSY <Correct value>
BIT(1) BIT(1) ALL_NON_LOSSY <Correct value> BIT(1) BIT(1) ALL_NON_LOSSY <Correct value>
DATE DATE ALL_NON_LOSSY <Correct value> DATE DATE ALL_NON_LOSSY <Correct value>
ENUM('master',' ENUM('master',' ALL_NON_LOSSY <Correct value> ENUM('master',' ENUM('master',' ALL_NON_LOSSY <Correct value>
...@@ -273,6 +311,25 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value> ...@@ -273,6 +311,25 @@ BIT(5) BIT(6) ALL_NON_LOSSY <Correct value>
BIT(6) BIT(5) ALL_NON_LOSSY <Correct error> BIT(6) BIT(5) ALL_NON_LOSSY <Correct error>
BIT(5) BIT(12) ALL_NON_LOSSY <Correct value> BIT(5) BIT(12) ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_NON_LOSSY <Correct error> BIT(12) BIT(5) ALL_NON_LOSSY <Correct error>
TINYBLOB TINYBLOB ALL_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY <Correct error>
TINYBLOB MEDIUMBLOB ALL_LOSSY <Correct error>
TINYBLOB LONGBLOB ALL_LOSSY <Correct error>
BLOB TINYBLOB ALL_LOSSY <Correct value>
BLOB BLOB ALL_LOSSY <Correct value>
BLOB MEDIUMBLOB ALL_LOSSY <Correct error>
BLOB LONGBLOB ALL_LOSSY <Correct error>
MEDIUMBLOB TINYBLOB ALL_LOSSY <Correct value>
MEDIUMBLOB BLOB ALL_LOSSY <Correct value>
MEDIUMBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
MEDIUMBLOB LONGBLOB ALL_LOSSY <Correct error>
LONGBLOB TINYBLOB ALL_LOSSY <Correct value>
LONGBLOB BLOB ALL_LOSSY <Correct value>
LONGBLOB MEDIUMBLOB ALL_LOSSY <Correct value>
LONGBLOB LONGBLOB ALL_LOSSY <Correct value>
GEOMETRY BLOB ALL_LOSSY <Correct error>
BLOB GEOMETRY ALL_LOSSY <Correct error>
GEOMETRY GEOMETRY ALL_LOSSY <Correct value>
BIT(1) BIT(1) ALL_LOSSY <Correct value> BIT(1) BIT(1) ALL_LOSSY <Correct value>
DATE DATE ALL_LOSSY <Correct value> DATE DATE ALL_LOSSY <Correct value>
ENUM('master',' ENUM('master',' ALL_LOSSY <Correct value> ENUM('master',' ENUM('master',' ALL_LOSSY <Correct value>
...@@ -375,6 +432,25 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error> ...@@ -375,6 +432,25 @@ BIT(5) BIT(6) ALL_LOSSY <Correct error>
BIT(6) BIT(5) ALL_LOSSY <Correct value> BIT(6) BIT(5) ALL_LOSSY <Correct value>
BIT(5) BIT(12) ALL_LOSSY <Correct error> BIT(5) BIT(12) ALL_LOSSY <Correct error>
BIT(12) BIT(5) ALL_LOSSY <Correct value> BIT(12) BIT(5) ALL_LOSSY <Correct value>
TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
MEDIUMBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
MEDIUMBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
MEDIUMBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
MEDIUMBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
LONGBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY <Correct value>
GEOMETRY BLOB ALL_LOSSY,ALL_NON_LOSSY <Correct error>
BLOB GEOMETRY ALL_LOSSY,ALL_NON_LOSSY <Correct error>
GEOMETRY GEOMETRY ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY <Correct value> BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
DATE DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value> DATE DATE ALL_LOSSY,ALL_NON_LOSSY <Correct value>
ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct value> ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY <Correct value>
......
...@@ -6191,7 +6191,8 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid) ...@@ -6191,7 +6191,8 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid)
We always commit the entire transaction when writing an XID. Also We always commit the entire transaction when writing an XID. Also
note that the return value is inverted. note that the return value is inverted.
*/ */
DBUG_RETURN(!binlog_flush_trx_cache(thd, cache_mngr, &xle)); DBUG_RETURN(!binlog_flush_stmt_cache(thd, cache_mngr) &&
!binlog_flush_trx_cache(thd, cache_mngr, &xle));
} }
void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid) void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
......
...@@ -590,6 +590,13 @@ can_convert_field_to(Field *field, ...@@ -590,6 +590,13 @@ can_convert_field_to(Field *field,
*/ */
if (field->real_type() == source_type) if (field->real_type() == source_type)
{ {
if (metadata == 0) // Metadata can only be zero if no metadata was provided
{
DBUG_PRINT("debug", ("Base types are identical, but there is no metadata"));
*order_var= 0;
DBUG_RETURN(true);
}
DBUG_PRINT("debug", ("Base types are identical, doing field size comparison")); DBUG_PRINT("debug", ("Base types are identical, doing field size comparison"));
if (field->compatible_field_size(metadata, rli, mflags, order_var)) if (field->compatible_field_size(metadata, rli, mflags, order_var))
DBUG_RETURN(is_conversion_ok(*order_var, rli)); DBUG_RETURN(is_conversion_ok(*order_var, rli));
...@@ -816,7 +823,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, ...@@ -816,7 +823,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli,
rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED, rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED,
ER(ER_SLAVE_CONVERSION_FAILED), ER(ER_SLAVE_CONVERSION_FAILED),
col, db_name, tbl_name, col, db_name, tbl_name,
source_type.c_ptr(), target_type.c_ptr()); source_type.c_ptr_safe(), target_type.c_ptr_safe());
return false; return false;
} }
} }
...@@ -920,7 +927,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * ...@@ -920,7 +927,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *
field_def->init_for_tmp_table(type(col), field_def->init_for_tmp_table(type(col),
max_length, max_length,
decimals, decimals,
maybe_null(col), // maybe_null TRUE, // maybe_null
FALSE, // unsigned_flag FALSE, // unsigned_flag
pack_length); pack_length);
field_def->charset= target_table->field[col]->charset(); field_def->charset= target_table->field[col]->charset();
...@@ -977,6 +984,7 @@ table_def::table_def(unsigned char *types, ulong size, ...@@ -977,6 +984,7 @@ table_def::table_def(unsigned char *types, ulong size,
case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_DOUBLE:
case MYSQL_TYPE_FLOAT: case MYSQL_TYPE_FLOAT:
case MYSQL_TYPE_GEOMETRY:
{ {
/* /*
These types store a single byte. These types store a single byte.
......
...@@ -1315,6 +1315,14 @@ void fix_slave_exec_mode(enum_var_type type) ...@@ -1315,6 +1315,14 @@ void fix_slave_exec_mode(enum_var_type type)
bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) {
/*
Make the session variable 'binlog_format' read-only inside a transaction.
*/
if (thd->active_transaction() && (var->type == OPT_SESSION))
{
my_error(ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0));
return 1;
}
/* /*
All variables that affect writing to binary log (either format or All variables that affect writing to binary log (either format or
turning logging on and off) use the same checking. We call the turning logging on and off) use the same checking. We call the
......
...@@ -6299,3 +6299,6 @@ ER_SLAVE_CONVERSION_FAILED ...@@ -6299,3 +6299,6 @@ ER_SLAVE_CONVERSION_FAILED
eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'" eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'"
ER_SLAVE_CANT_CREATE_CONVERSION ER_SLAVE_CANT_CREATE_CONVERSION
eng "Can't create conversion table for table '%-.192s.%-.192s'" eng "Can't create conversion table for table '%-.192s.%-.192s'"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
eng "Cannot modify @@session.binlog_format inside a transaction"
...@@ -6299,3 +6299,5 @@ ER_SLAVE_CONVERSION_FAILED ...@@ -6299,3 +6299,5 @@ ER_SLAVE_CONVERSION_FAILED
eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'" eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'"
ER_SLAVE_CANT_CREATE_CONVERSION ER_SLAVE_CANT_CREATE_CONVERSION
eng "Can't create conversion table for table '%-.192s.%-.192s'" eng "Can't create conversion table for table '%-.192s.%-.192s'"
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
eng "Cannot modify @@session.binlog_format inside a transaction"
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