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, 7 insertions, 1 deletions
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 7004c32e602..188ba8c4629 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -221,6 +221,12 @@ bool table_value_constr::prepare(THD *thd, SELECT_LEX *sl,
uint cnt= first_elem->elements;
Type_holder *holders;
+ if (cnt == 0)
+ {
+ my_error(ER_EMPTY_ROW_IN_TVC, MYF(0));
+ DBUG_RETURN(true);
+ }
+
if (fix_fields_for_tvc(thd, li))
DBUG_RETURN(true);
@@ -249,7 +255,7 @@ bool table_value_constr::prepare(THD *thd, SELECT_LEX *sl,
sl->item_list.push_back(new_holder);
}
- if (thd->is_fatal_error)
+ if (unlikely(thd->is_fatal_error))
DBUG_RETURN(true); // out of memory
result= tmp_result;