===== mysql-test/r/type_blob.result 1.56 vs edited ===== --- 1.56/mysql-test/r/type_blob.result 2007-11-19 12:34:12 -05:00 +++ edited/mysql-test/r/type_blob.result 2008-02-26 14:30:26 -05:00 @@ -821,4 +821,22 @@ LENGTH(c) CHAR_LENGTH(c) 65535 65535 65535 65535 DROP TABLE t; +DROP DATABASE IF EXISTS dbbug33048; +CREATE DATABASE dbbug33048; +use dbbug33048; +CREATE TABLE binfile (i int auto_increment primary key, bin_data LONGBLOB); +set global max_allowed_packet=50*1000*1000; +FLUSH LOGS; +INSERT InTO binfile (bin_data) values (' +'); +SELECT 'good, have failing data' as descr, i FROM binfile where bin_data = concat(char(13), char(10)); +descr i +good, have failing data 1 +SELECT bin_data INTO dumpfile 'bug33048-dump1' FROM binfile; +FLUSH LOGS; +DELETE FROM binfile; +SELECT bin_data INTO dumpfile 'bug33048-dump2' FROM binfile; +DROP TABLE binfile; +use test; +DROP DATABASE dbbug33048; End of 5.0 tests ===== mysql-test/t/type_blob.test 1.35 vs edited ===== --- 1.35/mysql-test/t/type_blob.test 2007-11-19 12:34:12 -05:00 +++ edited/mysql-test/t/type_blob.test 2008-02-26 14:30:36 -05:00 @@ -447,4 +447,41 @@ INSERT INTO t (c) VALUES (REPEAT('3',655 SELECT LENGTH(c), CHAR_LENGTH(c) FROM t; DROP TABLE t; +# +# Bug#33048: Not able to recover binary/blob data correctly using mysqlbinlog +# +--disable_warnings +DROP DATABASE IF EXISTS dbbug33048; +--enable_warnings +CREATE DATABASE dbbug33048; +#copy_file ../sql/mysqld $MYSQLTEST_VARDIR/master-data/lots_of_bits; + +use dbbug33048; +CREATE TABLE binfile (i int auto_increment primary key, bin_data LONGBLOB); +set global max_allowed_packet=50*1000*1000; + +FLUSH LOGS; +let $crlf=`select x'0d0a'`; +eval INSERT InTO binfile (bin_data) values ('$crlf'); + +SELECT 'good, have failing data' as descr, i FROM binfile where bin_data = concat(char(13), char(10)); + +SELECT bin_data INTO dumpfile 'bug33048-dump1' FROM binfile; +FLUSH LOGS; +DELETE FROM binfile; + +exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --database=dbbug33048 $MYSQLTEST_VARDIR/log/master-bin.000002 |$MYSQL dbbug33048; + +SELECT bin_data INTO dumpfile 'bug33048-dump2' FROM binfile; + +diff_files $MYSQLTEST_VARDIR/master-data/dbbug33048/bug33048-dump1 $MYSQLTEST_VARDIR/master-data/dbbug33048/bug33048-dump2; + +remove_file $MYSQLTEST_VARDIR/master-data/dbbug33048/bug33048-dump1; +remove_file $MYSQLTEST_VARDIR/master-data/dbbug33048/bug33048-dump2; + +DROP TABLE binfile; +use test; +DROP DATABASE dbbug33048; + +## --echo End of 5.0 tests