mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 11:31:51 +01:00
branches/zip: Reintroduce the local variables "sorted" that were removed
in r1445. They are needed after all, but apparently the tests do not actually verify that the records are sorted. (Also, a buffer overflow will occur in index_merge_innodb.test if MERGE_BLOCK_SIZE is made smaller.)
This commit is contained in:
parent
93558a3ba7
commit
a55e2191dc
1 changed files with 13 additions and 2 deletions
|
@ -568,6 +568,8 @@ row_merge_sort_linked_list(
|
|||
list_head = list->head;
|
||||
|
||||
for (block_size = 1;; block_size *= 2) {
|
||||
ibool sorted = TRUE;
|
||||
|
||||
list1 = list_head;
|
||||
list_head = NULL;
|
||||
list_tail = NULL;
|
||||
|
@ -660,12 +662,17 @@ pick2:
|
|||
}
|
||||
|
||||
if (!list2) {
|
||||
if (!sorted) {
|
||||
break;
|
||||
}
|
||||
|
||||
list->head = list_head;
|
||||
list_tail->next = NULL;
|
||||
success = TRUE;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
sorted = FALSE;
|
||||
list1 = list2;
|
||||
}
|
||||
|
||||
|
@ -1156,6 +1163,7 @@ row_merge_sort_linked_list_in_disk(
|
|||
output.file = file;
|
||||
|
||||
for (block_size = 1;; block_size *= 2) {
|
||||
ibool sorted = TRUE;
|
||||
ibool list_is_empty = TRUE;
|
||||
|
||||
block1 = backup1;
|
||||
|
@ -1289,10 +1297,13 @@ file_error:
|
|||
the disk. Swap blocks using pointers. */
|
||||
|
||||
if (!block2) {
|
||||
|
||||
goto func_exit;
|
||||
if (sorted) {
|
||||
goto func_exit;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
sorted = FALSE;
|
||||
block2 = backup1;
|
||||
block1 = backup2;
|
||||
backup2 = block2;
|
||||
|
|
Loading…
Add table
Reference in a new issue