Commit 13817f1d authored by marko's avatar marko

branches/zip: Minor cleanup of merge_file_t and merge_block_header_t.

Replace byte offsets of type dulint with block offsets of type ulint.
Avoid references to MERGE_BLOCK_SIZE.

Improve the language of some comments.

row_merge_insert_index_tuples(), row_merge_sort_linked_list_in_disk():
Make the offset a ulint.

row_merge_read(), row_merge_write(): Helper functions.  Return the
status of os_file_read() and os_file_write().  TO DO: check the status
in the callers.
parent 96e90174
...@@ -26,7 +26,7 @@ to this structure */ ...@@ -26,7 +26,7 @@ to this structure */
struct merge_file_struct { struct merge_file_struct {
os_file_t file; /* File descriptor */ os_file_t file; /* File descriptor */
dulint offset; /* File offset */ ulint offset; /* File offset */
ulint num_of_blocks; /* Number of blocks */ ulint num_of_blocks; /* Number of blocks */
}; };
...@@ -81,16 +81,16 @@ row_merge_insert_index_tuples( ...@@ -81,16 +81,16 @@ row_merge_insert_index_tuples(
dict_index_t* index, /* in: index */ dict_index_t* index, /* in: index */
dict_table_t* table, /* in: table */ dict_table_t* table, /* in: table */
os_file_t file, /* in: file handle */ os_file_t file, /* in: file handle */
dulint offset); /* in: offset where to start ulint offset); /* in: offset where to start
reading */ reading */
/***************************************************************** /*****************************************************************
Merge sort for linked list in the disk. */ Merge sort for linked list in the disk. */
dulint ulint
row_merge_sort_linked_list_in_disk( row_merge_sort_linked_list_in_disk(
/*===============================*/ /*===============================*/
/* out: offset to first block in /* out: offset to first block in
the list or ut_dulint_max in the list or ULINT_UNDEFINED in
case of error */ case of error */
dict_index_t* index, /* in: index to be created */ dict_index_t* index, /* in: index to be created */
os_file_t file, /* in: File handle */ os_file_t file, /* in: File handle */
......
This diff is collapsed.
...@@ -4522,12 +4522,10 @@ row_build_index_for_mysql( ...@@ -4522,12 +4522,10 @@ row_build_index_for_mysql(
which we have written at least one block */ which we have written at least one block */
if (merge_files[index_num].num_of_blocks > 0) { if (merge_files[index_num].num_of_blocks > 0) {
dulint offset = ut_dulint_create(0, 0);
/* Merge sort file using linked list merge /* Merge sort file using linked list merge
sort for files. */ sort for files. */
offset = row_merge_sort_linked_list_in_disk( row_merge_sort_linked_list_in_disk(
index[index_num], index[index_num],
merge_files[index_num].file, merge_files[index_num].file,
(int *)&error); (int *)&error);
...@@ -4535,8 +4533,7 @@ row_build_index_for_mysql( ...@@ -4535,8 +4533,7 @@ row_build_index_for_mysql(
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
error = row_merge_insert_index_tuples( error = row_merge_insert_index_tuples(
trx, index[index_num], new_table, trx, index[index_num], new_table,
merge_files[index_num].file, merge_files[index_num].file, 0);
ut_dulint_zero);
} }
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
......
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