diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index d861c2c3d4f..a0ddc3e40a5 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -300,7 +300,7 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, else { /* Clear mutex so that safe_mutex will notice that it's not initialized */ - bzero((char*) &info->append_buffer_lock, sizeof(info)); + bzero((char*) &info->append_buffer_lock, sizeof(info->append_buffer_lock)); } #endif diff --git a/sql/sql_update.cc b/sql/sql_update.cc index e1d22e6a1e9..db9f9013188 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -701,6 +701,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; }