diff options
Diffstat (limited to 'sql/sql_array.h')
-rw-r--r-- | sql/sql_array.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/sql_array.h b/sql/sql_array.h index 341ea9a651b..cad7b0e1c48 100644 --- a/sql/sql_array.h +++ b/sql/sql_array.h @@ -191,9 +191,10 @@ public: return *((Elem*)pop_dynamic(&array)); } - void del(uint idx) + void del(size_t idx) { - delete_dynamic_element(&array, idx); + DBUG_ASSERT(idx <= array.max_element); + delete_dynamic_element(&array, (uint)idx); } size_t elements() const @@ -204,7 +205,7 @@ public: void elements(size_t num_elements) { DBUG_ASSERT(num_elements <= array.max_element); - array.elements= num_elements; + array.elements= (uint)num_elements; } void clear() @@ -220,12 +221,12 @@ public: bool resize(size_t new_size, Elem default_val) { size_t old_size= elements(); - if (allocate_dynamic(&array, new_size)) + if (allocate_dynamic(&array, (uint)new_size)) return true; if (new_size > old_size) { - set_dynamic(&array, (uchar*)&default_val, new_size - 1); + set_dynamic(&array, (uchar*)&default_val, (uint)(new_size - 1)); /*for (size_t i= old_size; i != new_size; i++) { at(i)= default_val; |