From 1cd108ff973227a43f8ef13fe6f5180a13c2d6f8 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Wed, 18 Aug 2004 12:07:54 +0500 Subject: [PATCH] Many files: LIKE crashed mysqld for binary collations in some cases --- sql/item_cmpfunc.cc | 6 +++--- strings/ctype-big5.c | 2 +- strings/ctype-euc_kr.c | 2 +- strings/ctype-gb2312.c | 2 +- strings/ctype-gbk.c | 2 +- strings/ctype-latin1.c | 2 +- strings/ctype-sjis.c | 2 +- strings/ctype-tis620.c | 2 +- strings/ctype-ucs2.c | 2 +- strings/ctype-ujis.c | 2 +- strings/ctype-utf8.c | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c440a0491c5..23bdad1aae5 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2459,7 +2459,7 @@ void Item_func_like::turboBM_compute_suffixes(int *suff) *splm1 = pattern_len; - if (cs == &my_charset_bin) + if (!cs->sort_order) { int i; for (i = pattern_len - 2; i >= 0; i--) @@ -2562,7 +2562,7 @@ void Item_func_like::turboBM_compute_bad_character_shifts() for (i = bmBc; i < end; i++) *i = pattern_len; - if (cs == &my_charset_bin) + if (!cs->sort_order) { for (j = 0; j < plm1; j++) bmBc[(uint) (uchar) pattern[j]] = plm1 - j; @@ -2593,7 +2593,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const const int tlmpl= text_len - pattern_len; /* Searching */ - if (cs == &my_charset_bin) + if (!cs->sort_order) { while (j <= tlmpl) { diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index ff53f61c053..0955372e8c0 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -6347,7 +6347,7 @@ CHARSET_INFO my_charset_big5_bin= ctype_big5, to_lower_big5, to_upper_big5, - sort_order_big5, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index fd8659a181c..bcf66e2a828 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -8715,7 +8715,7 @@ CHARSET_INFO my_charset_euckr_bin= ctype_euc_kr, to_lower_euc_kr, to_upper_euc_kr, - sort_order_euc_kr, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index b9f61256717..e4e14259620 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -5765,7 +5765,7 @@ CHARSET_INFO my_charset_gb2312_bin= ctype_gb2312, to_lower_gb2312, to_upper_gb2312, - sort_order_gb2312, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 2ef75e27d9a..80876cac41f 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -9996,7 +9996,7 @@ CHARSET_INFO my_charset_gbk_bin= ctype_gbk, to_lower_gbk, to_upper_gbk, - sort_order_gbk, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 652794fa84d..f4717c51a1e 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -728,7 +728,7 @@ CHARSET_INFO my_charset_latin1_bin= ctype_latin1, to_lower_latin1, to_upper_latin1, - sort_order_latin1_de, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ cs_to_uni, /* tab_to_uni */ diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 5fd005f842e..65d096b96fc 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4615,7 +4615,7 @@ CHARSET_INFO my_charset_sjis_bin= ctype_sjis, to_lower_sjis, to_upper_sjis, - sort_order_sjis, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index c7d859a6ead..60f02e3146d 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -988,7 +988,7 @@ CHARSET_INFO my_charset_tis620_bin= ctype_tis620, to_lower_tis620, to_upper_tis620, - sort_order_tis620, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 20a5ff58d3a..645e2e49fc1 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1480,7 +1480,7 @@ CHARSET_INFO my_charset_ucs2_bin= ctype_ucs2, /* ctype */ to_lower_ucs2, /* to_lower */ to_upper_ucs2, /* to_upper */ - to_upper_ucs2, /* sort_order */ + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 3f53a07f527..746c31f37a0 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8502,7 +8502,7 @@ CHARSET_INFO my_charset_ujis_bin= ctype_ujis, to_lower_ujis, to_upper_ujis, - sort_order_ujis, + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */ diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index bf2d8a17fb4..f7a70afcb92 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2125,7 +2125,7 @@ CHARSET_INFO my_charset_utf8_bin= ctype_utf8, /* ctype */ to_lower_utf8, /* to_lower */ to_upper_utf8, /* to_upper */ - to_upper_utf8, /* sort_order */ + NULL, /* sort_order */ NULL, /* contractions */ NULL, /* sort_order_big*/ NULL, /* tab_to_uni */