summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 1ca44046997..83b125ee630 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -171,6 +171,13 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
table->time_stamp= save_time_stamp;
goto abort;
}
+ if (find_real_table_in_list(table_list->next,
+ table_list->db, table_list->real_name))
+ {
+ my_error(ER_INSERT_TABLE_USED, MYF(0), table_list->real_name);
+ goto abort;
+ }
+
value_count= values->elements;
while ((values= its++))
{