From 5edd129fbf14eb56e793f84963b3b9e5770c4604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 30 Jan 2018 21:05:27 +0200 Subject: Fix ASAN failure in main.lock (and others) Whenever one copies an IO_CACHE struct, one must remember to call setup_io_cache, if not, the IO_CACHE's current_pos and end_pos self-references will point to the previous struct's memory, which could go out of scope. Commit 90038693903044bbbf7946ac128c3757ad33d7ba fixes this problem in a more general fashion by removing the self-references altogether, but for 5.5 we'll keep the old behaviour. --- sql/sql_update.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sql') diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ede38468513..e42f6a4ff76 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -628,6 +628,8 @@ int mysql_update(THD *thd, if (reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) error=1; /* purecov: inspected */ select->file=tempfile; // Read row ptrs from this file + // select->file was copied, update self-references. + setup_io_cache(&select->file); if (error >= 0) goto err; } -- cgit v1.2.1