summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2003-12-02 21:16:57 +0300
committerunknown <sergefp@mysql.com>2003-12-02 21:16:57 +0300
commit25be07f05125fed0326b3b36eb344cfe535f8e46 (patch)
tree808f1ce6e55311ca691a839b553e07984ea6a3ba /sql
parent465881c21adc49f0818f26d90cb9ca7203250c1e (diff)
parent8be4234f6162da34e1ecd007b67b3ef0650b16d1 (diff)
downloadmariadb-git-25be07f05125fed0326b3b36eb344cfe535f8e46.tar.gz
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/psergey/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r--sql/uniques.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/sql/uniques.cc b/sql/uniques.cc
index d00893a8605..967392d12d5 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -37,14 +37,20 @@
int unique_write_to_file(gptr key, element_count count, Unique *unique)
{
+ /*
+ Use unique->size (size of element stored in the tree) and not
+ unique->tree.size_of_element. The latter is different from unique->size
+ when tree implementation chooses to store pointer to key in TREE_ELEMENT
+ (instead of storing the element itself there)
+ */
return my_b_write(&unique->file, (byte*) key,
- unique->tree.size_of_element) ? 1 : 0;
+ unique->size) ? 1 : 0;
}
int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
{
- memcpy(unique->record_pointers, key, unique->tree.size_of_element);
- unique->record_pointers+=unique->tree.size_of_element;
+ memcpy(unique->record_pointers, key, unique->size);
+ unique->record_pointers+=unique->size;
return 0;
}
@@ -132,7 +138,7 @@ bool Unique::get(TABLE *table)
bzero((char*) &sort_param,sizeof(sort_param));
sort_param.max_rows= elements;
sort_param.sort_form=table;
- sort_param.sort_length=sort_param.ref_length=tree.size_of_element;
+ sort_param.sort_length=sort_param.ref_length=size;
sort_param.keys= max_in_memory_size / sort_param.sort_length;
sort_param.not_killable=1;