Skip to content

Commit b681bfd

Browse files
committed
Fix BUG #2594: Gin Indexes cause server to crash when it builds on empty table
1 parent 72a3582 commit b681bfd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/access/gin/ginbulk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.4 2006/07/16 00:54:22 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.5 2006/08/29 14:05:44 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -245,6 +245,9 @@ ginGetEntry(BuildAccumulator *accum, Datum *value, uint32 *n) {
245245
accum->stack = palloc0(sizeof(EntryAccumulator*)*(accum->maxdepth+1));
246246
entry = accum->entries;
247247

248+
if ( entry == NULL )
249+
return NULL;
250+
248251
/* find most-left value */
249252
for(;;) {
250253
accum->stack[ accum->stackpos ] = entry;

0 commit comments

Comments
 (0)