1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-11 05:52:26 +03:00

UCS2 support in ENUM and SET, which also fixes:

Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values
UCS2 values are stored in HEX encoding in FRM file
This commit is contained in:
bar@mysql.com
2004-12-06 20:45:32 +04:00
parent 878dd8ba0a
commit 248a968581
8 changed files with 170 additions and 23 deletions

View File

@@ -485,6 +485,23 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
charset= outparam->table_charset;
bzero((char*) &comment, sizeof(comment));
}
if (interval_nr && charset->mbminlen > 1)
{
/* 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; )
{
*to++= (char) (hexchar_to_int(*from++) << 4) +
hexchar_to_int(*from++);
}
interval->type_lengths[pos] /= 2;
}
}
*field_ptr=reg_field=
make_field(record+recpos,
(uint32) field_length,