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
......@@ -181,7 +181,7 @@ z
ü
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
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
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
......@@ -268,7 +268,7 @@ Y
y
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
A
AD
......@@ -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'
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f;
latin1_f count(*)
......@@ -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
......@@ -391,7 +391,7 @@ z 1
ü 1
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
COLLATION 'koi8r' is not valid for CHARACTER SET 'latin1'
SELECT DISTINCT latin1_f FROM t1;
SELECT DISTINCT latin1_f FROM t1;
latin1_f
A
AD
......@@ -406,7 +406,7 @@ UE
SS
ß
Z
SELECT DISTINCT latin1_f COLLATE latin1 FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1 FROM t1;
latin1_f COLLATE latin1
A
AD
......@@ -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
......@@ -452,7 +452,7 @@ SS
ß
Y
Z
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
latin1_f COLLATE latin1_bin
A
a
......@@ -481,7 +481,7 @@ Y
y
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'
SHOW CREATE TABLE t1;
Table Create Table
......
......@@ -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;
......@@ -67,20 +67,20 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r;
--SELECT latin1_f COLLATE koi8r FROM t1 ;
-- 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_bin 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_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;
SELECT latin1_f COLLATE koi8r AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
-- GROUP BY
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;
......@@ -88,29 +88,29 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r;
-- DISTINCT
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_bin FROM t1;
SELECT DISTINCT latin1_f FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1 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;
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,16 +42,16 @@ 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>
<charset name="dec8">
<family>Western</family>
<description>DEC West European</description>
<collation name="dec_bin" id="69" order="Binary" flag="binary"/>
<collation name="dec8" id="3" flag="primary">
<collation name="dec_bin" id="69" order="Binary" flag="binary"/>
<collation name="dec8" id="3" flag="primary">
<order>Dutch</order>
<order>English</order>
<order>French</order>
......@@ -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_bin" id="47" order="Binary" flag="binary"/>
<collation name="latin1_ci_as" id="48">
<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_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 \
......
......@@ -607,11 +607,11 @@ int my_strnncollsp_czech(CHARSET_INFO * cs,
CHARSET_INFO my_charset_czech =
{
2,0,0, /* number */
2,0,0, /* number */
MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
"latin2", /* cs name */
"czech", /* name */
"", /* comment */
"latin2", /* cs name */
"latin2_czech_ci", /* name */
"", /* comment */
ctype_czech,
to_lower_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 @@
#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,
......@@ -177,19 +177,19 @@ int my_wc_mb_latin1(CHARSET_INFO *cs __attribute__((unused)),
CHARSET_INFO my_charset_latin1 =
{
8,0,0, /* number */
MY_CS_COMPILED, /* state */
"latin1", /* cs name */
"latin1", /* name */
"", /* comment */
8,0,0, /* number */
MY_CS_COMPILED | MY_CS_PRIMARY, /* state */
"latin1", /* cs name */
"latin1", /* name */
"", /* comment */
ctype_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,7 +207,7 @@ CHARSET_INFO my_charset_latin1 =
my_casedn_str_8bit,
my_caseup_8bit,
my_casedn_8bit,
NULL, /* tosort */
my_tosort_8bit, /* tosort */
my_strcasecmp_8bit,
my_strncasecmp_8bit,
my_hash_caseup_simple,
......@@ -224,3 +224,261 @@ CHARSET_INFO my_charset_latin1 =
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,
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