summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-11 01:40:52 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-11 01:40:52 +0300
commit34925f8d823c700c939f0622b6af85001458a226 (patch)
tree6a962f88c6b25e60b6f09ab8b8c7eb0cbb47bc22 /myisam
parent354882c8ce232770b2f3604cbcd5142aad6b002c (diff)
downloadmariadb-git-34925f8d823c700c939f0622b6af85001458a226.tar.gz
Fixes for German sorting order.
Docs/manual.texi: Update for German sorting configure.in: Don't make the German sort order default myisam/mi_delete_all.c: Truncate files on DELETE FROM table_name to not get warnings when checking files myisam/mi_search.c: Fix for multi-byte character sets. sql/item_cmpfunc.cc: Use current character set when using STRCMP() strings/ctype-latin1_de.c: F
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_delete_all.c4
-rw-r--r--myisam/mi_search.c19
2 files changed, 16 insertions, 7 deletions
diff --git a/myisam/mi_delete_all.c b/myisam/mi_delete_all.c
index c3ed9455e12..2c506da865f 100644
--- a/myisam/mi_delete_all.c
+++ b/myisam/mi_delete_all.c
@@ -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);
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index 18d8ea8a4b0..b9895e9d6cd 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -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);