Commit 5edd129f authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

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 90038693
fixes this problem in a more general fashion by removing the
self-references altogether, but for 5.5 we'll keep the old behaviour.
parent ded07724
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment