summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/create_options.cc6
-rw-r--r--sql/create_options.h7
2 files changed, 10 insertions, 3 deletions
diff --git a/sql/create_options.cc b/sql/create_options.cc
index d956d01aa66..774d739f153 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -743,9 +743,9 @@ engine_option_value *merge_engine_table_options(engine_option_value *first,
DBUG_ENTER("merge_engine_table_options");
LINT_INIT(end);
- /* find last element */
- if (first && second)
- for (end= first; end->next; end= end->next) /* no-op */;
+ /* Create copy of first list */
+ for (opt= first, first= 0; opt; opt= opt->next)
+ new (root) engine_option_value(opt, &first, &end);
for (opt= second; opt; opt= opt->next)
new (root) engine_option_value(opt->name, opt->value, opt->quoted_value,
diff --git a/sql/create_options.h b/sql/create_options.h
index ea05bf75fac..c7fac8b37fd 100644
--- a/sql/create_options.h
+++ b/sql/create_options.h
@@ -34,6 +34,13 @@ class engine_option_value: public Sql_alloc
bool parsed; ///< to detect unrecognized options
bool quoted_value; ///< option=VAL vs. option='VAL'
+ engine_option_value(engine_option_value *src,
+ engine_option_value **start, engine_option_value **end) :
+ name(src->name), value(src->value),
+ next(NULL), parsed(src->parsed), quoted_value(src->quoted_value)
+ {
+ link(start, end);
+ }
engine_option_value(LEX_STRING &name_arg, LEX_STRING &value_arg, bool quoted,
engine_option_value **start, engine_option_value **end) :
name(name_arg), value(value_arg),