diff options
author | kaa@polly.(none) <> | 2007-10-17 20:08:58 +0400 |
---|---|---|
committer | kaa@polly.(none) <> | 2007-10-17 20:08:58 +0400 |
commit | 6d1f3e8de56e3cc861272265fc1f6119a41036a9 (patch) | |
tree | df4dfded543b3b043c0b27d956a2b0bab863da1b /include/my_sys.h | |
parent | 80a2d47b22dde619656b55831f2a920bfcf8b5b1 (diff) | |
download | mariadb-git-6d1f3e8de56e3cc861272265fc1f6119a41036a9.tar.gz |
Fix for bug #31207: Test "join_nested" shows different strategy on IA64
CPUs / Intel's ICC compile
The bug is a combination of two problems:
1. IA64/ICC MySQL binaries use glibc's qsort(), not the one in mysys.
2. The order relation implemented by join_tab_cmp() is not transitive,
i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
but (c < a). This implies that result of a sort using the relation
implemented by join_tab_cmp() depends on the order in which
elements are compared, i.e. the result is implementation-specific. Since
choose_plan() uses qsort() to pre-sort the
join tables using join_tab_cmp() as a compare function, the results of
the sorting may vary depending on qsort() implementation.
It is neither possible nor important to implement a better ordering
algorithm in join_tab_cmp(). Therefore the only way to fix it is to
force our own qsort() to be used by renaming it to my_qsort(), so we don't depend
on linker to decide that.
This patch also "fixes" bug #20530: qsort redefinition violates the
standard.
Diffstat (limited to 'include/my_sys.h')
-rw-r--r-- | include/my_sys.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/my_sys.h b/include/my_sys.h index 4f7e75a836e..d401cfca082 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -709,8 +709,10 @@ extern sig_handler my_set_alarm_variable(int signo); extern void my_string_ptr_sort(void *base,uint items,size_s size); extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements, size_s size_of_element,uchar *buffer[]); -extern qsort_t qsort2(void *base_ptr, size_t total_elems, size_t size, - qsort2_cmp cmp, void *cmp_argument); +extern qsort_t my_qsort(void *base_ptr, size_t total_elems, size_t size, + qsort_cmp cmp); +extern qsort_t my_qsort2(void *base_ptr, size_t total_elems, size_t size, + qsort2_cmp cmp, void *cmp_argument); extern qsort2_cmp get_ptr_compare(uint); void my_store_ptr(byte *buff, uint pack_length, my_off_t pos); my_off_t my_get_ptr(byte *ptr, uint pack_length); |