diff options
author | Michael Widenius <monty@mariadb.org> | 2018-04-12 09:28:29 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2018-05-07 00:07:33 +0300 |
commit | a0bc3b7eeef6a3bfd0e7eae1cceabcc73071a61a (patch) | |
tree | 5ee70953aa35c648bbc0c7c9f252bc23d7df1acd /sql/uniques.cc | |
parent | 062a3176e7d985540e1051a35f15c313c0296b47 (diff) | |
download | mariadb-git-a0bc3b7eeef6a3bfd0e7eae1cceabcc73071a61a.tar.gz |
Change read_to_buffer to use ulong instead of uint
This is mostly to document that read_to_buffer can read more than 65K.
Also changed merge_buffers to return bool instead of int
Diffstat (limited to 'sql/uniques.cc')
-rw-r--r-- | sql/uniques.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/uniques.cc b/sql/uniques.cc index 00112d714c7..6bc870133ff 100644 --- a/sql/uniques.cc +++ b/sql/uniques.cc @@ -509,7 +509,7 @@ static bool merge_walk(uchar *merge_buffer, size_t merge_buffer_size, key_length); /* if piece_size is aligned reuse_freed_buffer will always hit */ uint piece_size= max_key_count_per_piece * key_length; - uint bytes_read; /* to hold return value of read_to_buffer */ + ulong bytes_read; /* to hold return value of read_to_buffer */ BUFFPEK *top; int res= 1; uint cnt_ofs= key_length - (with_counters ? sizeof(element_count) : 0); @@ -525,7 +525,7 @@ static bool merge_walk(uchar *merge_buffer, size_t merge_buffer_size, top->base= merge_buffer + (top - begin) * piece_size; top->max_keys= max_key_count_per_piece; bytes_read= read_to_buffer(file, top, key_length); - if (unlikely(bytes_read == (uint) (-1))) + if (unlikely(bytes_read == (ulong) -1)) goto end; DBUG_ASSERT(bytes_read); queue_insert(&queue, (uchar *) top); @@ -554,9 +554,9 @@ static bool merge_walk(uchar *merge_buffer, size_t merge_buffer_size, memcpy(save_key_buff, old_key, key_length); old_key= save_key_buff; bytes_read= read_to_buffer(file, top, key_length); - if (unlikely(bytes_read == (uint) (-1))) + if (unlikely(bytes_read == (ulong) -1)) goto end; - else if (bytes_read > 0) /* top->key, top->mem_count are reset */ + else if (bytes_read) /* top->key, top->mem_count are reset */ queue_replace_top(&queue); /* in read_to_buffer */ else { @@ -602,7 +602,7 @@ static bool merge_walk(uchar *merge_buffer, size_t merge_buffer_size, } while (--top->mem_count); bytes_read= read_to_buffer(file, top, key_length); - if (unlikely(bytes_read == (uint) (-1))) + if (unlikely(bytes_read == (ulong) -1)) goto end; } while (bytes_read); |