mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
branches/zip: fil_create_new_single_table_tablespace():
Make page_zip->data point to an address different from page, to avoid calling memcpy() with overlapping source and destination.
This commit is contained in:
parent
7f057a4b18
commit
3b14ab95d3
1 changed files with 3 additions and 2 deletions
|
@ -2607,7 +2607,7 @@ fil_create_new_single_table_tablespace(
|
||||||
return(DB_ERROR);
|
return(DB_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
|
buf2 = ut_malloc(2 * UNIV_PAGE_SIZE + zip_size);
|
||||||
/* Align the memory for file i/o if we might have O_DIRECT set */
|
/* Align the memory for file i/o if we might have O_DIRECT set */
|
||||||
page = ut_align(buf2, UNIV_PAGE_SIZE);
|
page = ut_align(buf2, UNIV_PAGE_SIZE);
|
||||||
|
|
||||||
|
@ -2658,7 +2658,8 @@ error_exit2:
|
||||||
} else {
|
} else {
|
||||||
page_zip_des_t page_zip;
|
page_zip_des_t page_zip;
|
||||||
page_zip.size = zip_size;
|
page_zip.size = zip_size;
|
||||||
page_zip.data = page;
|
page_zip.data = page + UNIV_PAGE_SIZE;
|
||||||
|
memset(page_zip.data, 0, zip_size);
|
||||||
page_zip.n_blobs = page_zip.m_start = page_zip.m_end = 0;
|
page_zip.n_blobs = page_zip.m_start = page_zip.m_end = 0;
|
||||||
buf_flush_init_for_writing(page, &page_zip,
|
buf_flush_init_for_writing(page, &page_zip,
|
||||||
ut_dulint_zero, *space_id, 0);
|
ut_dulint_zero, *space_id, 0);
|
||||||
|
|
Loading…
Reference in a new issue