diff options
author | bar@mysql.com <> | 2004-12-06 20:45:32 +0400 |
---|---|---|
committer | bar@mysql.com <> | 2004-12-06 20:45:32 +0400 |
commit | 248a96858174159620a0acc4dff74b0902f75a69 (patch) | |
tree | a397eb25eef58a660d9d2e554e7c8f8800bdb8f4 /sql/unireg.cc | |
parent | 878dd8ba0a28c30003be3e32ea19474df58274c6 (diff) | |
download | mariadb-git-248a96858174159620a0acc4dff74b0902f75a69.tar.gz |
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
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index c82fcc4abef..6d72c6af135 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -423,6 +423,28 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, if (field->interval) { uint old_int_count=int_count; + + if (field->charset->mbminlen > 1) + { + /* Escape UCS2 intervals using HEX notation */ + for (uint pos= 0; pos < field->interval->count; pos++) + { + char *dst; + uint length= field->interval->type_lengths[pos], hex_length; + const char *src= field->interval->type_names[pos]; + const char *srcend= src + length; + hex_length= length * 2; + field->interval->type_lengths[pos]= hex_length; + field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1); + for ( ; src < srcend; src++) + { + *dst++= _dig_vec_upper[((uchar) *src) >> 4]; + *dst++= _dig_vec_upper[((uchar) *src) & 15]; + } + *dst= '\0'; + } + } + field->interval_id=get_interval_id(&int_count,create_fields,field); if (old_int_count != int_count) { |