Fix order by related problems

This commit is contained in:
lazio579 2018-11-28 12:02:33 +08:00
parent 9c72a1a87d
commit c7cc0278b1
2 changed files with 3 additions and 4 deletions

View File

@ -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) {

View File

@ -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 {