summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-11-22 21:33:15 +0100
committerunknown <serg@serg.mylan>2004-11-22 21:33:15 +0100
commit6627dc7d1bd399e6b2bdac02c6878435f1a96a5d (patch)
tree9fd3b9eb87ff64ffe7e7374609beb327e419a87d /strings
parent443143f334b7ea452ff60cccd046e4242849e31a (diff)
parentf57d5412e47aa85941ea03ec3e63b017dac8c1ba (diff)
downloadmariadb-git-6627dc7d1bd399e6b2bdac02c6878435f1a96a5d.tar.gz
merged
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union Docs/Support/texi2html: Auto merged client/mysqltest.c: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/row/row0sel.c: Auto merged mysql-test/r/fulltext.result: Auto merged mysql-test/r/heap.result: Auto merged mysql-test/r/key.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/rpl000015.result: Auto merged mysql-test/r/rpl_log_pos.result: Auto merged mysql-test/r/rpl_rotate_logs.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/key.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/rpl000015.test: Auto merged mysql-test/t/rpl_log_pos.test: Auto merged mysql-test/t/rpl_rotate_logs.test: Auto merged mysql-test/t/subselect.test: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/ha_ndbcluster.h: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_do.cc: Auto merged sql/sql_table.cc: Auto merged
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype-czech.c12
-rw-r--r--strings/ctype-win1250ch.c12
-rw-r--r--strings/uca-dump.c91
3 files changed, 78 insertions, 37 deletions
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 6f9e9f74d35..2177a18504e 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -589,12 +589,12 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler =
CHARSET_INFO my_charset_latin2_czech_ci =
{
- 2,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
- "latin2", /* cs name */
- "latin2_czech_cs", /* name */
- "", /* comment */
- NULL, /* tailoring */
+ 2,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */
+ "latin2", /* cs name */
+ "latin2_czech_cs", /* name */
+ "", /* comment */
+ NULL, /* tailoring */
ctype_czech,
to_lower_czech,
to_upper_czech,
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index b4dbda3e8ed..4ada3d47bf5 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -624,12 +624,12 @@ static MY_COLLATION_HANDLER my_collation_czech_ci_handler =
CHARSET_INFO my_charset_cp1250_czech_ci =
{
- 34,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
- "cp1250", /* cs name */
- "cp1250_czech_cs", /* name */
- "", /* comment */
- NULL, /* tailoring */
+ 34,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */
+ "cp1250", /* cs name */
+ "cp1250_czech_cs", /* name */
+ "", /* comment */
+ NULL, /* tailoring */
ctype_win1250ch,
to_lower_win1250ch,
to_upper_win1250ch,
diff --git a/strings/uca-dump.c b/strings/uca-dump.c
index 6836c321526..db5cb7e999a 100644
--- a/strings/uca-dump.c
+++ b/strings/uca-dump.c
@@ -23,13 +23,14 @@ struct uca_item_st
#define MY_UCA_PSHIFT 8
#endif
+static char *pname[]= {"", "2", "3"};
+
int main(int ac, char **av)
{
char str[256];
char *weights[64];
struct uca_item_st uca[64*1024];
- size_t code, page, w;
- int pagemaxlen[MY_UCA_NPAGES];
+ size_t code, w;
int pageloaded[MY_UCA_NPAGES];
bzero(uca, sizeof(uca));
@@ -155,14 +156,20 @@ int main(int ac, char **av)
printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK);
printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT);
- for (w=0; w<1; w++)
+ for (w=0; w<3; w++)
{
+ size_t page;
+ int pagemaxlen[MY_UCA_NPAGES];
+
for (page=0; page < MY_UCA_NPAGES; page++)
{
size_t offs;
size_t maxnum= 0;
size_t nchars= 0;
size_t mchars;
+ size_t ndefs= 0;
+
+ pagemaxlen[page]= 0;
/*
Skip this page if no weights were loaded
@@ -183,15 +190,36 @@ int main(int ac, char **av)
code= page*MY_UCA_NCHARS+offs;
/* Calculate only non-zero weights */
- num=0;
- for (i=0; i < uca[code].num; i++)
+ for (num=0, i=0; i < uca[code].num; i++)
if (uca[code].weight[w][i])
num++;
maxnum= maxnum < num ? num : maxnum;
+
+ /* Check if default weight */
+ if (w == 1 && num == 1)
+ {
+ /* 0020 0000 ... */
+ if (uca[code].weight[w][0] == 0x0020)
+ ndefs++;
+ }
+ else if (w == 2 && num == 1)
+ {
+ /* 0002 0000 ... */
+ if (uca[code].weight[w][0] == 0x0002)
+ ndefs++;
+ }
}
maxnum++;
+ /*
+ If the page have only default weights
+ then no needs to dump it, skip.
+ */
+ if (ndefs == MY_UCA_NCHARS)
+ {
+ continue;
+ }
switch (maxnum)
{
case 0: mchars= 8; break;
@@ -210,8 +238,8 @@ int main(int ac, char **av)
*/
- printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n",
- page, page*MY_UCA_NCHARS, maxnum);
+ printf("uint16 page%03Xdata%s[]= { /* %04X (%d weights per char) */\n",
+ page, pname[w], page*MY_UCA_NCHARS, maxnum);
for (offs=0; offs < MY_UCA_NCHARS; offs++)
{
@@ -234,7 +262,17 @@ int main(int ac, char **av)
for (i=0; i < maxnum; i++)
{
- printf("0x%04X",(int)weight[i]);
+ /*
+ Invert weights for secondary level to
+ sort upper case letters before their
+ lower case counter part.
+ */
+ int tmp= weight[i];
+ if (w == 2 && tmp)
+ tmp= (int)(0x100 - weight[i]);
+
+
+ printf("0x%04X", tmp);
if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum))
printf(",");
nchars++;
@@ -251,25 +289,28 @@ int main(int ac, char **av)
}
printf("};\n\n");
}
- }
- printf("uchar ucal[%d]={\n",MY_UCA_NPAGES);
- for (page=0; page < MY_UCA_NPAGES; page++)
- {
- printf("%d%s%s",pagemaxlen[page],page<MY_UCA_NPAGES-1?",":"",(page+1) % 16 ? "":"\n");
- }
- printf("};\n");
-
-
- printf("uint16 *ucaw[%d]={\n",MY_UCA_NPAGES);
- for (page=0; page < MY_UCA_NPAGES; page++)
- {
- if (!pageloaded[page])
- printf("NULL %s%s",page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n");
- else
- printf("page%03Xdata%s%s",page,page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n");
+ printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES);
+ for (page=0; page < MY_UCA_NPAGES; page++)
+ {
+ printf("%d%s%s",pagemaxlen[page],page<MY_UCA_NPAGES-1?",":"",(page+1) % 16 ? "":"\n");
+ }
+ printf("};\n");
+
+
+ printf("uint16 *uca_weight%s[%d]={\n", pname[w], MY_UCA_NPAGES);
+ for (page=0; page < MY_UCA_NPAGES; page++)
+ {
+ const char *comma= page < MY_UCA_NPAGES-1 ? "," : "";
+ const char *nline= (page+1) % 4 ? "" : "\n";
+ if (!pagemaxlen[page])
+ printf("NULL %s%s", comma , nline);
+ else
+ printf("page%03Xdata%s%s%s", page, pname[w], comma, nline);
+ }
+ printf("};\n");
}
- printf("};\n");
+
printf("int main(void){ return 0;};\n");
return 0;