Commit 9248c03e authored by unknown's avatar unknown

Always use USE_STRCOLL code

parent 4a03f8f4
......@@ -309,9 +309,6 @@
/* Use MySQL RAID */
#undef USE_RAID
/* Use strcoll() functions when comparing and sorting. */
#undef USE_STRCOLL
/* Program version */
#undef VERSION
......
......@@ -576,7 +576,6 @@ int sortcmp(const String *x,const String *y)
const char *t= y->ptr();
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
#ifdef USE_STRCOLL
if (use_strnxfrm(x->str_charset))
{
#ifndef CMP_ENDSPACE
......@@ -590,7 +589,6 @@ int sortcmp(const String *x,const String *y)
}
else
{
#endif /* USE_STRCOLL */
x_len-=len; // For easy end space test
y_len-=len;
if (x->str_charset->sort_order)
......@@ -633,9 +631,7 @@ int sortcmp(const String *x,const String *y)
#else
return (int) (x_len-y_len);
#endif /* CMP_ENDSPACE */
#ifdef USE_STRCOLL
}
#endif
}
......
......@@ -2256,9 +2256,6 @@ then
AC_DEFINE(USE_MB_IDENT)
fi
# Temporary hack for USE_STRCOLL
AC_DEFINE(USE_STRCOLL)
AC_SUBST(default_charset)
AC_DEFINE_UNQUOTED(DEFAULT_CHARSET_NAME,"$default_charset")
......
......@@ -53,9 +53,7 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
}
*key++= (uchar) (length=(uint) (end-pos));
memcpy((byte*) key,(byte*) pos,(size_t) length);
#ifdef USE_STRCOLL
if (!use_strnxfrm(default_charset_info))
#endif
{
if (type == HA_KEYTYPE_TEXT)
my_tosort(default_charset_info,(byte*) key,length);
......@@ -66,9 +64,7 @@ uint _nisam_make_key(register N_INFO *info, uint keynr, uchar *key, const char *
{
memcpy((byte*) key,(byte*) record+keyseg->base.start,
(size_t) keyseg->base.length);
#ifdef USE_STRCOLL
if (!use_strnxfrm(default_charset_info))
#endif
{
if (type == HA_KEYTYPE_TEXT)
my_tosort(default_charset_info,(byte*) key,(uint) keyseg->base.length);
......@@ -149,9 +145,7 @@ uint _nisam_pack_key(register N_INFO *info, uint keynr, uchar *key, uchar *old,
}
else
memcpy((byte*) key,old,(size_t) length);
#ifdef USE_STRCOLL
if (!use_strnxfrm(default_charset_info))
#endif
{
if (type == HA_KEYTYPE_TEXT)
my_tosort(default_charset_info,(byte*) key,length);
......
......@@ -331,7 +331,6 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
(int) *as : b_length;
end= a+ min(key_length,(uint) length);
#ifdef USE_STRCOLL
if (use_strnxfrm(default_charset_info)) {
if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY)
{
......@@ -349,7 +348,6 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
}
}
else
#endif
{
while (a < end)
if ((flag= (int) *a++ - (int) *b++))
......@@ -382,7 +380,6 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
}
else
{
#ifdef USE_STRCOLL
if (use_strnxfrm(default_charset_info)) {
if (((enum ha_base_keytype) keyseg->base.type) == HA_KEYTYPE_BINARY)
{
......@@ -400,7 +397,6 @@ int _nisam_key_cmp(register N_KEYSEG *keyseg, register uchar *a, register uchar
}
}
else
#endif
{
while (a < end)
if ((flag= (int) *a++ - (int) *b++))
......
......@@ -123,11 +123,9 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
if (param.sort_length == param.ref_length && records > param.max_rows)
records=param.max_rows; /* purecov: inspected */
#ifdef USE_STRCOLL
if (use_strnxfrm(charset) &&
!(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME))))
goto err;
#endif
memavl= thd->variables.sortbuff_size;
while (memavl >= MIN_SORT_MEMORY)
......@@ -200,10 +198,8 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
error =0;
err:
#ifdef USE_STRCOLL
if (param.tmp_buffer)
x_free(param.tmp_buffer);
#endif
x_free((gptr) sort_keys);
x_free((gptr) buffpek);
close_cached_file(&tempfile);
......@@ -494,7 +490,6 @@ static void make_sortkey(register SORTPARAM *param,
diff=0; /* purecov: inspected */
length=sort_field->length;
}
#ifdef USE_STRCOLL
if (use_strnxfrm(cs))
{
if (item->binary())
......@@ -520,15 +515,12 @@ static void make_sortkey(register SORTPARAM *param,
}
else
{
#endif
if (res->ptr() != (char*) to)
memcpy(to,res->ptr(),length);
bzero((char *)to+length,diff);
if (!item->binary())
my_tosort(cs, (char*) to,length);
#ifdef USE_STRCOLL
}
#endif
break;
}
case INT_RESULT:
......@@ -930,34 +922,27 @@ sortlength(SORT_FIELD *sortorder, uint s_length)
else
{
sortorder->length=sortorder->field->pack_length();
#ifdef USE_STRCOLL
if (!sortorder->field->binary())
{
CHARSET_INFO *cs=sortorder->field->charset();
if (use_strnxfrm(cs))
sortorder->length= sortorder->length*cs->strxfrm_multiply;
}
#endif
}
if (sortorder->field->maybe_null())
length++; // Place for NULL marker
}
else
{
#ifdef USE_STRCOLL
#endif
switch ((sortorder->result_type=sortorder->item->result_type())) {
case STRING_RESULT:
sortorder->length=sortorder->item->max_length;
#ifdef USE_STRCOLL
if (!sortorder->item->binary())
{
CHARSET_INFO *cs=sortorder->item->charset();
if (use_strnxfrm(cs))
sortorder->length= sortorder->length*cs->strxfrm_multiply;
}
#endif
break;
case INT_RESULT:
#if SIZEOF_LONG_LONG > 4
......
......@@ -38,9 +38,7 @@ typedef struct st_sort_param {
SORT_FIELD *end;
uchar *unique_buff;
bool not_killable;
#ifdef USE_STRCOLL
char* tmp_buffer;
#endif
} SORTPARAM;
......
......@@ -577,7 +577,6 @@ int sortcmp(const String *x,const String *y)
const char *t= y->ptr();
uint32 x_len=x->length(),y_len=y->length(),len=min(x_len,y_len);
#ifdef USE_STRCOLL
if (use_strnxfrm(x->str_charset))
{
#ifndef CMP_ENDSPACE
......@@ -591,7 +590,6 @@ int sortcmp(const String *x,const String *y)
}
else
{
#endif /* USE_STRCOLL */
x_len-=len; // For easy end space test
y_len-=len;
if (x->str_charset->sort_order)
......@@ -634,9 +632,7 @@ int sortcmp(const String *x,const String *y)
#else
return (int) (x_len-y_len);
#endif /* CMP_ENDSPACE */
#ifdef USE_STRCOLL
}
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment