Skip to content

Commit

Permalink
Merge branch 'master' of git.postgrespro.ru:pgpro-dev/rum
Browse files Browse the repository at this point in the history
  • Loading branch information
feodor committed Oct 13, 2020
2 parents 063ca03 + d9607bf commit 241b198
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/rum_ts_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ pre_checkcondition_rum(void *checkval, QueryOperand *val, ExecPhraseData *data)
j = gcv->map_item_operand[((QueryItem *) val) - gcv->first_item];
/* return presence of current entry in indexed value */
#if PG_VERSION_NUM >= 130000
return ( *(gcv->need_recheck) ? TS_MAYBE : gcv->check[j] );
return ( *(gcv->need_recheck) ? TS_MAYBE : (gcv->check[j] ? TS_YES : TS_NO) );
#else
return gcv->check[j];
#endif
Expand All @@ -228,7 +228,7 @@ rum_tsquery_pre_consistent(PG_FUNCTION_ARGS)
bool *check = (bool *) PG_GETARG_POINTER(0);
TSQuery query = PG_GETARG_TSQUERY(2);
Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4);
bool recheck;
bool recheck = false;
bool res = false;

if (query->size > 0)
Expand Down
9 changes: 6 additions & 3 deletions src/rumscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,9 +703,12 @@ rumNewScanKey(IndexScanDesc scan)
repalloc(so->entries, so->allocentries * sizeof(RumScanEntry));
}

memcpy(so->entries + so->totalentries,
key->scanEntry, sizeof(*key->scanEntry) * key->nentries);
so->totalentries += key->nentries;
if ( key->scanEntry != NULL )
{
memcpy(so->entries + so->totalentries,
key->scanEntry, sizeof(*key->scanEntry) * key->nentries);
so->totalentries += key->nentries;
}
}

/*
Expand Down
14 changes: 11 additions & 3 deletions src/rumsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include "commands/tablespace.h"
#include "executor/executor.h"
#include "utils/guc.h"
#include "utils/logtape.h"
#include "utils/pg_rusage.h"

Expand Down Expand Up @@ -52,9 +51,18 @@
* Below are copied definitions from src/backend/utils/sort/tuplesort.c.
*/

/* GUC variables */
/* For PGPRO since v.13 trace_sort is imported from backend by including its
* declaration in guc.h (guc.h contains added Windows export/import magic to be done
* during postgres.exe compilation).
* For older or non-PGPRO versions on Windows platform trace_sort is not exported by
* backend so it is declared local for this case.
*/
#ifdef TRACE_SORT
bool trace_sort = false;
#if ( !defined (_MSC_VER) || (PG_VERSION_NUM >= 130000 && defined (PGPRO_VERSION)) )
#include "utils/guc.h"
#else
bool trace_sort = false;
#endif
#endif

typedef struct
Expand Down

0 comments on commit 241b198

Please sign in to comment.