@@ -324,10 +324,10 @@ initScanKey(RumScanOpaque so, ScanKey skey, bool *hasNullQuery)
324
324
PointerGetDatum (& searchMode )));
325
325
326
326
/*
327
- * If bogus searchMode is returned, treat as RUM_SEARCH_MODE_ALL; note
328
- * in particular we don't allow extractQueryFn to select
329
- * RUM_SEARCH_MODE_EVERYTHING.
330
- */
327
+ * If bogus searchMode is returned, treat as RUM_SEARCH_MODE_ALL; note
328
+ * in particular we don't allow extractQueryFn to select
329
+ * RUM_SEARCH_MODE_EVERYTHING.
330
+ */
331
331
if (searchMode < GIN_SEARCH_MODE_DEFAULT ||
332
332
searchMode > GIN_SEARCH_MODE_ALL )
333
333
searchMode = GIN_SEARCH_MODE_ALL ;
@@ -337,8 +337,8 @@ initScanKey(RumScanOpaque so, ScanKey skey, bool *hasNullQuery)
337
337
* hasNullQuery = true;
338
338
339
339
/*
340
- * In default mode, no keys means an unsatisfiable query.
341
- */
340
+ * In default mode, no keys means an unsatisfiable query.
341
+ */
342
342
if (queryValues == NULL || nQueryValues <= 0 )
343
343
{
344
344
if (searchMode == GIN_SEARCH_MODE_DEFAULT )
@@ -350,12 +350,12 @@ initScanKey(RumScanOpaque so, ScanKey skey, bool *hasNullQuery)
350
350
}
351
351
352
352
/*
353
- * If the extractQueryFn didn't create a nullFlags array, create one,
354
- * assuming that everything's non-null. Otherwise, run through the
355
- * array and make sure each value is exactly 0 or 1; this ensures
356
- * binary compatibility with the RumNullCategory representation. While
357
- * at it, detect whether any null keys are present.
358
- */
353
+ * If the extractQueryFn didn't create a nullFlags array, create one,
354
+ * assuming that everything's non-null. Otherwise, run through the
355
+ * array and make sure each value is exactly 0 or 1; this ensures
356
+ * binary compatibility with the RumNullCategory representation. While
357
+ * at it, detect whether any null keys are present.
358
+ */
359
359
if (nullFlags == NULL )
360
360
nullFlags = (bool * ) palloc0 (nQueryValues * sizeof (bool ));
361
361
else
@@ -463,12 +463,11 @@ rumrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
463
463
freeScanKeys (so );
464
464
465
465
if (scankey && scan -> numberOfKeys > 0 )
466
- {
467
466
memmove (scan -> keyData , scankey ,
468
467
scan -> numberOfKeys * sizeof (ScanKeyData ));
468
+ if (orderbys && scan -> numberOfOrderBys > 0 )
469
469
memmove (scan -> orderByData , orderbys ,
470
470
scan -> numberOfOrderBys * sizeof (ScanKeyData ));
471
- }
472
471
473
472
if (so -> sortstate )
474
473
{
0 commit comments