Commit fa23b207 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi
Browse files

Fixes for German sorting order.

parent c526f5d2
Loading
Loading
Loading
Loading
+32 −1
Original line number Diff line number Diff line
@@ -748,7 +748,7 @@ is also available through the SQL interface as well.
@item
Full support for several different character sets, including
ISO-8859-1 (Latin1), big5, ujis, and more.  For example, the
ISO-8859-1 (Latin1), german, big5, ujis, and more.  For example, the
Scandinavian characters `@ringaccent{a}', `@"a' and `@"o' are allowed
in table and column names.
@@ -20442,6 +20442,35 @@ default-character-set=character-set-name
but normally this is never needed.
@menu
* German character set::        
@end menu
@node German character set,  , Character sets, Character sets
@subsubsection German character set
To get German sorting order, you should start @code{mysqld} with
@code{--default-character-set=latin_de}.  This will give you the following
characteristics.
When sorting and comparing string's the following mapping is done on the
strings before doing the comparison:
@example
ä  ->  ae
ö  ->  oe
ü  ->  ue
ß  ->  ss
@end example
All accented characters, except @code{'é'} and @code{É} are converted to
their un-accented counterpart.  All letters are converted to uppercase.
When comparing strings with @code{LIKE} the one -> two character mapping
is not done. All letters are converted to uppercase. Accent are removed
from all letters except: @code{Ü}, @code{ü}, @code{É}, @code{é}, @code{Ö},
@code{ö}, @code{Ä} and @code{ä}.
@node Languages, Adding character set, Character sets, Localization
@subsection Non-English Error Messages
@@ -46753,6 +46782,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet
@item
New character set @code{latin_de} which provides correct German sorting.
@item
@code{TRUNCATE TABLE} and @code{DELETE FROM table_name} are now separate
functions. One bonus is that @code{DELETE FROM table_name} now returns
the number of deleted rows.
+1 −1
Original line number Diff line number Diff line
@@ -1826,7 +1826,7 @@ CHARSETS_AVAILABLE="big5 cp1251 cp1257
                          latin1 latin1_de latin2 latin5 sjis swe7 tis620 ujis
                          usa7 win1250 win1251ukr"
CHARSETS_DEPRECATED="win1251"
DEFAULT_CHARSET=latin1_de
DEFAULT_CHARSET=latin1
AC_DIVERT_POP

AC_ARG_WITH(charset,
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

/* Remove all rows from a MyISAM table */
/* This only clears the status information;  The files are not truncated */
/* This only clears the status information and truncates the data file */

#include "myisamdef.h"

@@ -50,6 +50,8 @@ int mi_delete_all_rows(MI_INFO *info)

  myisam_log_command(MI_LOG_DELETE_ALL,info,(byte*) 0,0,0);
  VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
  if (my_chsize(info->dfile, 0, MYF(MY_WME)))
    goto err;
  allow_break();			/* Allow SIGHUP & SIGINT */
  DBUG_RETURN(0);

+13 −6
Original line number Diff line number Diff line
@@ -657,19 +657,19 @@ void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos)
int _mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
                     uchar *b, uint b_length, my_bool part_key)
{
  uint length= min(a_length,b_length);
  uchar *end= a+ length;
  int flag;

#ifdef USE_STRCOLL
  if (use_strcoll(charset_info))
  {
    if ((flag = my_strnncoll(charset_info, a, a_length, b, b_length)))
      return flag;
    /* QQ: This needs to work with part keys at some point */
    return my_strnncoll(charset_info, a, a_length, b, b_length);
  }
  else
#endif
  {
    uint length= min(a_length,b_length);
    uchar *end= a+ length;
    uchar *sort_order=charset_info->sort_order;
    while (a < end)
      if ((flag= (int) sort_order[*a++] - (int) sort_order[*b++]))
@@ -768,8 +768,15 @@ int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a,
      }
      else
      {
        uint length=(uint) (end-a);
        if ((flag=_mi_compare_text(keyseg->charset,a,length,b,length,
	uint length=(uint) (end-a), a_length=length, b_length=length;
	if (!(nextflag & SEARCH_PREFIX))
	{
	  while (a_length && a[a_length-1] == ' ')
	    a_length--;
	  while (b_length && b[b_length-1] == ' ')
	    b_length--;
	}
        if ((flag=_mi_compare_text(keyseg->charset,a,a_length,b,b_length,
                                   (my_bool) ((nextflag & SEARCH_PREFIX) &&
                                              next_key_length <= 0))))
          return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
+168 −0
Original line number Diff line number Diff line
a	b
a	35
ac	2
ad	4
	1
ae	3
	31
aeae	33
a	32
aeb	6
c	5
e	28
o	37
oc	15
od	18
	14
oe	17
a	16
oeb	20
c	19
o	30
q	34
s	21
ss	22
	23
ssa	25
a	27
b	24
ssc	26
u	36
uc	8
ud	10
ue	9
	11
ueb	12
c	7
uf	13
u	29
	38
	39
a	b
a	35
ac	2
ad	4
	1
ae	3
	31
aeae	33
a	32
aeb	6
c	5
e	28
o	37
oc	15
od	18
	14
oe	17
a	16
oeb	20
c	19
o	30
q	34
s	21
ss	22
	23
ssa	25
a	27
b	24
ssc	26
u	36
uc	8
ud	10
ue	9
	11
ueb	12
c	7
uf	13
u	29
	38
	39
a


u
uf
c
ueb

ue
ud
uc
u
ssc
b
a
ssa

ss
s
q
o
c
oeb
a
oe

od
oc
o
e
c
aeb
a
aeae

ae

ad
ac
a
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
a	b
a	16
c	19
o	30
a	b
	38
	39
a	b
a	35
ac	2
ad	4
ae	3
aeae	33
a	32
aeb	6
a	16
ssa	25
a	27
a	b
u	36
uc	8
ud	10
ue	9
ueb	12
uf	13
u	29
a	b
ss	22
ssa	25
ssc	26
strcmp('','ae')	strcmp('ae','')	strcmp('aeq','q')	strcmp('q','aeq')
0	0	0	0
strcmp('ss','')	strcmp('','ss')	strcmp('s','sss')	strcmp('q','ssq')
0	0	0	0
strcmp('','af')	strcmp('a','')	strcmp('','aeq')	strcmp('','aeaeq')
-1	-1	-1	-1
strcmp('ss','a')	strcmp('','ssa')	strcmp('sa','sssb')	strcmp('s','')
-1	-1	-1	-1
strcmp('','o')	strcmp('','u')	strcmp('','oeb')
-1	-1	-1
strcmp('af','')	strcmp('','a')	strcmp('aeq','')	strcmp('aeaeq','')
1	1	1	1
strcmp('a','ss')	strcmp('ssa','')	strcmp('sssb','sa')	strcmp('','s')
1	1	1	1
strcmp('u','a')	strcmp('u','')
1	1
Loading