summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorunknown <aelkin/elkin@dsl-hkibras1-ff5fc300-23.dhcp.inet.fi>2007-10-21 18:37:37 +0300
committerunknown <aelkin/elkin@dsl-hkibras1-ff5fc300-23.dhcp.inet.fi>2007-10-21 18:37:37 +0300
commit6cfd9a4fc3d7b629d848f9be083b1bdbd2c5e45f (patch)
tree05b4f9325096aef4d92f83e75f74323d5023184d /mysql-test/r
parent69604f4db10f125651ab0620320dbd91253c5bc6 (diff)
downloadmariadb-git-6cfd9a4fc3d7b629d848f9be083b1bdbd2c5e45f.tar.gz
Bug #26199 Replication Failure on Slave when using stored procs with bit-type parameters.
The value of the actual argument of BIT-type-arg stored procedure was binlogged as non-escaped sequence of bytes corresponding to internal representation of the bit value. The patch enforces binlogging of the bit-argument as a valid literal: prefixing the quoted bytes sequence with _binary. Note, that behaviour of Item_field::var_str for field_type() of MYSQL_TYPE_BIT is exceptional in that the returned string contains the binary representation even though result_type() of the item is INT_RESULT. mysql-test/r/rpl_sp_effects.result: testing stored function and procedure called with BIT-arg. mysql-test/t/rpl_sp_effects.test: results changed sql/sp_head.cc: Treating BIT field type specially to for its value to be prefixed and quoted.
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/rpl_sp_effects.result41
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/r/rpl_sp_effects.result b/mysql-test/r/rpl_sp_effects.result
index bf8128d9385..70b2338d187 100644
--- a/mysql-test/r/rpl_sp_effects.result
+++ b/mysql-test/r/rpl_sp_effects.result
@@ -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