Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1716 04/03/23 18:29:07 bar@stripped +1 -0
uca-dump.c:
Don't dump default implicit weights
strings/uca-dump.c
1.2 04/03/23 18:28:42 bar@stripped +30 -12
Don't dump default implicit weights
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: bar
# Host: bar.intranet.mysql.r18.ru
# Root: /usr/home/bar/mysql-4.1
--- 1.1/strings/uca-dump.c Mon Mar 22 15:14:04 2004
+++ 1.2/strings/uca-dump.c Tue Mar 23 18:28:42 2004
@@ -8,10 +8,10 @@
struct uca_item_st
{
uchar num;
- uint16 weight[4][8];
+ uint16 weight[4][9];
};
-#if 1
+#if 0
#define MY_UCA_NPAGES 1024
#define MY_UCA_NCHARS 64
#define MY_UCA_CMASK 63
@@ -30,8 +30,10 @@
struct uca_item_st uca[64*1024];
size_t code, page, w;
int pagemaxlen[MY_UCA_NPAGES];
+ int pageloaded[MY_UCA_NPAGES];
bzero(uca, sizeof(uca));
+ bzero(pageloaded, sizeof(pageloaded));
while (fgets(str,sizeof(str),stdin))
{
@@ -69,7 +71,10 @@
if (codenum>1)
{
- /* Multi-character weight */
+ /* Multi-character weight,
+ i.e. contraction.
+ Not supported yet.
+ */
continue;
}
@@ -97,10 +102,13 @@
s= endptr;
partnum++;
}
-
}
+ /* Mark that a character from this page was loaded */
+ pageloaded[code >> MY_UCA_PSHIFT]++;
}
+
+
/* Now set implicit weights */
for (code=0; code <= 0xFFFF; code++)
{
@@ -156,6 +164,12 @@
size_t nchars= 0;
size_t mchars;
+ /*
+ Skip this page if no weights were loaded
+ */
+
+ if (!pageloaded[page])
+ continue;
/*
Calculate maximum weight
@@ -176,9 +190,8 @@
maxnum= maxnum < num ? num : maxnum;
}
- if (!maxnum)
- maxnum=1;
-
+ maxnum++;
+
switch (maxnum)
{
case 0: mchars= 8; break;
@@ -190,14 +203,16 @@
}
pagemaxlen[page]= maxnum;
-
- printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n",
- page, page*MY_UCA_NCHARS, maxnum);
-
+
+
/*
Now print this page
*/
+
+ printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n",
+ page, page*MY_UCA_NCHARS, maxnum);
+
for (offs=0; offs < MY_UCA_NCHARS; offs++)
{
uint16 weight[8];
@@ -249,7 +264,10 @@
printf("uint16 *ucaw[%d]={\n",MY_UCA_NPAGES);
for (page=0; page < MY_UCA_NPAGES; page++)
{
- printf("page%03Xdata%s%s",page,page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n");
+ 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("};\n");
| Thread |
|---|
| • bk commit into 4.1 tree (bar:1.1716) | bar | 23 Mar |