summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
Diffstat (limited to 'strings')
-rwxr-xr-xstrings/CMakeLists.txt2
-rw-r--r--strings/Makefile.am4
-rw-r--r--strings/bzero.c10
-rw-r--r--strings/ctype-big5.c86
-rw-r--r--strings/ctype-cp932.c76
-rw-r--r--strings/ctype-euc_kr.c4
-rw-r--r--strings/ctype-eucjpms.c4
-rw-r--r--strings/ctype-gb2312.c4
-rw-r--r--strings/ctype-gbk.c86
-rw-r--r--strings/ctype-mb.c22
-rw-r--r--strings/ctype-sjis.c85
-rw-r--r--strings/ctype-uca.c4
-rw-r--r--strings/ctype-ujis.c4
-rw-r--r--strings/decimal.c3
-rwxr-xr-xstrings/make-ccc2
-rw-r--r--strings/strxmov.c1
-rw-r--r--strings/xml.c8
17 files changed, 50 insertions, 355 deletions
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 339fe7854c7..ec9e9a3a3af 100755
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -18,7 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUT
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-SET(STRINGS_SOURCES bchange.c bcmp.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
+SET(STRINGS_SOURCES bchange.c bfill.c bmove512.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c int2str.c
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 94e24045d03..9b0c1a33250 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -79,7 +79,3 @@ test_decimal$(EXEEXT): decimal.c $(pkglib_LIBRARIES)
$(CP) $(srcdir)/decimal.c ./test_decimal.c
$(LINK) $(FLAGS) -DMAIN ./test_decimal.c $(LDADD) $(pkglib_LIBRARIES)
$(RM) -f ./test_decimal.c
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
-
diff --git a/strings/bzero.c b/strings/bzero.c
index b720de65eed..59c7a19385e 100644
--- a/strings/bzero.c
+++ b/strings/bzero.c
@@ -35,10 +35,10 @@
#if VaxAsm
-static void _bzero64 _A((char *dst,int len));
+static void _bzero64 _A((void *dst,int len));
void bzero(dst, len)
-char *dst;
+void *dst;
uint len;
{
while ((int) len >= 64*K)
@@ -51,7 +51,7 @@ uint len;
}
_bzero64(dst, len)
-char *dst;
+void *dst;
int len;
{
asm("movc5 $0,*4(ap),$0,8(ap),*4(ap)");
@@ -62,7 +62,7 @@ int len;
#if defined(MC68000) && defined(DS90)
void bzero(dst, len)
-char *dst;
+void *dst;
uint len;
{
bfill(dst,len,0); /* This is very optimized ! */
@@ -71,7 +71,7 @@ uint len;
#else
void bzero(dst, len)
-register char *dst;
+register void *dst;
register uint len;
{
while (len-- != 0) *dst++ = 0;
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 4c29886d307..c9450973866 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -377,86 +377,6 @@ static int my_strxfrm_big5(uchar *dest, const uchar *src, int len)
#endif
-/*
-** Calculate min_str and max_str that ranges a LIKE string.
-** Arguments:
-** ptr Pointer to LIKE string.
-** ptr_length Length of LIKE string.
-** escape Escape character in LIKE. (Normally '\').
-** All escape characters should be removed from min_str and max_str
-** res_length Length of min_str and max_str.
-** min_str Smallest case sensitive string that ranges LIKE.
-** Should be space padded to res_length.
-** max_str Largest case sensitive string that ranges LIKE.
-** Normally padded with the biggest character sort value.
-**
-** The function should return 0 if ok and 1 if the LIKE string can't be
-** optimized !
-*/
-
-#define max_sort_char ((char) 255)
-
-static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str, char *max_str,
- size_t *min_length, size_t *max_length)
-{
- const char *end= ptr + ptr_length;
- char *min_org=min_str;
- char *min_end=min_str+res_length;
- size_t charlen= res_length / cs->mbmaxlen;
-
- for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--)
- {
- if (ptr+1 != end && isbig5code(ptr[0],ptr[1]))
- {
- *min_str++= *max_str++ = *ptr++;
- *min_str++= *max_str++ = *ptr;
- continue;
- }
- if (*ptr == escape && ptr+1 != end)
- {
- ptr++; /* Skip escape */
- if (isbig5code(ptr[0], ptr[1]))
- *min_str++= *max_str++ = *ptr++;
- if (min_str < min_end)
- *min_str++= *max_str++= *ptr;
- continue;
- }
- if (*ptr == w_one) /* '_' in SQL */
- {
- *min_str++='\0'; /* This should be min char */
- *max_str++=max_sort_char;
- continue;
- }
- if (*ptr == w_many) /* '%' in SQL */
- {
- /*
- Calculate length of keys:
- 'a\0\0... is the smallest possible string when we have space expand
- a\ff\ff... is the biggest possible string
- */
- *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- do {
- *min_str++ = 0;
- *max_str++ = max_sort_char;
- } while (min_str != min_end);
- return 0;
- }
- *min_str++= *max_str++ = *ptr;
- }
-
- *min_length= *max_length= (size_t) (min_str-min_org);
- while (min_str != min_end)
- *min_str++= *max_str++= ' ';
- return 0;
-}
-
-
static uint ismbchar_big5(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
@@ -6338,7 +6258,7 @@ static MY_COLLATION_HANDLER my_collation_big5_chinese_ci_handler =
my_strnncollsp_big5,
my_strnxfrm_big5,
my_strnxfrmlen_simple,
- my_like_range_big5,
+ my_like_range_mb,
my_wildcmp_mb,
my_strcasecmp_mb,
my_instr_mb,
@@ -6402,7 +6322,7 @@ struct charset_info_st my_charset_big5_chinese_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xF9D5, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
@@ -6435,7 +6355,7 @@ struct charset_info_st my_charset_big5_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xF9FE, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_big5_handler,
diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c
index 2caffe7aea2..4453516c7b3 100644
--- a/strings/ctype-cp932.c
+++ b/strings/ctype-cp932.c
@@ -306,76 +306,6 @@ static size_t my_strnxfrm_cp932(CHARSET_INFO *cs __attribute__((unused)),
}
-/*
-** Calculate min_str and max_str that ranges a LIKE string.
-** Arguments:
-** ptr Pointer to LIKE string.
-** ptr_length Length of LIKE string.
-** escape Escape character in LIKE. (Normally '\').
-** All escape characters should be removed from min_str and max_str
-** res_length Length of min_str and max_str.
-** min_str Smallest case sensitive string that ranges LIKE.
-** Should be space padded to res_length.
-** max_str Largest case sensitive string that ranges LIKE.
-** Normally padded with the biggest character sort value.
-**
-** The function should return 0 if ok and 1 if the LIKE string can't be
-** optimized !
-*/
-
-#define max_sort_char ((char) 255)
-
-static my_bool my_like_range_cp932(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str,char *max_str,
- size_t *min_length, size_t *max_length)
-{
- const char *end=ptr+ptr_length;
- char *min_org=min_str;
- char *min_end=min_str+res_length;
-
- while (ptr < end && min_str < min_end) {
- if (ismbchar_cp932(cs, ptr, end)) {
- *min_str++ = *max_str++ = *ptr++;
- if (min_str < min_end)
- *min_str++ = *max_str++ = *ptr++;
- continue;
- }
- if (*ptr == escape && ptr+1 < end) {
- ptr++; /* Skip escape */
- if (ismbchar_cp932(cs, ptr, end))
- *min_str++ = *max_str++ = *ptr++;
- if (min_str < min_end)
- *min_str++ = *max_str++ = *ptr++;
- continue;
- }
- if (*ptr == w_one) { /* '_' in SQL */
- *min_str++ = '\0'; /* This should be min char */
- *max_str++ = max_sort_char;
- ptr++;
- continue;
- }
- if (*ptr == w_many)
- { /* '%' in SQL */
- *min_length = (size_t)(min_str - min_org);
- *max_length = res_length;
- do
- {
- *min_str++= 0;
- *max_str++= max_sort_char;
- } while (min_str < min_end);
- return 0;
- }
- *min_str++ = *max_str++ = *ptr++;
- }
- *min_length = *max_length = (size_t) (min_str - min_org);
- while (min_str < min_end)
- *min_str++ = *max_str++ = ' '; /* Because if key compression */
- return 0;
-}
-
/* page 0 0x00A1-0x00DF */
static const uint16 tab_cp932_uni0[]={
0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67,0xFF68,
@@ -5467,7 +5397,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_cp932,
my_strnxfrm_cp932,
my_strnxfrmlen_simple,
- my_like_range_cp932,
+ my_like_range_mb,
my_wildcmp_mb, /* wildcmp */
my_strcasecmp_8bit,
my_instr_mb,
@@ -5533,7 +5463,7 @@ struct charset_info_st my_charset_cp932_japanese_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFCFC, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -5565,7 +5495,7 @@ struct charset_info_st my_charset_cp932_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFCFC, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index a5d5c1ee6ea..c16793a9539 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8762,7 +8762,7 @@ struct charset_info_st my_charset_euckr_korean_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -8795,7 +8795,7 @@ struct charset_info_st my_charset_euckr_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c
index 119135c7515..d954c618ed4 100644
--- a/strings/ctype-eucjpms.c
+++ b/strings/ctype-eucjpms.c
@@ -8710,7 +8710,7 @@ struct charset_info_st my_charset_eucjpms_japanese_ci=
1, /* mbminlen */
3, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -8743,7 +8743,7 @@ struct charset_info_st my_charset_eucjpms_bin=
1, /* mbminlen */
3, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad_char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 641fe2ea24e..37d0e44a4c6 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5790,7 +5790,7 @@ struct charset_info_st my_charset_gb2312_chinese_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xF7FE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -5822,7 +5822,7 @@ struct charset_info_st my_charset_gb2312_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xF7FE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 46b711d92be..bb9426a4b08 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -2689,86 +2689,6 @@ static size_t my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
}
-/*
-** Calculate min_str and max_str that ranges a LIKE string.
-** Arguments:
-** ptr Pointer to LIKE string.
-** ptr_length Length of LIKE string.
-** escape Escape character in LIKE. (Normally '\').
-** All escape characters should be removed from min_str and max_str
-** res_length Length of min_str and max_str.
-** min_str Smallest case sensitive string that ranges LIKE.
-** Should be space padded to res_length.
-** max_str Largest case sensitive string that ranges LIKE.
-** Normally padded with the biggest character sort value.
-**
-** The function should return 0 if ok and 1 if the LIKE string can't be
-** optimized !
-*/
-
-#define max_sort_char ((uchar) 255)
-
-static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str,char *max_str,
- size_t *min_length,size_t *max_length)
-{
- const char *end= ptr + ptr_length;
- char *min_org=min_str;
- char *min_end=min_str+res_length;
- size_t charlen= res_length / cs->mbmaxlen;
-
- for (; ptr != end && min_str != min_end && charlen > 0; ptr++, charlen--)
- {
- if (ptr+1 != end && isgbkcode(ptr[0],ptr[1]))
- {
- *min_str++= *max_str++ = *ptr++;
- *min_str++= *max_str++ = *ptr;
- continue;
- }
- if (*ptr == escape && ptr+1 != end)
- {
- ptr++; /* Skip escape */
- if (isgbkcode(ptr[0], ptr[1]))
- *min_str++= *max_str++ = *ptr;
- if (min_str < min_end)
- *min_str++= *max_str++= *ptr;
- continue;
- }
- if (*ptr == w_one) /* '_' in SQL */
- {
- *min_str++='\0'; /* This should be min char */
- *max_str++=max_sort_char;
- continue;
- }
- if (*ptr == w_many) /* '%' in SQL */
- {
- /*
- Calculate length of keys:
- 'a\0\0... is the smallest possible string when we have space expand
- a\ff\ff... is the biggest possible string
- */
- *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- do {
- *min_str++= 0;
- *max_str++= max_sort_char;
- } while (min_str != min_end);
- return 0;
- }
- *min_str++= *max_str++ = *ptr;
- }
-
- *min_length= *max_length = (size_t) (min_str - min_org);
- while (min_str != min_end)
- *min_str++= *max_str++= ' '; /* Because if key compression */
- return 0;
-}
-
-
static uint ismbchar_gbk(CHARSET_INFO *cs __attribute__((unused)),
const char* p, const char *e)
{
@@ -9982,7 +9902,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_gbk,
my_strnxfrm_gbk,
my_strnxfrmlen_simple,
- my_like_range_gbk,
+ my_like_range_mb,
my_wildcmp_mb,
my_strcasecmp_mb,
my_instr_mb,
@@ -10047,7 +9967,7 @@ struct charset_info_st my_charset_gbk_chinese_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xA967, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -10079,7 +9999,7 @@ struct charset_info_st my_charset_gbk_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 6bb7977c294..ad9edf18bbe 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -498,7 +498,9 @@ static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
DESCRIPTION
Write max key:
- for non-Unicode character sets:
- just set to 255.
+ just bfill using max_sort_char if max_sort_char is one byte.
+ In case when max_sort_char is two bytes, fill with double-byte pairs
+ and optionally pad with a single space character.
- for Unicode character set (utf-8):
create a buffer with multibyte representation of the max_sort_char
character, and copy it into max_str in a loop.
@@ -510,12 +512,20 @@ static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
if (!(cs->state & MY_CS_UNICODE))
{
- bfill(str, end - str, 255);
- return;
+ if (cs->max_sort_char <= 255)
+ {
+ bfill(str, end - str, cs->max_sort_char);
+ return;
+ }
+ buf[0]= cs->max_sort_char >> 8;
+ buf[1]= cs->max_sort_char & 0xFF;
+ buflen= 2;
+ }
+ else
+ {
+ buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf,
+ (uchar*) buf + sizeof(buf));
}
-
- buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf,
- (uchar*) buf + sizeof(buf));
DBUG_ASSERT(buflen > 0);
do
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index 81d1c57412d..a79eff70683 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -304,85 +304,6 @@ static size_t my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
}
-/*
-** Calculate min_str and max_str that ranges a LIKE string.
-** Arguments:
-** ptr Pointer to LIKE string.
-** ptr_length Length of LIKE string.
-** escape Escape character in LIKE. (Normally '\').
-** All escape characters should be removed from min_str and max_str
-** res_length Length of min_str and max_str.
-** min_str Smallest case sensitive string that ranges LIKE.
-** Should be space padded to res_length.
-** max_str Largest case sensitive string that ranges LIKE.
-** Normally padded with the biggest character sort value.
-**
-** The function should return 0 if ok and 1 if the LIKE string can't be
-** optimized !
-*/
-
-#define max_sort_char ((char) 255)
-
-static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,size_t ptr_length,
- pbool escape, pbool w_one, pbool w_many,
- size_t res_length,
- char *min_str,char *max_str,
- size_t *min_length,size_t *max_length)
-{
- const char *end= ptr + ptr_length;
- char *min_org=min_str;
- char *min_end=min_str+res_length;
- size_t charlen= res_length / cs->mbmaxlen;
-
- for ( ; ptr < end && min_str < min_end && charlen > 0 ; charlen--)
- {
- if (ismbchar_sjis(cs, ptr, end)) {
- *min_str++ = *max_str++ = *ptr++;
- if (min_str < min_end)
- *min_str++ = *max_str++ = *ptr++;
- continue;
- }
- if (*ptr == escape && ptr+1 < end) {
- ptr++; /* Skip escape */
- if (ismbchar_sjis(cs, ptr, end))
- *min_str++ = *max_str++ = *ptr++;
- if (min_str < min_end)
- *min_str++ = *max_str++ = *ptr++;
- continue;
- }
- if (*ptr == w_one) { /* '_' in SQL */
- *min_str++ = '\0'; /* This should be min char */
- *max_str++ = max_sort_char;
- ptr++;
- continue;
- }
- if (*ptr == w_many)
- { /* '%' in SQL */
- /*
- Calculate length of keys:
- 'a\0\0... is the smallest possible string when we have space expand
- a\ff\ff... is the biggest possible string
- */
- *min_length= ((cs->state & MY_CS_BINSORT) ? (size_t) (min_str - min_org) :
- res_length);
- *max_length= res_length;
- do
- {
- *min_str++= 0;
- *max_str++= max_sort_char;
- } while (min_str < min_end);
- return 0;
- }
- *min_str++ = *max_str++ = *ptr++;
- }
-
- *min_length= *max_length= (size_t) (min_str - min_org);
- while (min_str != min_end)
- *min_str++= *max_str++= ' '; /* Because if key compression */
- return 0;
-}
-
/* page 0 0x00A1-0x00DF */
static const uint16 tab_sjis_uni0[]={
0xFF61,0xFF62,0xFF63,0xFF64,0xFF65,0xFF66,0xFF67,0xFF68,
@@ -4628,7 +4549,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_strnncollsp_sjis,
my_strnxfrm_sjis,
my_strnxfrmlen_simple,
- my_like_range_sjis,
+ my_like_range_mb,
my_wildcmp_mb, /* wildcmp */
my_strcasecmp_8bit,
my_instr_mb,
@@ -4694,7 +4615,7 @@ struct charset_info_st my_charset_sjis_japanese_ci=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFCFC, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -4726,7 +4647,7 @@ struct charset_info_st my_charset_sjis_bin=
1, /* mbminlen */
2, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFCFC, /* max_sort_char */
' ', /* pad char */
1, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
index 7f170ca3b40..932f58d142f 100644
--- a/strings/ctype-uca.c
+++ b/strings/ctype-uca.c
@@ -7006,7 +7006,7 @@ static my_uca_scanner_handler my_ucs2_uca_scanner_handler=
my_uca_scanner_next_ucs2
};
-#endif
+#endif /* HAVE_CHARSET_ucs2 */
/*
@@ -8836,7 +8836,7 @@ struct charset_info_st my_charset_ucs2_croatian_uca_ci=
};
-#endif
+#endif /* HAVE_CHARSET_ucs2 */
#ifdef HAVE_CHARSET_utf8
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index 3adee2cff07..4ee26acdc4c 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8567,7 +8567,7 @@ struct charset_info_st my_charset_ujis_japanese_ci=
1, /* mbminlen */
3, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
@@ -8600,7 +8600,7 @@ struct charset_info_st my_charset_ujis_bin=
1, /* mbminlen */
3, /* mbmaxlen */
0, /* min_sort_char */
- 255, /* max_sort_char */
+ 0xFEFE, /* max_sort_char */
' ', /* pad char */
0, /* escape_with_backslash_is_dangerous */
&my_charset_handler,
diff --git a/strings/decimal.c b/strings/decimal.c
index 631750cf219..236b62b9296 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1934,8 +1934,7 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
int decimal_intg(decimal_t *from)
{
int res;
- dec1 *tmp_res;
- tmp_res= remove_leading_zeroes(from, &res);
+ remove_leading_zeroes(from, &res);
return res;
}
diff --git a/strings/make-ccc b/strings/make-ccc
index 78d5ad1ce42..93be2bbf862 100755
--- a/strings/make-ccc
+++ b/strings/make-ccc
@@ -1,3 +1,3 @@
-ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include -O -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c atof.c bchange.c bcmp.c bfill.c bmove.c bmove512.c bmove_upp.c ct_init.c ctype-latin1.c int2str.c is_prefix.c llstr.c longlong2str.c r_strinstr.c str2int.c strappend.c strcend.c strcont.c strend.c strfill.c strinstr.c strmake.c strmov.c strnmov.c strstr.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c
+ccc -DHAVE_CONFIG_H -I. -I. -I.. -I./../include -I../include -O -DDBUG_OFF -fast -O3 -fomit-frame-pointer -c atof.c bchange.c bfill.c bmove.c bmove512.c bmove_upp.c ct_init.c ctype-latin1.c int2str.c is_prefix.c llstr.c longlong2str.c r_strinstr.c str2int.c strappend.c strcend.c strcont.c strend.c strfill.c strinstr.c strmake.c strmov.c strnmov.c strstr.c strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c
rm libmystrings.a
ar -cr libmystrings.a atof.o
diff --git a/strings/strxmov.c b/strings/strxmov.c
index 9dd2c936620..d5d81fd9274 100644
--- a/strings/strxmov.c
+++ b/strings/strxmov.c
@@ -32,7 +32,6 @@
#include <my_global.h>
#include "m_string.h"
-#include <stdarg.h>
char *strxmov(char *dst,const char *src, ...)
{
diff --git a/strings/xml.c b/strings/xml.c
index 1b697ec6b26..14da69e088a 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -123,16 +123,16 @@ static int my_xml_scan(MY_XML_PARSER *p,MY_XML_ATTR *a)
a->beg=p->cur;
a->end=p->cur;
- if ((p->end - p->cur > 3) && !bcmp(p->cur,"<!--",4))
+ if ((p->end - p->cur > 3) && !bcmp((uchar*) p->cur, (uchar*) "<!--",4))
{
- for (; (p->cur < p->end) && bcmp(p->cur, "-->", 3); p->cur++)
+ for (; (p->cur < p->end) && bcmp((uchar*) p->cur, (uchar*) "-->", 3); p->cur++)
{}
- if (!bcmp(p->cur, "-->", 3))
+ if (!bcmp((uchar*) p->cur, (uchar*) "-->", 3))
p->cur+=3;
a->end=p->cur;
lex=MY_XML_COMMENT;
}
- else if (!bcmp(p->cur, "<![CDATA[",9))
+ else if (!bcmp((uchar*) p->cur, (uchar*) "<![CDATA[",9))
{
p->cur+= 9;
for (; p->cur < p->end - 2 ; p->cur++)