summaryrefslogtreecommitdiff
path: root/sql/uniques.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-05-04 22:00:24 +0200
commit49c853fb948aeaeb5c7e3f02da3f14da51ee4100 (patch)
tree8c3d487a02209cc0c6f126144f1340fc5897d527 /sql/uniques.cc
parentae18a28500974351cf42fa3cac67c83e0647d510 (diff)
parent4c87f727734955f9e4a0ffde25aae4d43ec0b2a5 (diff)
downloadmariadb-git-49c853fb948aeaeb5c7e3f02da3f14da51ee4100.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'sql/uniques.cc')
-rw-r--r--sql/uniques.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 912a38f8927..c755293035b 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -1,4 +1,5 @@
-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2010, Oracle and/or its affiliates.
+ Copyright (c) 2010, 2015, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -100,7 +101,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
max_elements= (ulong) (max_in_memory_size /
ALIGN_SIZE(sizeof(TREE_ELEMENT)+size));
(void) open_cached_file(&file, mysql_tmpdir,TEMP_PREFIX, DISK_BUFFER_SIZE,
- MYF(MY_WME));
+ MYF(MY_WME));
}
@@ -641,8 +642,8 @@ bool Unique::walk(TABLE *table, tree_walk_action action, void *walk_action_arg)
return 1;
if (flush_io_cache(&file) || reinit_io_cache(&file, READ_CACHE, 0L, 0, 0))
return 1;
- ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size;
- if (!(merge_buffer= (uchar *) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC))))
+ size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size;
+ if (!(merge_buffer = (uchar *)my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC|MY_WME))))
return 1;
if (buff_sz < full_size * (file_ptrs.elements + 1UL))
res= merge(table, merge_buffer, buff_sz >= full_size * MERGEBUFF2) ;
@@ -773,9 +774,8 @@ bool Unique::get(TABLE *table)
/* Not enough memory; Save the result to file && free memory used by tree */
if (flush())
return 1;
-
- ulong buff_sz= (max_in_memory_size / full_size + 1) * full_size;
- if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC))))
+ size_t buff_sz= (max_in_memory_size / full_size + 1) * full_size;
+ if (!(sort_buffer= (uchar*) my_malloc(buff_sz, MYF(MY_THREAD_SPECIFIC|MY_WME))))
return 1;
if (merge(table, sort_buffer, FALSE))