summaryrefslogtreecommitdiff
path: root/sql/sql_tvc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_tvc.cc')
-rw-r--r--sql/sql_tvc.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 6984fdd6bcf..9b9b07d55cd 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -570,7 +570,10 @@ bool Item_func_in::create_value_list_for_tvc(THD *thd,
if (is_list_of_rows)
{
- Item_row *row_list= (Item_row *)(args[i]);
+ Item_row *row_list= (Item_row *)(args[i]->build_clone(thd));
+
+ if (!row_list)
+ return true;
for (uint j=0; j < row_list->cols(); j++)
{
@@ -592,7 +595,8 @@ bool Item_func_in::create_value_list_for_tvc(THD *thd,
sprintf(col_name, "_col_%i", 1);
args[i]->set_name(thd, col_name, strlen(col_name), thd->charset());
}
- if (tvc_value->push_back(args[i]->real_item()))
+ Item *arg_clone= args[i]->build_clone(thd);
+ if (!arg_clone || tvc_value->push_back(arg_clone))
return true;
}