summaryrefslogtreecommitdiff
path: root/sql/filesort.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/filesort.cc')
-rw-r--r--sql/filesort.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index 3bde4eeae14..c087e65172e 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -77,10 +77,18 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
SORTPARAM param;
DBUG_ENTER("filesort");
DBUG_EXECUTE("info",TEST_filesort(sortorder,s_length,special););
+ CHARSET_INFO *charset=table->table_charset;
+ uint i;
#ifdef SKIP_DBUG_IN_FILESORT
DBUG_PUSH(""); /* No DBUG here */
#endif
+ // BAR TODO: this is not absolutely correct, but OK for now
+ for(i=0;i<table->fields;i++)
+ if (!table->field[i]->binary())
+ charset=((Field_str*)(table->field[i]))->charset();
+ // /BAR TODO
+
outfile= table->io_cache;
my_b_clear(&tempfile);
my_b_clear(&buffpek_pointers);
@@ -129,7 +137,7 @@ ha_rows filesort(TABLE *table, SORT_FIELD *sortorder, uint s_length,
records=param.max_rows; /* purecov: inspected */
#ifdef USE_STRCOLL
- if (use_strcoll(default_charset_info) &&
+ if (use_strcoll(charset) &&
!(param.tmp_buffer=my_malloc(param.sort_length,MYF(MY_WME))))
goto err;
#endif