diff --git a/src/resultset_merge.c b/src/resultset_merge.c index 3d681b6..f7b56dd 100644 --- a/src/resultset_merge.c +++ b/src/resultset_merge.c @@ -1846,9 +1846,8 @@ heap_adjust(heap_type *heap, int s, int m, int *compare_failed) j++; } else if (!heap->element[j + 1]->is_over) { if (!heap->element[j]->refreshed && !heap->element[j + 1]->refreshed) { - if (!heap->element[j]->is_prior_to) { + if (heap->element[j]->is_prior_to == -1) { j++; - } else { } } else { is_dup = 0; @@ -1857,7 +1856,7 @@ heap_adjust(heap_type *heap, int s, int m, int *compare_failed) heap->element[j + 1]->record->data, &(heap->order_para), heap->element[j]->index, heap->element[j + 1]->index, &is_dup, compare_failed)) { j++; - heap->element[j]->is_prior_to = 0; + heap->element[j]->is_prior_to = -1; } else { if (is_dup) { diff --git a/src/resultset_merge.h b/src/resultset_merge.h index 351b13d..a9ca531 100644 --- a/src/resultset_merge.h +++ b/src/resultset_merge.h @@ -54,11 +54,11 @@ typedef struct ORDER_BY { typedef struct { GList *record; int index; + int is_prior_to; unsigned int is_over:1; unsigned int is_err:1; unsigned int refreshed:1; unsigned int is_dup:1; - unsigned int is_prior_to:1; } heap_element; typedef struct order_by_para_s {