1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Fix for bug#16678 FORMAT gives wrong result if client run with default-character-set=utf8

calculate Item_func_format::max_length using charset->mbmaxlen
This commit is contained in:
gluh@eagle.intranet.mysql.r18.ru
2006-03-06 12:52:38 +04:00
parent 519ea6a278
commit 33e7d20f37
3 changed files with 45 additions and 1 deletions

View File

@ -218,3 +218,23 @@ truncate(-5000111000111000155,-1)
select truncate(15000111000111000155,-1);
truncate(15000111000111000155,-1)
15000111000111000150
set names utf8;
create table t1
(f1 varchar(32) not null,
f2 smallint(5) unsigned not null,
f3 int(10) unsigned not null default '0')
engine=myisam default charset=utf8;
insert into t1 values ('zombie',0,0),('gold',1,10000),('silver',2,10000);
create table t2
(f1 int(10) unsigned not null,
f2 int(10) unsigned not null,
f3 smallint(5) unsigned not null)
engine=myisam default charset=utf8;
insert into t2 values (16777216,16787215,1),(33554432,33564431,2);
select format(t2.f2-t2.f1+1,0) from t1,t2
where t1.f2 = t2.f3 order by t1.f1;
format(t2.f2-t2.f1+1,0)
10,000
10,000
drop table t1, t2;
set names default;