Loading mysql-test/r/rpl_sp_effects.result +41 −0 Original line number Diff line number Diff line Loading @@ -213,3 +213,44 @@ drop table t1; drop function f1; drop function f2; drop procedure p1; create table t2 (b BIT(7)); create procedure sp_bug26199(bitvalue BIT(7)) begin insert into t2 set b = bitvalue; end // create function sf_bug26199(b BIT(7)) returns int begin insert into t2 values(b); return 0; end// call sp_bug26199(b'1110'); call sp_bug26199('\0'); select sf_bug26199(b'1111111'); sf_bug26199(b'1111111') 0 select sf_bug26199(b'101111111'); sf_bug26199(b'101111111') 0 Warnings: Warning 1264 Out of range value adjusted for column 'b' at row 1 select sf_bug26199('\''); sf_bug26199('\'') 0 select hex(b) from t2; hex(b) E 0 7F 7F 27 select hex(b) from t2; hex(b) E 0 7F 7F 27 drop table t2; drop procedure sp_bug26199; drop function sf_bug26199; end of the tests mysql-test/t/rpl_sp_effects.test +51 −0 Original line number Diff line number Diff line Loading @@ -195,9 +195,60 @@ sync_slave_with_master; connection slave; select 'slave', a from t1; # # cleanup # connection master; drop table t1; drop function f1; drop function f2; drop procedure p1; sync_slave_with_master; # # bug#26199 Replication Failure on Slave when using stored procs # with bit-type parameters connection master; create table t2 (b BIT(7)); delimiter //; create procedure sp_bug26199(bitvalue BIT(7)) begin insert into t2 set b = bitvalue; end // create function sf_bug26199(b BIT(7)) returns int begin insert into t2 values(b); return 0; end// DELIMITER ;// call sp_bug26199(b'1110'); call sp_bug26199('\0'); select sf_bug26199(b'1111111'); select sf_bug26199(b'101111111'); select sf_bug26199('\''); select hex(b) from t2; sync_slave_with_master; #connection slave; select hex(b) from t2; # # cleanup bug#26199 # connection master; drop table t2; drop procedure sp_bug26199; drop function sf_bug26199; sync_slave_with_master; --echo end of the tests sql/sp_head.cc +3 −2 Original line number Diff line number Diff line Loading @@ -100,8 +100,9 @@ sp_get_item_value(THD *thd, Item *item, String *str) case REAL_RESULT: case INT_RESULT: case DECIMAL_RESULT: if (item->field_type() != MYSQL_TYPE_BIT) return item->val_str(str); else {/* Bit type is handled as binary string */} case STRING_RESULT: { String *result= item->val_str(str); Loading Loading
mysql-test/r/rpl_sp_effects.result +41 −0 Original line number Diff line number Diff line Loading @@ -213,3 +213,44 @@ drop table t1; drop function f1; drop function f2; drop procedure p1; create table t2 (b BIT(7)); create procedure sp_bug26199(bitvalue BIT(7)) begin insert into t2 set b = bitvalue; end // create function sf_bug26199(b BIT(7)) returns int begin insert into t2 values(b); return 0; end// call sp_bug26199(b'1110'); call sp_bug26199('\0'); select sf_bug26199(b'1111111'); sf_bug26199(b'1111111') 0 select sf_bug26199(b'101111111'); sf_bug26199(b'101111111') 0 Warnings: Warning 1264 Out of range value adjusted for column 'b' at row 1 select sf_bug26199('\''); sf_bug26199('\'') 0 select hex(b) from t2; hex(b) E 0 7F 7F 27 select hex(b) from t2; hex(b) E 0 7F 7F 27 drop table t2; drop procedure sp_bug26199; drop function sf_bug26199; end of the tests
mysql-test/t/rpl_sp_effects.test +51 −0 Original line number Diff line number Diff line Loading @@ -195,9 +195,60 @@ sync_slave_with_master; connection slave; select 'slave', a from t1; # # cleanup # connection master; drop table t1; drop function f1; drop function f2; drop procedure p1; sync_slave_with_master; # # bug#26199 Replication Failure on Slave when using stored procs # with bit-type parameters connection master; create table t2 (b BIT(7)); delimiter //; create procedure sp_bug26199(bitvalue BIT(7)) begin insert into t2 set b = bitvalue; end // create function sf_bug26199(b BIT(7)) returns int begin insert into t2 values(b); return 0; end// DELIMITER ;// call sp_bug26199(b'1110'); call sp_bug26199('\0'); select sf_bug26199(b'1111111'); select sf_bug26199(b'101111111'); select sf_bug26199('\''); select hex(b) from t2; sync_slave_with_master; #connection slave; select hex(b) from t2; # # cleanup bug#26199 # connection master; drop table t2; drop procedure sp_bug26199; drop function sf_bug26199; sync_slave_with_master; --echo end of the tests
sql/sp_head.cc +3 −2 Original line number Diff line number Diff line Loading @@ -100,8 +100,9 @@ sp_get_item_value(THD *thd, Item *item, String *str) case REAL_RESULT: case INT_RESULT: case DECIMAL_RESULT: if (item->field_type() != MYSQL_TYPE_BIT) return item->val_str(str); else {/* Bit type is handled as binary string */} case STRING_RESULT: { String *result= item->val_str(str); Loading