diff options
author | serg@serg.mylan <> | 2005-03-02 10:41:23 +0100 |
---|---|---|
committer | serg@serg.mylan <> | 2005-03-02 10:41:23 +0100 |
commit | 7535886f1ca85b7f4b602989791fe9e8baf37d4d (patch) | |
tree | d07afa7838a55f37fd85a9d3a6923a303e250d62 /sql/item_cmpfunc.cc | |
parent | 02d88c398f70fdb2255fb8a41d9cd1954562a24b (diff) | |
parent | b9ae89a1e632c0fbc1d62a3512581b50e0d6c7a6 (diff) | |
download | mariadb-git-7535886f1ca85b7f4b602989791fe9e8baf37d4d.tar.gz |
Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 8 |
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() |