summaryrefslogtreecommitdiff
path: root/sql/sql_array.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-12-07 13:41:10 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-12-07 13:41:10 +0200
commit5e5deabdbcbd189f1242c493f0e1d534d8acbdb0 (patch)
tree2503f7d5fd257e7788a4b170f93dca9c887be5af /sql/sql_array.h
parent49a50a19a1b71ad24dcc36ca9b5d83e73706d235 (diff)
parentecd3a7e00de28d279ef180e1d4defa979e80f9e4 (diff)
downloadmariadb-git-5e5deabdbcbd189f1242c493f0e1d534d8acbdb0.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql/sql_array.h')
-rw-r--r--sql/sql_array.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_array.h b/sql/sql_array.h
index bbaa653b177..e1adc9b9785 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -123,8 +123,7 @@ public:
void init(uint prealloc=16, uint increment=16)
{
- my_init_dynamic_array(&array, sizeof(Elem), prealloc, increment,
- MYF(0));
+ init_dynamic_array2(&array, sizeof(Elem), 0, prealloc, increment, MYF(0));
}
/**
@@ -217,6 +216,11 @@ public:
set_dynamic(&array, &el, idx);
}
+ void freeze()
+ {
+ freeze_size(&array);
+ }
+
bool resize(size_t new_size, Elem default_val)
{
size_t old_size= elements();
@@ -251,7 +255,7 @@ public:
my_qsort(array.buffer, array.elements, sizeof(Elem), (qsort_cmp)cmp_func);
}
- typedef int (*CMP_FUNC2)(const Elem *el1, const Elem *el2, void *);
+ typedef int (*CMP_FUNC2)(void *, const Elem *el1, const Elem *el2);
void sort(CMP_FUNC2 cmp_func, void *data)
{
my_qsort2(array.buffer, array.elements, sizeof(Elem), (qsort2_cmp)cmp_func, data);