1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

LDML refactoring for "MDEV-9711 NO PAD collations"

- Moving detection of the MY_CS_CSSORT, MY_CS_PUREASCII, MY_CS_NONASCII
  flags of loadable collations from add_collation() in mysys.c
  to my_cset_init_8bit() and my_coll_init_simple() in ctype-simple.c.

- Adding tests that these flags are set properly for loadable collations

- Moving LDML test related *.xml files from mysql-test/std_data/
  to mysql-test/std_data/ldml/, as there will be more *.xml test files
This commit is contained in:
Alexander Barkov
2016-09-03 09:05:56 +04:00
parent addb38f476
commit 1ca595fbf7
13 changed files with 299 additions and 74 deletions

View File

@ -193,25 +193,19 @@ static int my_read_charset_file(const char *filename)
return FALSE;
}
static int
is_case_sensitive(CHARSET_INFO *cs)
{
return (cs->sort_order &&
cs->sort_order['A'] < cs->sort_order['a'] &&
cs->sort_order['a'] < cs->sort_order['B']) ? 1 : 0;
}
void dispcset(FILE *f,CHARSET_INFO *cs)
{
uint flags= my_8bit_charset_flags_from_data(cs) |
my_8bit_collation_flags_from_data(cs);
fprintf(f,"{\n");
fprintf(f," %d,%d,%d,\n",cs->number,0,0);
fprintf(f," MY_CS_COMPILED%s%s%s%s%s,\n",
cs->state & MY_CS_BINSORT ? "|MY_CS_BINSORT" : "",
cs->state & MY_CS_PRIMARY ? "|MY_CS_PRIMARY" : "",
is_case_sensitive(cs) ? "|MY_CS_CSSORT" : "",
my_charset_is_8bit_pure_ascii(cs) ? "|MY_CS_PUREASCII" : "",
!my_charset_is_ascii_compatible(cs) ? "|MY_CS_NONASCII": "");
flags & MY_CS_CSSORT ? "|MY_CS_CSSORT" : "",
flags & MY_CS_PUREASCII ? "|MY_CS_PUREASCII" : "",
flags & MY_CS_NONASCII ? "|MY_CS_NONASCII" : "");
if (cs->name)
{