Commit 4e06f1f5 authored by bar@bar.mysql.r18.ru's avatar bar@bar.mysql.r18.ru

German Phone book collation is always compiled

Some collation names have been renamed
parent 5e3155f1
...@@ -41,7 +41,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ ...@@ -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.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \ ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \
ctype-win1250ch.lo ctype-utf8.lo ctype-extra.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 ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo xml.lo
mystringsextra= strto.c mystringsextra= strto.c
......
...@@ -92,7 +92,7 @@ z ...@@ -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 latin1_f
A A
a a
...@@ -121,7 +121,7 @@ Y ...@@ -121,7 +121,7 @@ Y
y y
Z Z
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 latin1_f
A A
a a
...@@ -181,7 +181,7 @@ z ...@@ -181,7 +181,7 @@ z
ü ü
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
latin1_f_as latin1_f_as
A A
a a
...@@ -210,7 +210,7 @@ z ...@@ -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 latin1_f_as
A A
a a
...@@ -239,7 +239,7 @@ Y ...@@ -239,7 +239,7 @@ Y
y y
Z Z
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 latin1_f_as
A A
a a
...@@ -268,7 +268,7 @@ Y ...@@ -268,7 +268,7 @@ Y
y y
Z Z
z z
SELECT latin1_f COLLATE latin1_bin 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;
latin1_f_as latin1_f_as
A A
AD AD
...@@ -297,7 +297,7 @@ z ...@@ -297,7 +297,7 @@ z
ä ä
å å
ü ü
SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f;
latin1_f count(*) latin1_f count(*)
...@@ -329,7 +329,7 @@ Z 2 ...@@ -329,7 +329,7 @@ Z 2
Å 2 Å 2
Ä 2 Ä 2
ß 1 ß 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(*) latin1_f count(*)
A 4 A 4
AD 2 AD 2
...@@ -344,7 +344,7 @@ UE 2 ...@@ -344,7 +344,7 @@ UE 2
Ü 2 Ü 2
Y 2 Y 2
Z 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(*) latin1_f count(*)
A 2 A 2
AD 2 AD 2
...@@ -391,7 +391,7 @@ z 1 ...@@ -391,7 +391,7 @@ z 1
ü 1 ü 1
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
SELECT DISTINCT latin1_f FROM t1; SELECT DISTINCT latin1_f FROM t1;
latin1_f latin1_f
A A
AD AD
...@@ -406,7 +406,7 @@ UE ...@@ -406,7 +406,7 @@ UE
SS SS
ß ß
Z Z
SELECT DISTINCT latin1_f COLLATE latin1 FROM t1; SELECT DISTINCT latin1_f COLLATE latin1 FROM t1;
latin1_f COLLATE latin1 latin1_f COLLATE latin1
A A
AD AD
...@@ -421,8 +421,8 @@ UE ...@@ -421,8 +421,8 @@ UE
SS SS
ß ß
Z Z
SELECT DISTINCT latin1_f COLLATE latin1_de FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1;
latin1_f COLLATE latin1_de latin1_f COLLATE latin1_german2_ci
A A
AD AD
AE AE
...@@ -436,8 +436,8 @@ SS ...@@ -436,8 +436,8 @@ SS
ß ß
Y Y
Z Z
SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
latin1_f COLLATE latin1_ci_as latin1_f COLLATE latin1_general_ci
A A
AD AD
AE AE
...@@ -452,7 +452,7 @@ SS ...@@ -452,7 +452,7 @@ SS
ß ß
Y Y
Z Z
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
latin1_f COLLATE latin1_bin latin1_f COLLATE latin1_bin
A A
a a
...@@ -481,7 +481,7 @@ Y ...@@ -481,7 +481,7 @@ Y
y y
Z Z
z z
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1' COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
......
...@@ -58,8 +58,8 @@ INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); ...@@ -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;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1; 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_german2_ci;
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;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin;
--error 1251 --error 1251
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
...@@ -67,20 +67,20 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r; ...@@ -67,20 +67,20 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
--SELECT latin1_f COLLATE koi8r FROM t1 ; --SELECT latin1_f COLLATE koi8r FROM t1 ;
-- AS + ORDER BY -- AS + ORDER BY
SELECT latin1_f COLLATE latin1 AS latin1_f_as FROM t1 ORDER BY latin1_f_as; 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_german2_ci 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_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; SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
--error 1251 --error 1251
SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
-- GROUP BY -- GROUP BY
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; 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;
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;
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;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin;
--error 1251 --error 1251
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
...@@ -88,29 +88,29 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r; ...@@ -88,29 +88,29 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
-- DISTINCT -- DISTINCT
SELECT DISTINCT latin1_f FROM t1; SELECT DISTINCT latin1_f FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1 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_german2_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_ci_as FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
--error 1251 --error 1251
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
-- Aggregates -- Aggregates
--SELECT MAX(k COLLATE latin1_de) --SELECT MAX(k COLLATE latin1_german2_ci)
--FROM t1 --FROM t1
-- WHERE -- WHERE
--SELECT * --SELECT *
--FROM t1 --FROM t1
--WHERE (_latin1'Mu"ller' COLLATE latin1_de) = k --WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
--HAVING --HAVING
--SELECT * --SELECT *
--FROM t1 --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) ...@@ -553,7 +553,10 @@ uint get_charset_number(const char *charset_name)
for (cs= all_charsets; cs < all_charsets+255; ++cs) 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 cs[0]->number;
} }
return 0; /* this mimics find_type() */ return 0; /* this mimics find_type() */
......
...@@ -32,8 +32,8 @@ To make maintaining easier please: ...@@ -32,8 +32,8 @@ To make maintaining easier please:
<alias>iso_8859-2</alias> <alias>iso_8859-2</alias>
<alias>iso_8859-2:1987</alias> <alias>iso_8859-2:1987</alias>
<alias>l2</alias> <alias>l2</alias>
<collation name="czech" id="2" order="Czech" flag="compiled"/> <collation name="latin2_czech_ci" id="2" order="Czech" flag="compiled"/>
<collation name="latin2" id="9" flag="primary"> <collation name="latin2_general_ci" id="9" flag="primary">
<order>Hungarian</order> <order>Hungarian</order>
<order>Polish</order> <order>Polish</order>
<order>Romanian</order> <order>Romanian</order>
...@@ -42,16 +42,16 @@ To make maintaining easier please: ...@@ -42,16 +42,16 @@ To make maintaining easier please:
<order>Slovenian</order> <order>Slovenian</order>
<order>Sorbian</order> <order>Sorbian</order>
</collation> </collation>
<collation name="hungarian" id="21" order="Hungarian"/> <collation name="latin2_hungarian_ci" id="21" order="Hungarian"/>
<collation name="croat" id="27" order="Croatian"/> <collation name="latin2_croatian_ci" id="27" order="Croatian"/>
<collation name="latin2_bin" id="77" order="Binary" flag="binary"/> <collation name="latin2_bin" id="77" order="Binary" flag="binary"/>
</charset> </charset>
<charset name="dec8"> <charset name="dec8">
<family>Western</family> <family>Western</family>
<description>DEC West European</description> <description>DEC West European</description>
<collation name="dec_bin" id="69" order="Binary" flag="binary"/> <collation name="dec_bin" id="69" order="Binary" flag="binary"/>
<collation name="dec8" id="3" flag="primary"> <collation name="dec8" id="3" flag="primary">
<order>Dutch</order> <order>Dutch</order>
<order>English</order> <order>English</order>
<order>French</order> <order>French</order>
...@@ -93,12 +93,12 @@ To make maintaining easier please: ...@@ -93,12 +93,12 @@ To make maintaining easier please:
<alias>iso_8859-1:1987</alias> <alias>iso_8859-1:1987</alias>
<alias>l1</alias> <alias>l1</alias>
<alias>latin1</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="latin1" id="8" order="Finnish, Swedish" flag="primary"/>
<collation name="danish" id="15" order="Danish"/> <collation name="latin1_danish_ci" id="15" order="Danish"/>
<collation name="latin1_de" id="31" order="German DIN" flag="compiled"/> <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_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>Dutch</order>
<order>English</order> <order>English</order>
<order>French</order> <order>French</order>
...@@ -108,7 +108,7 @@ To make maintaining easier please: ...@@ -108,7 +108,7 @@ To make maintaining easier please:
<order>Pogtuguese</order> <order>Pogtuguese</order>
<order>Spanish</order> <order>Spanish</order>
</collation> </collation>
<collation name="latin1_cs_as" id="49"> <collation name="latin1_general_cs" id="49">
<order>Dutch</order> <order>Dutch</order>
<order>English</order> <order>English</order>
<order>French</order> <order>French</order>
...@@ -199,7 +199,7 @@ To make maintaining easier please: ...@@ -199,7 +199,7 @@ To make maintaining easier please:
</collation> </collation>
<collation name="win1251ukr" id="23" order="Depreciated"/> <collation name="win1251ukr" id="23" order="Depreciated"/>
<collation name="cp1251_bin" id="50" order="Binary" flag="binary"/> <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>Belarusian</order>
<order>Bulgarian</order> <order>Bulgarian</order>
<order>Macedonian</order> <order>Macedonian</order>
...@@ -208,7 +208,7 @@ To make maintaining easier please: ...@@ -208,7 +208,7 @@ To make maintaining easier please:
<order>Mongolian</order> <order>Mongolian</order>
<order>Ukrainian</order> <order>Ukrainian</order>
</collation> </collation>
<collation name="cp1251_cs_as" id="52"> <collation name="cp1251_cs" id="52">
<order>Belarusian</order> <order>Belarusian</order>
<order>Bulgarian</order> <order>Bulgarian</order>
<order>Macedonian</order> <order>Macedonian</order>
...@@ -256,15 +256,15 @@ To make maintaining easier please: ...@@ -256,15 +256,15 @@ To make maintaining easier please:
<alias>BalticRim</alias> <alias>BalticRim</alias>
<alias>iso-8859-13</alias> <alias>iso-8859-13</alias>
<alias>l7</alias> <alias>l7</alias>
<collation name="latin7_estonian_ci_as" id="20"> <collation name="latin7_estonian_ci" id="20">
<order>Estonian</order> <order>Estonian</order>
<flag>primary</flag> <flag>primary</flag>
</collation> </collation>
<collation name="latin7_ci_as" id="41"> <collation name="latin7_ci" id="41">
<order>Latvian</order> <order>Latvian</order>
<order>Lithuanian</order> <order>Lithuanian</order>
</collation> </collation>
<collation name="latin7_cs_as" id="42"> <collation name="latin7_cs" id="42">
<order>Latvian</order> <order>Latvian</order>
<order>Lithuanian</order> <order>Lithuanian</order>
</collation> </collation>
...@@ -341,11 +341,11 @@ To make maintaining easier please: ...@@ -341,11 +341,11 @@ To make maintaining easier please:
<order>Latvian</order> <order>Latvian</order>
<order>Lithuanian</order> <order>Lithuanian</order>
</collation> </collation>
<collation name="cp1257_ci_as" id="60"> <collation name="cp1257_ci" id="60">
<order>Latvian</order> <order>Latvian</order>
<order>Lithuanian</order> <order>Lithuanian</order>
</collation> </collation>
<collation name="cp1257_cs_as" id="61"> <collation name="cp1257_cs" id="61">
<order>Latvian</order> <order>Latvian</order>
<order>Lithuanian</order> <order>Lithuanian</order>
</collation> </collation>
...@@ -417,7 +417,8 @@ To make maintaining easier please: ...@@ -417,7 +417,8 @@ To make maintaining easier please:
<order>Sorbian</order> <order>Sorbian</order>
</collation> </collation>
<collation name="macce_bin" id="43" order="Binary" flag="binary"/> <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>Hungarian</order>
<order>Polish</order> <order>Polish</order>
<order>Romanian</order> <order>Romanian</order>
...@@ -426,16 +427,7 @@ To make maintaining easier please: ...@@ -426,16 +427,7 @@ To make maintaining easier please:
<order>Slovenian</order> <order>Slovenian</order>
<order>Sorbian</order> <order>Sorbian</order>
</collation> </collation>
<collation name="macce_ci_as" id="45"> <collation name="macce_cs" id="46">
<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">
<order>Hungarian</order> <order>Hungarian</order>
<order>Polish</order> <order>Polish</order>
<order>Romanian</order> <order>Romanian</order>
...@@ -463,17 +455,7 @@ To make maintaining easier please: ...@@ -463,17 +455,7 @@ To make maintaining easier please:
<order>Spanish</order> <order>Spanish</order>
</collation> </collation>
<collation name="macroman_bin" id="53" order="Binary" flag="binary"/> <collation name="macroman_bin" id="53" order="Binary" flag="binary"/>
<collation name="macroman_ci_as" id="54"> <collation name="macroman_ci" 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">
<order>Dutch</order> <order>Dutch</order>
<order>English</order> <order>English</order>
<order>French</order> <order>French</order>
...@@ -483,7 +465,8 @@ To make maintaining easier please: ...@@ -483,7 +465,8 @@ To make maintaining easier please:
<order>Pogtuguese</order> <order>Pogtuguese</order>
<order>Spanish</order> <order>Spanish</order>
</collation> </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>Dutch</order>
<order>English</order> <order>English</order>
<order>French</order> <order>French</order>
......
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
<collation name="cp1251_bin" flag="binary"/> <collation name="cp1251_bin" flag="binary"/>
<collation name="cp1251_ci_as"> <collation name="cp1251_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
</collation> </collation>
<collation name="cp1251_cs_as"> <collation name="cp1251_cs">
<!-- <!--
# Case insensitive, accent sensitive # Case insensitive, accent sensitive
# Sort order is correct for Belarusian, Bulgarian, Macedonian, # Sort order is correct for Belarusian, Bulgarian, Macedonian,
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
</collation> </collation>
<collation name="cp1257_ci_as"> <collation name="cp1257_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</collation> </collation>
<collation name="cp1257_cs_as"> <collation name="cp1257_cs">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</collation> </collation>
<collation name="german1"> <collation name="latin1_german1_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
</collation> </collation>
<collation name="danish"> <collation name="latin1_danish_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -159,13 +159,13 @@ ...@@ -159,13 +159,13 @@
</collation> </collation>
<collation name="latin1_de"/> <collation name="latin1_german2_ci"/>
<collation name="latin1_bin" flag="binary"/> <collation name="latin1_bin" flag="binary"/>
<collation name="latin1_ci_as"> <collation name="latin1_general_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
</collation> </collation>
<collation name="latin1_cs_as"> <collation name="latin1_general_cs">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</unicode> </unicode>
<collation name="latin2"> <collation name="latin2_general_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</collation> </collation>
<collation name="croat"> <collation name="latin2_croatian_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -137,10 +137,10 @@ ...@@ -137,10 +137,10 @@
</collation> </collation>
<collation name="czech"/> <collation name="latin2_czech_ci"/>
<collation name="hungarian"> <collation name="latin2_hungarian_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</unicode> </unicode>
<collation name="latin7_estonian_ci_as"> <collation name="latin7_estonian_ci">
<map> <map>
00 02 03 04 05 06 07 08 09 2E 2F 30 31 32 0A 0B 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 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
</collation> </collation>
<collation name="latin7_ci_as"> <collation name="latin7_ci">
<!-- Created for case-sensitive record search --> <!-- Created for case-sensitive record search -->
<!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv --> <!-- by Andis Grasis & Rihards Grasis e-mail:andis@cata.lv -->
<map> <map>
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</collation> </collation>
<collation name="latin7_cs_as"> <collation name="latin7_cs">
<!-- Created for case-insensitive record search --> <!-- Created for case-insensitive record search -->
<!-- Created by Andis & Rihards --> <!-- Created by Andis & Rihards -->
<map> <map>
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
</collation> </collation>
<collation name="macce_ci_as"> <collation name="macce_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
</collation> </collation>
<collation name="macce_cs_as"> <collation name="macce_cs">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
</map> </map>
</collation> </collation>
<collation name="macroman_ci_as"> <collation name="macroman_ci">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
...@@ -156,7 +156,7 @@ ...@@ -156,7 +156,7 @@
</map> </map>
</collation> </collation>
<collation name="macroman_cs_as"> <collation name="macroman_cs">
<map> <map>
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 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 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) ...@@ -1416,15 +1416,12 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
static bool write_collation(Protocol *protocol, CHARSET_INFO *cs) static bool write_collation(Protocol *protocol, CHARSET_INFO *cs)
{ {
char flags[4];
protocol->prepare_for_resend(); protocol->prepare_for_resend();
protocol->store(cs->csname, system_charset_info); protocol->store(cs->csname, system_charset_info);
protocol->store(cs->name, system_charset_info); protocol->store(cs->name, system_charset_info);
protocol->store_short((longlong) cs->number); protocol->store_short((longlong) cs->number);
flags[0]='\0'; protocol->store((cs->state & MY_CS_PRIMARY) ? "Y" : "",system_charset_info);
if (cs->state & MY_CS_PRIMARY) protocol->store((cs->state & MY_CS_COMPILED)? "Y" : "",system_charset_info);
strcat(flags,"def");
protocol->store(flags, system_charset_info);
protocol->store_short((longlong) cs->strxfrm_multiply); protocol->store_short((longlong) cs->strxfrm_multiply);
return protocol->write(); return protocol->write();
} }
...@@ -1443,8 +1440,9 @@ int mysqld_show_collations(THD *thd, const char *wild) ...@@ -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("Charset",30));
field_list.push_back(new Item_empty_string("Collation",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_return_int("Id",11, FIELD_TYPE_SHORT));
field_list.push_back(new Item_empty_string("Flags",30)); field_list.push_back(new Item_empty_string("D",30));
field_list.push_back(new Item_return_int("strx_maxlen",3, FIELD_TYPE_SHORT)); 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)) if (protocol->send_fields(&field_list, 1))
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a ...@@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X # Exact one of ASSEMBLER_X
if ASSEMBLER_x86 if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s 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 else
if ASSEMBLER_sparc32 if ASSEMBLER_sparc32
# These file MUST all be on the same line!! Otherwise automake # These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile # 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 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 else
#no assembler #no assembler
ASRCS = ASRCS =
# These file MUST all be on the same line!! Otherwise automake # These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile # 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
endif endif
...@@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c ...@@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c
# Default charset definitions # Default charset definitions
EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \ 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-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 \ xml.c strto.c strings-x86.s \
longlong2str.c longlong2str-x86.s \ longlong2str.c longlong2str-x86.s \
strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
......
...@@ -607,11 +607,11 @@ int my_strnncollsp_czech(CHARSET_INFO * cs, ...@@ -607,11 +607,11 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
CHARSET_INFO my_charset_czech = CHARSET_INFO my_charset_czech =
{ {
2,0,0, /* number */ 2,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
"latin2", /* cs name */ "latin2", /* cs name */
"czech", /* name */ "latin2_czech_ci", /* name */
"", /* comment */ "", /* comment */
ctype_czech, ctype_czech,
to_lower_czech, to_lower_czech,
to_upper_czech, to_upper_czech,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "m_ctype.h" #include "m_ctype.h"
static my_wc_t latin1_uni[256]={ static uint16 latin1_uni[256]={
0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007, 0,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F, 0x0008,0x0009,0x000A,0x000B,0x000C,0x000D,0x000E,0x000F,
0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,
...@@ -177,19 +177,19 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)), ...@@ -177,19 +177,19 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO my_charset_latin1 = CHARSET_INFO my_charset_latin1 =
{ {
8,0,0, /* number */ 8,0,0, /* number */
MY_CS_COMPILED, /* state */ MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
"latin1", /* cs name */ "latin1", /* cs name */
"latin1", /* name */ "latin1", /* name */
"", /* comment */ "", /* comment */
ctype_latin1, ctype_latin1,
to_lower_latin1, to_lower_latin1,
to_upper_latin1, to_upper_latin1,
sort_order_latin1, sort_order_latin1,
NULL, /* tab_to_uni */ latin1_uni, /* tab_to_uni */
NULL, /* tab_from_uni */ NULL, /* tab_from_uni */
"","", "","",
2, /* strxfrm_multiply */ 0, /* strxfrm_multiply */
my_strnncoll_simple, my_strnncoll_simple,
my_strnncollsp_simple, my_strnncollsp_simple,
my_strnxfrm_simple, my_strnxfrm_simple,
...@@ -207,7 +207,7 @@ CHARSET_INFO my_charset_latin1 = ...@@ -207,7 +207,7 @@ CHARSET_INFO my_charset_latin1 =
my_casedn_str_8bit, my_casedn_str_8bit,
my_caseup_8bit, my_caseup_8bit,
my_casedn_8bit, my_casedn_8bit,
NULL, /* tosort */ my_tosort_8bit, /* tosort */
my_strcasecmp_8bit, my_strcasecmp_8bit,
my_strncasecmp_8bit, my_strncasecmp_8bit,
my_hash_caseup_simple, my_hash_caseup_simple,
...@@ -224,3 +224,261 @@ CHARSET_INFO my_charset_latin1 = ...@@ -224,3 +224,261 @@ CHARSET_INFO my_charset_latin1 =
my_strntod_8bit, my_strntod_8bit,
my_scan_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,
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 diff is collapsed.
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