summaryrefslogtreecommitdiff
path: root/sql/sql_array.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2013-06-21 22:26:03 +0400
committerSergey Petrunya <psergey@askmonty.org>2013-06-21 22:26:03 +0400
commitcebdf3de2ef2604f3459762fc05a50dd54c1c9f2 (patch)
treee23a75abd0b2376b437b595a61510e3d9eb0c6d7 /sql/sql_array.h
parentaf5e128e50cac8881f7bfca44cc473600abdce86 (diff)
downloadmariadb-git-cebdf3de2ef2604f3459762fc05a50dd54c1c9f2.tar.gz
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Handle another specific case where there the JOIN never had a query plan, but had multiple join->cleanup(full=true) calls - The idea that there can only be MAX_TABLES subuqeries/unions was wrong. Switch QPF_query to using a Dynamic_array. = make Dynamic_array template support size growth. its underlying DYNAMIC_ARRAY supports it. (this part will need more polishing)
Diffstat (limited to 'sql/sql_array.h')
-rw-r--r--sql/sql_array.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/sql/sql_array.h b/sql/sql_array.h
index 43ca4ef4219..18f1fbd9f2f 100644
--- a/sql/sql_array.h
+++ b/sql/sql_array.h
@@ -106,6 +106,7 @@ public:
Elem& at(size_t idx)
{
+ DBUG_ASSERT(idx < array.elements);
return *(((Elem*)array.buffer) + idx);
}
@@ -139,6 +140,23 @@ public:
array.elements= n;
}
+ 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);