1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.0-base -> 10.0

This commit is contained in:
Sergey Petrunya
2013-10-16 13:38:42 +04:00
72 changed files with 8317 additions and 714 deletions

View File

@ -117,6 +117,7 @@ public:
*/
Elem& at(size_t idx)
{
DBUG_ASSERT(idx < array.elements);
return *(((Elem*)array.buffer) + idx);
}
/// Const variant of at(), which cannot change data
@ -199,6 +200,23 @@ public:
set_dynamic(&array, &el, idx);
}
bool resize(size_t new_size, Elem default_val)
{
size_t old_size= elements();
if (allocate_dynamic(&array, new_size))
return true;
if (new_size > old_size)
{
set_dynamic(&array, (uchar*)&default_val, new_size - 1);
/*for (size_t i= old_size; i != new_size; i++)
{
at(i)= default_val;
}*/
}
return false;
}
~Dynamic_array()
{
delete_dynamic(&array);