Commit b681bfdd authored by Teodor Sigaev's avatar Teodor Sigaev

Fix BUG #2594: Gin Indexes cause server to crash when it builds on empty table

parent 72a35825
...@@ -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/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) { ...@@ -245,6 +245,9 @@ ginGetEntry(BuildAccumulator *accum, Datum *value, uint32 *n) {
accum->stack = palloc0(sizeof(EntryAccumulator*)*(accum->maxdepth+1)); accum->stack = palloc0(sizeof(EntryAccumulator*)*(accum->maxdepth+1));
entry = accum->entries; entry = accum->entries;
if ( entry == NULL )
return NULL;
/* find most-left value */ /* find most-left value */
for(;;) { for(;;) {
accum->stack[ accum->stackpos ] = entry; accum->stack[ accum->stackpos ] = entry;
......
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