1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Added a test case for Bug#18038 MySQL server corrupts binary columns data

This commit is contained in:
unknown
2006-03-15 09:40:30 +02:00
parent d4df3f23ea
commit 8ba02d7270
2 changed files with 38 additions and 0 deletions

View File

@ -621,3 +621,23 @@ create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
CREATE TABLE t1 (s CHAR(8) BINARY);
INSERT INTO t1 VALUES ('test');
SELECT LENGTH(s) FROM t1;
LENGTH(s)
4
ALTER TABLE t1 MODIFY s CHAR(10) BINARY;
SELECT LENGTH(s) FROM t1;
LENGTH(s)
4
DROP TABLE t1;
CREATE TABLE t1 (s BINARY(8));
INSERT INTO t1 VALUES ('test');
SELECT LENGTH(s) FROM t1;
LENGTH(s)
8
ALTER TABLE t1 MODIFY s BINARY(10);
SELECT LENGTH(s) FROM t1;
LENGTH(s)
10
DROP TABLE t1;

View File

@ -449,3 +449,21 @@ create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
#
# Bug#18038 MySQL server corrupts binary columns data
#
CREATE TABLE t1 (s CHAR(8) BINARY);
INSERT INTO t1 VALUES ('test');
SELECT LENGTH(s) FROM t1;
ALTER TABLE t1 MODIFY s CHAR(10) BINARY;
SELECT LENGTH(s) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (s BINARY(8));
INSERT INTO t1 VALUES ('test');
SELECT LENGTH(s) FROM t1;
ALTER TABLE t1 MODIFY s BINARY(10);
SELECT LENGTH(s) FROM t1;
DROP TABLE t1;