mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql.com:/home/bar/mysql-5.0.b20095
This commit is contained in:
@@ -1480,6 +1480,49 @@ aa
|
||||
xxx
|
||||
yyy
|
||||
DROP TABLE t1;
|
||||
create table t1 (
|
||||
a varchar(26) not null
|
||||
) default character set utf8;
|
||||
insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
|
||||
select * from t1;
|
||||
a
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
alter table t1 change a a varchar(20) character set utf8 not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1;
|
||||
a
|
||||
abcdefghijklmnopqrst
|
||||
alter table t1 change a a char(15) character set utf8 not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1;
|
||||
a
|
||||
abcdefghijklmno
|
||||
alter table t1 change a a char(10) character set utf8 not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1;
|
||||
a
|
||||
abcdefghij
|
||||
alter table t1 change a a varchar(5) character set utf8 not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select * from t1;
|
||||
a
|
||||
abcde
|
||||
drop table t1;
|
||||
create table t1 (
|
||||
a varchar(4000) not null
|
||||
) default character set utf8;
|
||||
insert into t1 values (repeat('a',4000));
|
||||
alter table t1 change a a varchar(3000) character set utf8 not null;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'a' at row 1
|
||||
select length(a) from t1;
|
||||
length(a)
|
||||
3000
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
select hex(char(1 using utf8));
|
||||
hex(char(1 using utf8))
|
||||
|
||||
@@ -1192,6 +1192,41 @@ SELECT DISTINCT id FROM t1 ORDER BY id;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug#20095 Changing length of VARCHAR field with UTF8
|
||||
# collation does not truncate values
|
||||
#
|
||||
create table t1 (
|
||||
a varchar(26) not null
|
||||
) default character set utf8;
|
||||
insert into t1 (a) values ('abcdefghijklmnopqrstuvwxyz');
|
||||
select * from t1;
|
||||
# varchar to varchar
|
||||
alter table t1 change a a varchar(20) character set utf8 not null;
|
||||
select * from t1;
|
||||
# varchar to char
|
||||
alter table t1 change a a char(15) character set utf8 not null;
|
||||
select * from t1;
|
||||
# char to char
|
||||
alter table t1 change a a char(10) character set utf8 not null;
|
||||
select * from t1;
|
||||
# char to varchar
|
||||
alter table t1 change a a varchar(5) character set utf8 not null;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Check that do_varstring2_mb produces a warning
|
||||
#
|
||||
create table t1 (
|
||||
a varchar(4000) not null
|
||||
) default character set utf8;
|
||||
insert into t1 values (repeat('a',4000));
|
||||
alter table t1 change a a varchar(3000) character set utf8 not null;
|
||||
select length(a) from t1;
|
||||
drop table t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug#10504: Character set does not support traditional mode
|
||||
# Bug#14146: CHAR(...USING ...) and CONVERT(CHAR(...) USING...)
|
||||
|
||||
Reference in New Issue
Block a user