diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2006-08-29 14:05:44 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2006-08-29 14:05:44 +0000 |
commit | b681bfdd59918e3b65bd0b499075f99b39e511b5 (patch) | |
tree | 71bf4d5028e61eb575f8311159ed388bf9175ee9 | |
parent | 72a35825228755fc5d697f052980f5b82c2e5ec6 (diff) | |
download | postgresql-b681bfdd59918e3b65bd0b499075f99b39e511b5.tar.gz postgresql-b681bfdd59918e3b65bd0b499075f99b39e511b5.zip |
Fix BUG #2594: Gin Indexes cause server to crash when it builds on empty table
-rw-r--r-- | src/backend/access/gin/ginbulk.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/gin/ginbulk.c b/src/backend/access/gin/ginbulk.c index c614b624c3a..5bcd91af141 100644 --- a/src/backend/access/gin/ginbulk.c +++ b/src/backend/access/gin/ginbulk.c @@ -8,7 +8,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.4 2006/07/16 00:54:22 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.5 2006/08/29 14:05:44 teodor Exp $ *------------------------------------------------------------------------- */ @@ -245,6 +245,9 @@ ginGetEntry(BuildAccumulator *accum, Datum *value, uint32 *n) { accum->stack = palloc0(sizeof(EntryAccumulator*)*(accum->maxdepth+1)); entry = accum->entries; + if ( entry == NULL ) + return NULL; + /* find most-left value */ for(;;) { accum->stack[ accum->stackpos ] = entry; |