mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 04:05:32 +02:00
Backporting WL#1213
config/ac-macros/character_sets.m4:
- Adding configure definitions for utf8mb4, utf16, utf32
include/config-win.h:
- Enabling utf8mb4, utf16, utf32 in Windows build
include/m_ctype.h:
- Adding new flags
- Adding new shared functions prototypes
mysql-test/include/ctype_datetime.inc:
- Adding test to check that datetime functions
work with "real" multibyte character sets.
mysql-test/include/ctype_like.inc:
- Adding LIKE tests
mysql-test/include/have_utf16.inc:
New file
mysql-test/include/have_utf32.inc:
New file
mysql-test/include/have_utf8mb4.inc:
New file
mysql-test/r/ctype_ldml.result:
- Adding tests for utf8mb4, utf16, utf32
mysql-test/r/ctype_many.result:
- Adding tests to check superset/subset relations
between all Unicode character sets.
mysql-test/r/ctype_utf16.result:
New file
mysql-test/r/ctype_utf16_uca.result:
New file
mysql-test/r/ctype_utf32.result:
New file
mysql-test/r/ctype_utf32_uca.result:
New file
mysql-test/r/ctype_utf8.result:
- Adding tests for utf8mn3 alias
mysql-test/r/ctype_utf8mb4.result:
- Adding tests for utf8mb4
mysql-test/r/have_utf16.require:
New file
mysql-test/r/have_utf32.require:
New file
mysql-test/r/have_utf8mb4.require:
New file
mysql-test/std_data/Index.xml:
- Adding tests for loadable utf8m4, utf16, utf32 collations
mysql-test/suite/sys_vars/r/character_set_client_basic.result:
- Adding tests for utf16, utf32.
- Fixing new number of character sets
mysql-test/suite/sys_vars/r/character_set_connection_basic.result:
- Fixing new number of character sets
mysql-test/suite/sys_vars/r/character_set_database_basic.result:
- Fixing new number of character sets
mysql-test/suite/sys_vars/r/character_set_filesystem_basic.result:
- Fixing new number of character sets
mysql-test/suite/sys_vars/r/character_set_results_basic.result:
- Fixing new number of character sets
mysql-test/suite/sys_vars/t/character_set_client_basic.test:
- Adding tests for new character sets
mysql-test/suite/sys_vars/t/character_set_connection_basic.test:
- Adding dependency on utf8mb4, utf16, utf32
mysql-test/suite/sys_vars/t/character_set_database_basic.test:
- Adding dependency on utf8mb4, utf16, utf32
mysql-test/suite/sys_vars/t/character_set_filesystem_basic.test:
- Adding dependency on utf8mb4, utf16, utf32
mysql-test/suite/sys_vars/t/character_set_results_basic.test:
- Adding dependency on utf8mb4, utf16, utf32
mysql-test/t/ctype_ldml.test:
- Adding tests for dynamic utf8mb4, utf16, utf32 collations
mysql-test/t/ctype_many.test:
- Adding tests to check superset/subset relations
between all Unicode character sets
mysql-test/t/ctype_utf16.test:
New file
mysql-test/t/ctype_utf16_uca.test:
New file
mysql-test/t/ctype_utf32.test:
New file
mysql-test/t/ctype_utf32_uca.test:
New file
mysql-test/t/ctype_utf8.test:
- Adding tests for utf8mb4 alias
mysql-test/t/ctype_utf8mb4.test:
New file
mysys/charset-def.c:
- Adding initialization of utf8mb4, utf16, utf32 built-int collations
mysys/charset.c:
- Adding initialization of utf8mb4, utf16, utf32 dynamic collations
sql/field.cc:
- Fixing "truncated" error with datetime functions:
Force conversion in case of non-ascii character sets.
sql/item.cc:
- Adding superset/subset relation check for utf8mb4/utf8
sql/item_strfunc.cc:
- Fixing a problem with CHAR(x USING utf32)
sql/sql_string.cc:
- Fixing problems with zero padding for UTF32
sql/sql_table.cc:
- Fixing buffer size, to make utf32 comma fit.
strings/ctype-mb.c:
- Making handlers for multi-byte binary collations public
strings/ctype-uca.c:
- Adding definitions for utf8mb4, utf16, utf32 UCA collations
strings/ctype-ucs2.c:
- Adding functions which are shared between ucs2, utf16, utf32
- Ading utf16 implementation
- Adding utf32 implementation
strings/ctype-utf8.c:
- Adding functions shared between utf8 and utf8mb4
- Adding implementation of utf8mb4
This commit is contained in:
parent
d2af6c43c0
commit
8994fad85d
49 changed files with 19307 additions and 1074 deletions
|
|
@ -2371,17 +2371,27 @@ String *Item_func_char::val_str(String *str)
|
|||
int32 num=(int32) args[i]->val_int();
|
||||
if (!args[i]->null_value)
|
||||
{
|
||||
char char_num= (char) num;
|
||||
if (num&0xFF000000L) {
|
||||
str->append((char)(num>>24));
|
||||
goto b2;
|
||||
} else if (num&0xFF0000L) {
|
||||
b2: str->append((char)(num>>16));
|
||||
goto b1;
|
||||
} else if (num&0xFF00L) {
|
||||
b1: str->append((char)(num>>8));
|
||||
char tmp[4];
|
||||
if (num & 0xFF000000L)
|
||||
{
|
||||
mi_int4store(tmp, num);
|
||||
str->append(tmp, 4, &my_charset_bin);
|
||||
}
|
||||
else if (num & 0xFF0000L)
|
||||
{
|
||||
mi_int3store(tmp, num);
|
||||
str->append(tmp, 3, &my_charset_bin);
|
||||
}
|
||||
else if (num & 0xFF00L)
|
||||
{
|
||||
mi_int2store(tmp, num);
|
||||
str->append(tmp, 2, &my_charset_bin);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp[0]= (char) num;
|
||||
str->append(tmp, 1, &my_charset_bin);
|
||||
}
|
||||
str->append(&char_num, 1);
|
||||
}
|
||||
}
|
||||
str->realloc(str->length()); // Add end 0 (for Purify)
|
||||
|
|
@ -2769,7 +2779,8 @@ String *Item_func_conv_charset::val_str(String *str)
|
|||
void Item_func_conv_charset::fix_length_and_dec()
|
||||
{
|
||||
collation.set(conv_charset, DERIVATION_IMPLICIT);
|
||||
max_length = args[0]->max_length*conv_charset->mbmaxlen;
|
||||
max_length = args[0]->max_length / args[0]->collation.collation->mbmaxlen *
|
||||
conv_charset->mbmaxlen;
|
||||
}
|
||||
|
||||
void Item_func_conv_charset::print(String *str, enum_query_type query_type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue