mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
Bug#7302: UCS2 data in ENUM field get truncated when new column is added
This commit is contained in:
parent
c6b6977b9e
commit
2ba7c517a4
6 changed files with 71 additions and 19 deletions
20
sql/table.cc
20
sql/table.cc
|
|
@ -490,25 +490,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
|
|||
{
|
||||
/* Unescape UCS2 intervals from HEX notation */
|
||||
TYPELIB *interval= outparam->intervals + interval_nr - 1;
|
||||
for (uint pos= 0; pos < interval->count; pos++)
|
||||
{
|
||||
char *from, *to;
|
||||
for (from= to= (char*) interval->type_names[pos]; *from; )
|
||||
{
|
||||
/*
|
||||
Note, hexchar_to_int(*from++) doesn't work
|
||||
one some compilers, e.g. IRIX. Looks like a compiler
|
||||
bug in inline functions in combination with arguments
|
||||
that have a side effect. So, let's use from[0] and from[1]
|
||||
and increment 'from' by two later.
|
||||
*/
|
||||
|
||||
*to++= (char) (hexchar_to_int(from[0]) << 4) +
|
||||
hexchar_to_int(from[1]);
|
||||
from+= 2;
|
||||
}
|
||||
interval->type_lengths[pos] /= 2;
|
||||
}
|
||||
unhex_type2(interval);
|
||||
}
|
||||
|
||||
*field_ptr=reg_field=
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue