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:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user