Commit a0a7e634 authored by Teodor Sigaev's avatar Teodor Sigaev

Fix incorrect comparison of scan key in GIN. Per report from

Vyacheslav Kalinin <vka@mgcp.com>
parent 376c6203
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * 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 ...@@ -74,7 +74,9 @@ fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query
/* link to the equals entry in current scan key */ /* link to the equals entry in current scan key */
key->scanEntry[i].master = NULL; key->scanEntry[i].master = NULL;
for (j = 0; j < i; j++) 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; key->scanEntry[i].master = key->scanEntry + j;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment