mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +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
366f0aa2b5
commit
6688b86338
1 changed files with 13 additions and 2 deletions
|
@ -568,6 +568,8 @@ row_merge_sort_linked_list(
|
||||||
list_head = list->head;
|
list_head = list->head;
|
||||||
|
|
||||||
for (block_size = 1;; block_size *= 2) {
|
for (block_size = 1;; block_size *= 2) {
|
||||||
|
ibool sorted = TRUE;
|
||||||
|
|
||||||
list1 = list_head;
|
list1 = list_head;
|
||||||
list_head = NULL;
|
list_head = NULL;
|
||||||
list_tail = NULL;
|
list_tail = NULL;
|
||||||
|
@ -660,12 +662,17 @@ pick2:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!list2) {
|
if (!list2) {
|
||||||
|
if (!sorted) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
list->head = list_head;
|
list->head = list_head;
|
||||||
list_tail->next = NULL;
|
list_tail->next = NULL;
|
||||||
success = TRUE;
|
success = TRUE;
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sorted = FALSE;
|
||||||
list1 = list2;
|
list1 = list2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1156,6 +1163,7 @@ row_merge_sort_linked_list_in_disk(
|
||||||
output.file = file;
|
output.file = file;
|
||||||
|
|
||||||
for (block_size = 1;; block_size *= 2) {
|
for (block_size = 1;; block_size *= 2) {
|
||||||
|
ibool sorted = TRUE;
|
||||||
ibool list_is_empty = TRUE;
|
ibool list_is_empty = TRUE;
|
||||||
|
|
||||||
block1 = backup1;
|
block1 = backup1;
|
||||||
|
@ -1289,10 +1297,13 @@ file_error:
|
||||||
the disk. Swap blocks using pointers. */
|
the disk. Swap blocks using pointers. */
|
||||||
|
|
||||||
if (!block2) {
|
if (!block2) {
|
||||||
|
if (sorted) {
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sorted = FALSE;
|
||||||
block2 = backup1;
|
block2 = backup1;
|
||||||
block1 = backup2;
|
block1 = backup2;
|
||||||
backup2 = block2;
|
backup2 = block2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue