summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2005-03-02 10:41:23 +0100
committerunknown <serg@serg.mylan>2005-03-02 10:41:23 +0100
commitf508a6ca80c72f96008a1e9a977f9563637c1a89 (patch)
treed07afa7838a55f37fd85a9d3a6923a303e250d62 /sql/item_cmpfunc.cc
parente1ba1632fbb444adea39054f6cc1e58e9d1c3ee0 (diff)
parentc4409a7cbf9b43ed450340ba9dd6a33f821df5f2 (diff)
downloadmariadb-git-f508a6ca80c72f96008a1e9a977f9563637c1a89.tar.gz
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0 sql/ha_innodb.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/sql_repl.cc: Auto merged
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 3204e5ac711..dae5f0fc0c6 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -283,7 +283,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
comparators= 0;
return 1;
}
- if (!(comparators= (Arg_comparator *) sql_alloc(sizeof(Arg_comparator)*n)))
+ if (!(comparators= new Arg_comparator[n]))
return 1;
for (uint i=0; i < n; i++)
{
@@ -1825,6 +1825,12 @@ in_row::in_row(uint elements, Item * item)
size= sizeof(cmp_item_row);
compare= (qsort2_cmp) cmp_row;
tmp.store_value(item);
+ /*
+ We need to reset these as otherwise we will call sort() with
+ uninitialized (even if not used) elements
+ */
+ used_count= elements;
+ collation= 0;
}
in_row::~in_row()