mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt mysql-test/r/loaddata.result: Auto merged mysql-test/t/loaddata.test: Auto merged sql/filesort.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_load.cc: Auto merged sql/uniques.cc: Auto merged mysql-test/include/mix1.inc: manual merge 5.0-opt -> 5.1-opt mysql-test/r/innodb_mysql.result: manual merge 5.0-opt -> 5.1-opt sql/log.cc: manual merge 5.0-opt -> 5.1-opt
This commit is contained in:
@@ -360,17 +360,12 @@ Unique::reset()
|
||||
}
|
||||
|
||||
/*
|
||||
The comparison function, passed to queue_init() in merge_walk() must
|
||||
The comparison function, passed to queue_init() in merge_walk() and in
|
||||
merge_buffers() when the latter is called from Uniques::get() must
|
||||
use comparison function of Uniques::tree, but compare members of struct
|
||||
BUFFPEK.
|
||||
*/
|
||||
|
||||
struct BUFFPEK_COMPARE_CONTEXT
|
||||
{
|
||||
qsort_cmp2 key_compare;
|
||||
void *key_compare_arg;
|
||||
};
|
||||
|
||||
C_MODE_START
|
||||
|
||||
static int buffpek_compare(void *arg, uchar *key_ptr1, uchar *key_ptr2)
|
||||
@@ -629,6 +624,10 @@ bool Unique::get(TABLE *table)
|
||||
sort_param.unique_buff= sort_buffer+(sort_param.keys*
|
||||
sort_param.sort_length);
|
||||
|
||||
sort_param.compare= (qsort2_cmp) buffpek_compare;
|
||||
sort_param.cmp_context.key_compare= tree.compare;
|
||||
sort_param.cmp_context.key_compare_arg= tree.custom_arg;
|
||||
|
||||
/* Merge the buffers to one file, removing duplicates */
|
||||
if (merge_many_buff(&sort_param,sort_buffer,file_ptr,&maxbuffer,&file))
|
||||
goto err;
|
||||
|
Reference in New Issue
Block a user