Re: GIST and TOAST

Поиск
Список
Период
Сортировка
Искать
От
Teodor Sigaev
Тема
Re: GIST and TOAST
Дата
Msg-id
45EDB6CD.5030005@sigaev.ru
Ответ на
Re: GIST and TOAST (Gregory Stark)
Список
Дерево обсуждения
Re: GIST and TOAST Andrew - Supernews <andrew+nonews@supernews.com>
Re: GIST and TOAST Gregory Stark <stark@enterprisedb.com>
Re: GIST and TOAST Teodor Sigaev <teodor@sigaev.ru>
Re: GIST and TOAST Gregory Stark <stark@enterprisedb.com>
Re: GIST and TOAST Teodor Sigaev <teodor@sigaev.ru>
Re: GIST and TOAST Gregory Stark <stark@enterprisedb.com>
Re: GIST and TOAST Gregory Stark <stark@enterprisedb.com>
> It doesn't actually crash, it just fails CHECKARRVALID. I added an assertion
> in there to cause it to generate a core dump.

Wow, catch that, see attached patch.

g_int_decompress doesn't returns detoasted array in case it was empty. 
Previously it was safe because empty array never has been toasted.

Should I commit it or you'll include in your patch?

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/
*** ./contrib/intarray.orig/./_int_gist.c	Tue Mar  6 20:59:23 2007
--- ./contrib/intarray/./_int_gist.c	Tue Mar  6 21:41:54 2007
***************
*** 232,238 ****
--- 232,247 ----
  
  	CHECKARRVALID(in);
  	if (ARRISVOID(in))
+ 	{
+ 		if (in != (ArrayType *) DatumGetPointer(entry->key)) {
+ 			retval = palloc(sizeof(GISTENTRY));
+ 			gistentryinit(*retval, PointerGetDatum(in),
+ 				entry->rel, entry->page, entry->offset, FALSE);
+ 			PG_RETURN_POINTER(retval);
+ 		}
+ 
  		PG_RETURN_POINTER(entry);
+ 	}
  
  	lenin = ARRNELEMS(in);
  
В списке pgsql-hackers по дате отправления
От: Dave Cramer
Дата:
От: Heikki Linnakangas
Дата:
FAQ