From a0a7e6343406b2c9689dc7ccd9550ac603478cb6 Mon Sep 17 00:00:00 2001 From: Teodor Sigaev Date: Mon, 18 Jan 2010 11:50:43 +0000 Subject: [PATCH] Fix incorrect comparison of scan key in GIN. Per report from Vyacheslav Kalinin --- src/backend/access/gin/ginscan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c index 6845bfc502..1aa4ea9082 100644 --- a/src/backend/access/gin/ginscan.c +++ b/src/backend/access/gin/ginscan.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.25 2010/01/02 16:57:33 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.26 2010/01/18 11:50:43 teodor Exp $ *------------------------------------------------------------------------- */ @@ -74,7 +74,9 @@ fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query /* link to the equals entry in current scan key */ key->scanEntry[i].master = NULL; for (j = 0; j < i; j++) - if (compareEntries(ginstate, attnum, entryValues[i], entryValues[j]) == 0) + if (compareEntries(ginstate, attnum, entryValues[i], entryValues[j]) == 0 && + key->scanEntry[i].isPartialMatch == key->scanEntry[j].isPartialMatch && + key->scanEntry[i].strategy == key->scanEntry[j].strategy) { key->scanEntry[i].master = key->scanEntry + j; break; -- 2.40.0