Commit 93ea672a authored by marko's avatar marko

branches/zip: Write the compressed page size to SYS_TABLES.TYPE and adjust

a few places accordingly.

os_aio_simulated_handle(): Add TODO comments about skipping the write
checks for compressed pages.

dict_create_sys_tables_tuple(): Write the compressed page size to
the TYPE column.

open_or_create_data_files(): Simplify the fil_node_create() call.

fil_node_create(): Do not touch space->zip_size.  It was already initialized
by fil_space_create().

fil_reset_too_high_lsns(), buf_flush_buffered_writes(): Add TODO comment
about compressed pages.

buf_flush_init_for_writing(): Handle pages of type FIL_PAGE_INODE,
FIL_PAGE_IBUF_BITMAP, and FIL_PAGE_TYPE_FSP_HDR as uncompressed ones.
parent 6c3c7271
......@@ -309,6 +309,7 @@ buf_flush_buffered_writes(void)
write_buf = trx_doublewrite->write_buf;
/* TODO: page_zip */
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2 + FIL_PAGE_LSN + 4)
!= mach_read_from_4(write_buf + len2 + UNIV_PAGE_SIZE
......@@ -333,6 +334,7 @@ buf_flush_buffered_writes(void)
write_buf = trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
/* TODO: page_zip */
for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
len2 += UNIV_PAGE_SIZE) {
if (mach_read_from_4(write_buf + len2
......@@ -358,7 +360,7 @@ buf_flush_buffered_writes(void)
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
/* TODO: page_zip */
if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
!= mach_read_from_4(block->frame + UNIV_PAGE_SIZE
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
......@@ -472,6 +474,9 @@ buf_flush_init_for_writing(
page, zip_size)
: BUF_NO_CHECKSUM_MAGIC);
return;
case FIL_PAGE_INODE:
case FIL_PAGE_IBUF_BITMAP:
case FIL_PAGE_TYPE_FSP_HDR:
case FIL_PAGE_TYPE_XDES:
/* This is essentially an uncompressed page. */
break;
......
......@@ -75,7 +75,14 @@ dict_create_sys_tables_tuple(
dfield = dtuple_get_nth_field(entry, 3);
ptr = mem_heap_alloc(heap, 4);
mach_write_to_4(ptr, DICT_TABLE_ORDINARY);
if (table->flags & DICT_TF_COMPRESSED_MASK) {
ut_a(table->flags & DICT_TF_COMPACT);
mach_write_to_4(ptr, DICT_TABLE_COMPRESSED_BASE
+ ((table->flags & DICT_TF_COMPRESSED_MASK)
>> DICT_TF_COMPRESSED_SHIFT));
} else {
mach_write_to_4(ptr, DICT_TABLE_ORDINARY);
}
dfield_set_data(dfield, ptr, 4);
/* 6: MIX_ID ---------------------------*/
......
......@@ -489,7 +489,6 @@ fil_node_create(
}
space->size += size;
space->zip_size = 0;/* TODO */
node->space = space;
......@@ -2674,6 +2673,7 @@ fil_reset_too_high_lsns(
file_size = os_file_get_size_as_iblonglong(file);
/* TODO: page_zip */
for (offset = 0; offset < file_size; offset += UNIV_PAGE_SIZE) {
success = os_file_read(file, page,
(ulint)(offset & 0xFFFFFFFFUL),
......
......@@ -3943,7 +3943,7 @@ os_aio_simulated_handle(
/* Do the i/o with ordinary, synchronous i/o functions: */
if (slot->type == OS_FILE_WRITE) {
if (array == os_aio_write_array) {
if (array == os_aio_write_array /* TODO: && !page_zip */) {
if ((total_len % UNIV_PAGE_SIZE != 0)
|| (slot->offset % UNIV_PAGE_SIZE != 0)) {
fprintf(stderr,
......@@ -3953,14 +3953,13 @@ os_aio_simulated_handle(
(ulong) total_len);
ut_error;
}
os_file_check_page_trailers(combined_buf, total_len);
}
ret = os_file_write(slot->name, slot->file, combined_buf,
slot->offset, slot->offset_high, total_len);
if (array == os_aio_write_array) {
if (array == os_aio_write_array /* TODO: && !page_zip */) {
os_file_check_page_trailers(combined_buf, total_len);
}
} else {
......
......@@ -925,13 +925,8 @@ open_or_create_data_files(
ut_a(fil_validate());
if (srv_data_file_is_raw_partition[i]) {
fil_node_create(name, srv_data_file_sizes[i], 0, TRUE);
} else {
fil_node_create(name, srv_data_file_sizes[i], 0,
FALSE);
}
fil_node_create(name, srv_data_file_sizes[i], 0,
srv_data_file_is_raw_partition[i] != 0);
}
ios = 0;
......
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