summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-10-13 11:38:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-10-13 11:38:21 +0300
commit4a7dfda373ff9e28e4f4f35bad76cbfc20934a9a (patch)
treec8b327da16aa30bc5a26bfa31a2563af1c6f4976 /sql/sql_insert.cc
parentff77a09bda884fe6bf3917eb29b9d3a2f53f919b (diff)
parent2bb8d7c2f36439ab6a3944476665eb1218c36f5c (diff)
downloadmariadb-git-4a7dfda373ff9e28e4f4f35bad76cbfc20934a9a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f8b91df7941..201567c0853 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1266,7 +1266,18 @@ values_loop_end:
abort:
#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
+ {
end_delayed_insert(thd);
+ /*
+ In case of an error (e.g. data truncation), the data type specific data
+ in fields (e.g. Field_blob::value) was not taken over
+ by the delayed writer thread. All fields in table_list->table
+ will be freed by free_root() soon. We need to free the specific
+ data before free_root() to avoid a memory leak.
+ */
+ for (Field **ptr= table_list->table->field ; *ptr ; ptr++)
+ (*ptr)->free();
+ }
#endif
if (table != NULL)
table->file->ha_release_auto_increment();