summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-02-28 12:18:39 +0200
committerunknown <monty@mysql.com>2005-02-28 12:18:39 +0200
commit45a26d449d157fb2f5c4b5ae871eb98728d9ee55 (patch)
treef466a4f954ca82d8aae5e4d3ab0a985e7fdce2f7 /sql/item_cmpfunc.cc
parent108702a34e37bae22f117a3a7e18e7cead3e63c8 (diff)
parent8e3addf9284742a6b29fb3016b8c612dfd1a5778 (diff)
downloadmariadb-git-45a26d449d157fb2f5c4b5ae871eb98728d9ee55.tar.gz
merge with 4.1
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union client/mysql.cc: Auto merged client/mysqldump.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/fil/fil0fil.c: Auto merged innobase/row/row0sel.c: Auto merged mysql-test/r/select_found.result: Auto merged mysql-test/r/type_set.result: Auto merged mysys/default.c: Auto merged sql/field.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged strings/ctype-simple.c: Auto merged include/mysql_com.h: Merge sql/filesort.cc: merge
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 3884cce8451..3e1b643fecc 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()