Commit b7a723af authored by unknown's avatar unknown

German Phone book collation is always compiled

Some collation names have been renamed


BitKeeper/deleted/.del-ctype-latin1_de.c~c5d8f9208bceb98e:
  Delete: strings/ctype-latin1_de.c
libmysql/Makefile.shared:
  German Phone book collation is always compiled
mysql-test/r/ctype_collate.result:
  Some collation names have been renamed
mysql-test/t/ctype_collate.test:
  Some collation names have been renamed
mysql-test/t/ctype_latin1_de-master.opt:
  Some collation names have been renamed
mysys/charset.c:
  get_charset_by_name() now will find its default collation if charset name is passed
sql/share/charsets/Index.xml:
  Some collation names have been renamed
sql/share/charsets/cp1251.xml:
  Some collation names have been renamed
sql/share/charsets/cp1257.xml:
  Some collation names have been renamed
sql/share/charsets/latin1.xml:
  Some collation names have been renamed
sql/share/charsets/latin2.xml:
  Some collation names have been renamed
sql/share/charsets/latin7.xml:
  Some collation names have been renamed
sql/share/charsets/macce.xml:
  Some collation names have been renamed
sql/share/charsets/macroman.xml:
  Some collation names have been renamed
sql/sql_show.cc:
  Nicer output from SHOW COLLATION
strings/Makefile.am:
  German Phone book collation is always compiled
strings/ctype-czech.c:
  Some collation names have been renamed
strings/ctype-extra.c:
  Don't compile dynamic charset. We should decide names convension before 
  making this available.
strings/ctype-latin1.c:
  German Phone book collation is always compiled
parent 0737f4ad
......@@ -41,7 +41,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \
ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \
ctype-gb2312.lo ctype-gbk.lo ctype-latin1_de.lo \
ctype-gb2312.lo ctype-gbk.lo \
ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo xml.lo
mystringsextra= strto.c
......
......@@ -92,7 +92,7 @@ z
Ä
ä
ß
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci;
latin1_f
A
a
......@@ -121,7 +121,7 @@ Y
y
Z
z
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci;
latin1_f
A
a
......@@ -210,7 +210,7 @@ z
Ä
ä
ß
SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
latin1_f_as
A
a
......@@ -239,7 +239,7 @@ Y
y
Z
z
SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
latin1_f_as
A
a
......@@ -329,7 +329,7 @@ Z 2
Å 2
Ä 2
ß 1
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci;
latin1_f count(*)
A 4
AD 2
......@@ -344,7 +344,7 @@ UE 2
Ü 2
Y 2
Z 2
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci;
latin1_f count(*)
A 2
AD 2
......@@ -421,8 +421,8 @@ UE
SS
ß
Z
SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1;
latin1_f COLLATE latin1_de
SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1;
latin1_f COLLATE latin1_german2_ci
A
AD
AE
......@@ -436,8 +436,8 @@ SS
ß
Y
Z
SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1;
latin1_f COLLATE latin1_ci_as
SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
latin1_f COLLATE latin1_general_ci
A
AD
AE
......
......@@ -58,8 +58,8 @@ INSERT INTO t1 (latin1_f) VALUES (_latin1'z');
SELECT latin1_f FROM t1 ORDER BY latin1_f;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_de;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_ci_as;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin;
--error 1251
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
......@@ -68,8 +68,8 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
-- AS + ORDER BY
SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_de AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_ci_as AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
--error 1251
SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
......@@ -79,8 +79,8 @@ SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_de;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_ci_as;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin;
--error 1251
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
......@@ -90,27 +90,27 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
SELECT DISTINCT latin1_f FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1 FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
--error 1251
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
-- Aggregates
--SELECT MAX(k COLLATE latin1_de)
--SELECT MAX(k COLLATE latin1_german2_ci)
--FROM t1
-- WHERE
--SELECT *
--FROM t1
--WHERE (_latin1'Mu"ller' COLLATE latin1_de) = k
--WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
--HAVING
--SELECT *
--FROM t1
--HAVING (_latin1'Mu"ller' COLLATE latin1_de) = k
--HAVING (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
#
......
--default-character-set=latin1_de
--default-character-set=latin1_german2_ci
......@@ -553,7 +553,10 @@ uint get_charset_number(const char *charset_name)
for (cs= all_charsets; cs < all_charsets+255; ++cs)
{
if ( cs[0] && cs[0]->name && !strcasecmp(cs[0]->name, charset_name))
if ( cs[0] && cs[0]->name &&
(!strcasecmp(cs[0]->name, charset_name) ||
(!strcasecmp(cs[0]->csname, charset_name) &&
(cs[0]->state & MY_CS_PRIMARY))))
return cs[0]->number;
}
return 0; /* this mimics find_type() */
......
......@@ -32,8 +32,8 @@ To make maintaining easier please:
<alias>iso_8859-2</alias>
<alias>iso_8859-2:1987</alias>
<alias>l2</alias>
<collation name="czech" id="2" order="Czech" flag="compiled"/>
<collation name="latin2" id="9" flag="primary">
<collation name="latin2_czech_ci" id="2" order="Czech" flag="compiled"/>
<collation name="latin2_general_ci" id="9" flag="primary">
<order>Hungarian</order>
<order>Polish</order>
<order>Romanian</order>
......@@ -42,8 +42,8 @@ To make maintaining easier please:
<order>Slovenian</order>
<order>Sorbian</order>
</collation>
<collation name="hungarian" id="21" order="Hungarian"/>
<collation name="croat" id="27" order="Croatian"/>
<collation name="latin2_hungarian_ci" id="21" order="Hungarian"/>
<collation name="latin2_croatian_ci" id="27" order="Croatian"/>
<collation name="latin2_bin" id="77" order="Binary" flag="binary"/>
</charset>
......@@ -93,12 +93,12 @@ To make maintaining easier please:
<alias>iso_8859-1:1987</alias>
<alias>l1</alias>
<alias>latin1</alias>
<collation name="german1" id="5" order="German Duden"/>
<collation name="latin1_german1_ci" id="5" order="German Duden"/>
<collation name="latin1" id="8" order="Finnish, Swedish" flag="primary"/>
<collation name="danish" id="15" order="Danish"/>
<collation name="latin1_de" id="31" order="German DIN" flag="compiled"/>
<collation name="latin1_danish_ci" id="15" order="Danish"/>
<collation name="latin1_german2_ci" id="31" order="German Phonebook" flag="compiled"/>
<collation name="latin1_bin" id="47" order="Binary" flag="binary"/>
<collation name="latin1_ci_as" id="48">
<collation name="latin1_general_ci" id="48">
<order>Dutch</order>
<order>English</order>
<order>French</order>
......@@ -108,7 +108,7 @@ To make maintaining easier please:
<order>Pogtuguese</order>
<order>Spanish</order>
</collation>
<collation name="latin1_cs_as" id="49">
<collation name="latin1_general_cs" id="49">
<order>Dutch</order>
<order>English</order>
<order>French</order>
......@@ -199,7 +199,7 @@ To make maintaining easier please:
</collation>
<collation name="win1251ukr" id="23" order="Depreciated"/>
<collation name="cp1251_bin" id="50" order="Binary" flag="binary"/>
<collation name="cp1251_ci_as" id="51">
<collation name="cp1251_ci" id="51">
<order>Belarusian</order>
<order>Bulgarian</order>
<order>Macedonian</order>
......@@ -208,7 +208,7 @@ To make maintaining easier please:
<order>Mongolian</order>
<order>Ukrainian</order>
</collation>
<collation name="cp1251_cs_as" id="52">
<collation name="cp1251_cs" id="52">
<order>Belarusian</order>
<order>Bulgarian</order>
<order>Macedonian</order>
......@@ -256,15 +256,15 @@ To make maintaining easier please:
<alias>BalticRim</alias>
<alias>iso-8859-13</alias>
<alias>l7</alias>
<collation name="latin7_estonian_ci_as" id="20">
<collation name="latin7_estonian_ci" id="20">
<order>Estonian</order>
<flag>primary</flag>
</collation>
<collation name="latin7_ci_as" id="41">
<collation name="latin7_ci" id="41">
<order>Latvian</order>
<order>Lithuanian</order>
</collation>
<collation name="latin7_cs_as" id="42">
<collation name="latin7_cs" id="42">
<order>Latvian</order>
<order>Lithuanian</order>
</collation>
......@@ -341,11 +341,11 @@ To make maintaining easier please:
<order>Latvian</order>
<order>Lithuanian</order>
</collation>
<collation name="cp1257_ci_as" id="60">
<collation name="cp1257_ci" id="60">
<order>Latvian</order>
<order>Lithuanian</order>
</collation>
<collation name="cp1257_cs_as" id="61">
<collation name="cp1257_cs" id="61">
<order>Latvian</order>
<order>Lithuanian</order>
</collation>
......@@ -417,7 +417,8 @@ To make maintaining easier please:
<order>Sorbian</order>
</collation>
<collation name="macce_bin" id="43" order="Binary" flag="binary"/>
<collation name="macce_ci_ai" id="44">
<!--collation name="macce_ci_ai" id="44"/-->
<collation name="macce_ci" id="45">
<order>Hungarian</order>
<order>Polish</order>
<order>Romanian</order>
......@@ -426,16 +427,7 @@ To make maintaining easier please:
<order>Slovenian</order>
<order>Sorbian</order>
</collation>
<collation name="macce_ci_as" id="45">
<order>Hungarian</order>
<order>Polish</order>
<order>Romanian</order>
<order>Croatian</order>
<order>Slovak</order>
<order>Slovenian</order>
<order>Sorbian</order>
</collation>
<collation name="macce_cs_as" id="46">
<collation name="macce_cs" id="46">
<order>Hungarian</order>
<order>Polish</order>
<order>Romanian</order>
......@@ -463,17 +455,7 @@ To make maintaining easier please:
<order>Spanish</order>
</collation>
<collation name="macroman_bin" id="53" order="Binary" flag="binary"/>
<collation name="macroman_ci_as" id="54">
<order>Dutch</order>
<order>English</order>
<order>French</order>
<order>German Duden</order>
<order>Italian</order>
<order>Latin</order>
<order>Pogtuguese</order>
<order>Spanish</order>
</collation>
<collation name="macroman_ci_ai" id="55">
<collation name="macroman_ci" id="54">
<order>Dutch</order>
<order>English</order>
<order>French</order>
......@@ -483,7 +465,8 @@ To make maintaining easier please:
<order>Pogtuguese</order>
<order>Spanish</order>
</collation>
<collation name="macroman_cs_as" id="56">
<!--collation name="macroman_ci_ai" id="55"/-->
<collation name="macroman_cs" id="56">
<order>Dutch</order>
<order>English</order>
<order>French</order>
......
......@@ -119,7 +119,7 @@
<collation name="cp1251_bin" flag="binary"/>
<collation name="cp1251_ci_as">
<collation name="cp1251_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -141,7 +141,7 @@
</collation>
<collation name="cp1251_cs_as">
<collation name="cp1251_cs">
<!--
# Case insensitive, accent sensitive
# Sort order is correct for Belarusian, Bulgarian, Macedonian,
......
......@@ -140,7 +140,7 @@
</collation>
<collation name="cp1257_ci_as">
<collation name="cp1257_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -162,7 +162,7 @@
</collation>
<collation name="cp1257_cs_as">
<collation name="cp1257_cs">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
......@@ -115,7 +115,7 @@
</collation>
<collation name="german1">
<collation name="latin1_german1_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -137,7 +137,7 @@
</collation>
<collation name="danish">
<collation name="latin1_danish_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -159,13 +159,13 @@
</collation>
<collation name="latin1_de"/>
<collation name="latin1_german2_ci"/>
<collation name="latin1_bin" flag="binary"/>
<collation name="latin1_ci_as">
<collation name="latin1_general_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -187,7 +187,7 @@
</collation>
<collation name="latin1_cs_as">
<collation name="latin1_general_cs">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
......@@ -93,7 +93,7 @@
</unicode>
<collation name="latin2">
<collation name="latin2_general_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -115,7 +115,7 @@
</collation>
<collation name="croat">
<collation name="latin2_croatian_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -137,10 +137,10 @@
</collation>
<collation name="czech"/>
<collation name="latin2_czech_ci"/>
<collation name="hungarian">
<collation name="latin2_hungarian_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
......@@ -93,7 +93,7 @@
</unicode>
<collation name="latin7_estonian_ci_as">
<collation name="latin7_estonian_ci">
<map>
00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B
0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
......@@ -115,7 +115,7 @@
</collation>
<collation name="latin7_ci_as">
<collation name="latin7_ci">
<!-- Created for case-sensitive record search -->
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
<map>
......@@ -139,7 +139,7 @@
</collation>
<collation name="latin7_cs_as">
<collation name="latin7_cs">
<!-- Created for case-insensitive record search -->
<!-- Created by Andis & Rihards -->
<map>
......
......@@ -139,7 +139,7 @@
</collation>
<collation name="macce_ci_as">
<collation name="macce_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -162,7 +162,7 @@
</collation>
<collation name="macce_cs_as">
<collation name="macce_cs">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
......@@ -135,7 +135,7 @@
</map>
</collation>
<collation name="macroman_ci_as">
<collation name="macroman_ci">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......@@ -156,7 +156,7 @@
</map>
</collation>
<collation name="macroman_cs_as">
<collation name="macroman_cs">
<map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
......@@ -1416,15 +1416,12 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
static bool write_collation(Protocol *protocol, CHARSET_INFO *cs)
{
char flags[4];
protocol->prepare_for_resend();
protocol->store(cs->csname, system_charset_info);
protocol->store(cs->name, system_charset_info);
protocol->store_short((longlong) cs->number);
flags[0]='\0';
if (cs->state & MY_CS_PRIMARY)
strcat(flags,"def");
protocol->store(flags, system_charset_info);
protocol->store((cs->state & MY_CS_PRIMARY) ? "Y" : "",system_charset_info);
protocol->store((cs->state & MY_CS_COMPILED)? "Y" : "",system_charset_info);
protocol->store_short((longlong) cs->strxfrm_multiply);
return protocol->write();
}
......@@ -1443,8 +1440,9 @@ int mysqld_show_collations(THD *thd, const char *wild)
field_list.push_back(new Item_empty_string("Charset",30));
field_list.push_back(new Item_empty_string("Collation",30));
field_list.push_back(new Item_return_int("Id",11, FIELD_TYPE_SHORT));
field_list.push_back(new Item_empty_string("Flags",30));
field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_SHORT));
field_list.push_back(new Item_empty_string("D",30));
field_list.push_back(new Item_empty_string("C",30));
field_list.push_back(new Item_return_int("Sortlen",3, FIELD_TYPE_SHORT));
if (protocol->send_fields(&field_list, 1))
DBUG_RETURN(1);
......
......@@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X
if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s
CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
else
if ASSEMBLER_sparc32
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s
CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
else
#no assembler
ASRCS =
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-latin1_de.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
endif
endif
......@@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c
# Default charset definitions
EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \
ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
ctype-tis620.c ctype-ujis.c ctype-latin1_de.c \
ctype-tis620.c ctype-ujis.c \
xml.c strto.c strings-x86.s \
longlong2str.c longlong2str-x86.s \
strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
......
......@@ -610,7 +610,7 @@ CHARSET_INFO my_charset_czech =
2,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
"latin2", /* cs name */
"czech", /* name */
"latin2_czech_ci", /* name */
"", /* comment */
ctype_czech,
to_lower_czech,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -19,7 +19,7 @@
#include "m_ctype.h"
static my_wc_t latin1_uni[256]={
static uint16 latin1_uni[256]={
0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
......@@ -178,7 +178,7 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO my_charset_latin1 =
{
8,0,0, /* number */
MY_CS_COMPILED, /* state */
MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
"latin1", /* cs name */
"latin1", /* name */
"", /* comment */
......@@ -186,10 +186,10 @@ CHARSET_INFO my_charset_latin1 =
to_lower_latin1,
to_upper_latin1,
sort_order_latin1,
NULL, /* tab_to_uni */
latin1_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
2, /* strxfrm_multiply */
0, /* strxfrm_multiply */
my_strnncoll_simple,
my_strnncollsp_simple,
my_strnxfrm_simple,
......@@ -207,6 +207,263 @@ CHARSET_INFO my_charset_latin1 =
my_casedn_str_8bit,
my_caseup_8bit,
my_casedn_8bit,
my_tosort_8bit, /* tosort */
my_strcasecmp_8bit,
my_strncasecmp_8bit,
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_long10_to_str_8bit,
my_longlong10_to_str_8bit,
my_fill_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit,
my_scan_8bit
};
/*
* This file is the latin1 character set with German sorting
*
* The modern sort order is used, where:
*
* '' -> "ae"
* '' -> "oe"
* '' -> "ue"
* '' -> "ss"
*/
/*
* This is a simple latin1 mapping table, which maps all accented
* characters to their non-accented equivalents. Note: in this
* table, '' is mapped to 'A', '' is mapped to 'Y', etc. - all
* accented characters except the following are treated the same way.
* , , , , ,
*/
static uchar sort_order_latin1_de[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223,
65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89
};
#define L1_AE 196
#define L1_ae 228
#define L1_OE 214
#define L1_oe 246
#define L1_UE 220
#define L1_ue 252
#define L1_ss 223
/*
Some notes about the following comparison rules:
By definition, my_strnncoll_latin_de must works exactly as if had called
my_strnxfrm_latin_de() on both strings and compared the result strings.
This means that:
must also matches E and A, because my_strxn_frm_latin_de() will convert
both to AE.
The other option would be to not do any accent removal in
sort_order_latin_de[] at all
*/
#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \
/* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \
if (ch2 != accent) \
{ \
ch1= fst; \
goto normal; \
} \
if (str1 == str1_end) \
return res_if_str1_smaller; \
{ \
int diff = (int) sort_order_latin1_de[*str1] - snd; \
if (diff) \
return diff*(-(res_if_str1_smaller)); \
/* They are equal (e.g., "Ae" == '') */ \
str1++; \
}
static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
{
const uchar *e1 = s1 + len1;
const uchar *e2 = s2 + len2;
while (s1 < e1 && s2 < e2)
{
/*
Because sort_order_latin1_de doesn't convert '', or we
can use it here.
*/
uchar c1 = sort_order_latin1_de[*s1++];
uchar c2 = sort_order_latin1_de[*s2++];
if (c1 != c2)
{
switch (c1) {
case 'A':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE);
break;
case 'O':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE);
break;
case 'U':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE);
break;
case 'S':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss);
break;
case L1_AE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A');
break;
case L1_OE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O');
break;
case L1_UE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U');
break;
case L1_ss:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S');
break;
default:
/*
Handle the case where 'c2' is a special character
If this is true, we know that c1 can't match this character.
*/
normal:
switch (c2) {
case L1_AE:
return (int) c1 - (int) 'A';
case L1_OE:
return (int) c1 - (int) 'O';
case L1_UE:
return (int) c1 - (int) 'U';
case L1_ss:
return (int) c1 - (int) 'S';
default:
{
int diff= (int) c1 - (int) c2;
if (diff)
return diff;
}
break;
}
}
}
}
/* A simple test of string lengths won't work -- we test to see
* which string ran out first */
return s1 < e1 ? 1 : s2 < e2 ? -1 : 0;
}
static
int my_strnncollsp_latin1_de(CHARSET_INFO * cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
return my_strnncoll_latin1_de(cs,s,slen,t,tlen);
}
static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar * src, uint srclen)
{
const uchar *dest_orig = dest;
const uchar *de = dest + len;
const uchar *se = src + srclen;
while (src < se && dest < de)
{
uchar chr=sort_order_latin1_de[*src];
switch (chr) {
case L1_AE:
*dest++ = 'A';
if (dest < de)
*dest++ = 'E';
break;
case L1_OE:
*dest++ = 'O';
if (dest < de)
*dest++ = 'E';
break;
case L1_UE:
*dest++ = 'U';
if (dest < de)
*dest++ = 'E';
break;
case L1_ss:
*dest++ = 'S';
if (dest < de)
*dest++ = 'S';
break;
default:
*dest++= chr;
break;
}
++src;
}
return dest - dest_orig;
}
CHARSET_INFO my_charset_latin1_de =
{
31,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
"latin1", /* cs name */
"latin1_german2_ci", /* name */
"", /* comment */
ctype_latin1,
to_lower_latin1,
to_upper_latin1,
sort_order_latin1_de,
latin1_uni, /* tab_to_uni */
NULL, /* tab_from_uni */
"","",
2, /* strxfrm_multiply */
my_strnncoll_latin1_de,
my_strnncollsp_latin1_de,
my_strnxfrm_latin1_de,
my_like_range_simple,
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
my_mb_wc_latin1, /* mb_wc */
my_wc_mb_latin1, /* wc_mb */
my_caseup_str_8bit,
my_casedn_str_8bit,
my_caseup_8bit,
my_casedn_8bit,
NULL, /* tosort */
my_strcasecmp_8bit,
my_strncasecmp_8bit,
......@@ -224,3 +481,4 @@ CHARSET_INFO my_charset_latin1 =
my_strntod_8bit,
my_scan_8bit
};
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
* This file is the latin1 character set with German sorting
*
* The modern sort order is used, where:
*
* '' -> "ae"
* '' -> "oe"
* '' -> "ue"
* '' -> "ss"
*/
/*
* This comment is parsed by configure to create ctype.c,
* so don't change it unless you know what you are doing.
*
* .configure. strxfrm_multiply_latin1_de=2
*/
#include <my_global.h>
#include "m_string.h"
#include "m_ctype.h"
#ifdef HAVE_CHARSET_latin1_de
static uint16 tab_8859_1_uni[256]={
0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
0x0018,0x0019,0x001A,0x001B,0x001C,0x001D,0x001E,0x001F,
0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,
0x0028,0x0029,0x002A,0x002B,0x002C,0x002D,0x002E,0x002F,
0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,
0x0048,0x0049,0x004A,0x004B,0x004C,0x004D,0x004E,0x004F,
0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,
0x0058,0x0059,0x005A,0x005B,0x005C,0x005D,0x005E,0x005F,
0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,
0x0068,0x0069,0x006A,0x006B,0x006C,0x006D,0x006E,0x006F,
0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,
0x0078,0x0079,0x007A,0x007B,0x007C,0x007D,0x007E, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0x00A0,0x00A1,0x00A2,0x00A3,0x00A4,0x00A5,0x00A6,0x00A7,
0x00A8,0x00A9,0x00AA,0x00AB,0x00AC,0x00AD,0x00AE,0x00AF,
0x00B0,0x00B1,0x00B2,0x00B3,0x00B4,0x00B5,0x00B6,0x00B7,
0x00B8,0x00B9,0x00BA,0x00BB,0x00BC,0x00BD,0x00BE,0x00BF,
0x00C0,0x00C1,0x00C2,0x00C3,0x00C4,0x00C5,0x00C6,0x00C7,
0x00C8,0x00C9,0x00CA,0x00CB,0x00CC,0x00CD,0x00CE,0x00CF,
0x00D0,0x00D1,0x00D2,0x00D3,0x00D4,0x00D5,0x00D6,0x00D7,
0x00D8,0x00D9,0x00DA,0x00DB,0x00DC,0x00DD,0x00DE,0x00DF,
0x00E0,0x00E1,0x00E2,0x00E3,0x00E4,0x00E5,0x00E6,0x00E7,
0x00E8,0x00E9,0x00EA,0x00EB,0x00EC,0x00ED,0x00EE,0x00EF,
0x00F0,0x00F1,0x00F2,0x00F3,0x00F4,0x00F5,0x00F6,0x00F7,
0x00F8,0x00F9,0x00FA,0x00FB,0x00FC,0x00FD,0x00FE,0x00FF
};
static uchar tab_uni_8859_1_plane00[]={
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,
0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF};
static MY_UNI_IDX idx_uni_8859_1[]={
{0x0000,0x00FF,tab_uni_8859_1_plane00},
{0,0,NULL}
};
static uchar ctype_latin1_de[] = {
0,
32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32,
32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16,
16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16,
16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2
};
static uchar to_lower_latin1_de[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95,
96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111,
112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223,
224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,
240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
};
static uchar to_upper_latin1_de[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,
208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255
};
/*
* This is a simple latin1 mapping table, which maps all accented
* characters to their non-accented equivalents. Note: in this
* table, '' is mapped to 'A', '' is mapped to 'Y', etc. - all
* accented characters except the following are treated the same way.
* , , , , ,
*/
static uchar sort_order_latin1_de[] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,
144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,
160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,
176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,
65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223,
65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73,
68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89
};
#define L1_AE 196
#define L1_ae 228
#define L1_OE 214
#define L1_oe 246
#define L1_UE 220
#define L1_ue 252
#define L1_ss 223
/*
Some notes about the following comparison rules:
By definition, my_strnncoll_latin_de must works exactly as if had called
my_strnxfrm_latin_de() on both strings and compared the result strings.
This means that:
must also matches E and A, because my_strxn_frm_latin_de() will convert
both to AE.
The other option would be to not do any accent removal in
sort_order_latin_de[] at all
*/
#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \
/* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \
if (ch2 != accent) \
{ \
ch1= fst; \
goto normal; \
} \
if (str1 == str1_end) \
return res_if_str1_smaller; \
{ \
int diff = (int) sort_order_latin1_de[*str1] - snd; \
if (diff) \
return diff*(-(res_if_str1_smaller)); \
/* They are equal (e.g., "Ae" == '') */ \
str1++; \
}
static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
{
const uchar *e1 = s1 + len1;
const uchar *e2 = s2 + len2;
while (s1 < e1 && s2 < e2)
{
/*
Because sort_order_latin1_de doesn't convert '', or we
can use it here.
*/
uchar c1 = sort_order_latin1_de[*s1++];
uchar c2 = sort_order_latin1_de[*s2++];
if (c1 != c2)
{
switch (c1) {
case 'A':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE);
break;
case 'O':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE);
break;
case 'U':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE);
break;
case 'S':
CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss);
break;
case L1_AE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A');
break;
case L1_OE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O');
break;
case L1_UE:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U');
break;
case L1_ss:
CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S');
break;
default:
/*
Handle the case where 'c2' is a special character
If this is true, we know that c1 can't match this character.
*/
normal:
switch (c2) {
case L1_AE:
return (int) c1 - (int) 'A';
case L1_OE:
return (int) c1 - (int) 'O';
case L1_UE:
return (int) c1 - (int) 'U';
case L1_ss:
return (int) c1 - (int) 'S';
default:
{
int diff= (int) c1 - (int) c2;
if (diff)
return diff;
}
break;
}
}
}
}
/* A simple test of string lengths won't work -- we test to see
* which string ran out first */
return s1 < e1 ? 1 : s2 < e2 ? -1 : 0;
}
static
int my_strnncollsp_latin1_de(CHARSET_INFO * cs,
const uchar *s, uint slen,
const uchar *t, uint tlen)
{
for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
return my_strnncoll_latin1_de(cs,s,slen,t,tlen);
}
static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar * src, uint srclen)
{
const uchar *dest_orig = dest;
const uchar *de = dest + len;
const uchar *se = src + srclen;
while (src < se && dest < de)
{
uchar chr=sort_order_latin1_de[*src];
switch (chr) {
case L1_AE:
*dest++ = 'A';
if (dest < de)
*dest++ = 'E';
break;
case L1_OE:
*dest++ = 'O';
if (dest < de)
*dest++ = 'E';
break;
case L1_UE:
*dest++ = 'U';
if (dest < de)
*dest++ = 'E';
break;
case L1_ss:
*dest++ = 'S';
if (dest < de)
*dest++ = 'S';
break;
default:
*dest++= chr;
break;
}
++src;
}
return dest - dest_orig;
}
CHARSET_INFO my_charset_latin1_de =
{
31,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
"latin1", /* cs name */
"latin1_de", /* name */
"", /* comment */
ctype_latin1_de,
to_lower_latin1_de,
to_upper_latin1_de,
sort_order_latin1_de,
tab_8859_1_uni, /* tab_to_uni */
idx_uni_8859_1, /* tab_from_uni */
"","",
2, /* strxfrm_multiply */
my_strnncoll_latin1_de,
my_strnncollsp_latin1_de,
my_strnxfrm_latin1_de,
my_like_range_simple,
my_wildcmp_8bit, /* wildcmp */
1, /* mbmaxlen */
NULL, /* ismbchar */
NULL, /* ismbhead */
NULL, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
my_mb_wc_8bit, /* mb_wc */
my_wc_mb_8bit, /* wc_mb */
my_caseup_str_8bit,
my_casedn_str_8bit,
my_caseup_8bit,
my_casedn_8bit,
NULL, /* tosort */
my_strcasecmp_8bit,
my_strncasecmp_8bit,
my_hash_caseup_simple,
my_hash_sort_simple,
0,
my_snprintf_8bit,
my_long10_to_str_8bit,
my_longlong10_to_str_8bit,
my_fill_8bit,
my_strntol_8bit,
my_strntoul_8bit,
my_strntoll_8bit,
my_strntoull_8bit,
my_strntod_8bit,
my_scan_8bit
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment