Bug#7302: UCS2 data in ENUM field get truncated when new column is added

This commit is contained in:
unknown 2004-12-21 17:12:27 +04:00
commit 2ba7c517a4
6 changed files with 71 additions and 19 deletions

View file

@ -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=