Re: broken dead code in pg_lzcompress.h

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: broken dead code in pg_lzcompress.h
Date: 2006-10-05 21:17:07
Message-ID: 45257653.40909@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/5/2006 5:04 PM, Tom Lane wrote:
> I came across the following obviously corrupt macro in pg_lzcompress.h:
>
> #define PGLZ_IS_COMPRESSED(_lzdata) ((_lzdata)->varsize != \
> e (_lzdata)->rawsize + e \
> sizeof(PGLZ_Header))
> The reason we have not noticed its brokenness is that it's only used in
> macro pglz_decomp_init, which is used nowhere. In fact there seems to
> be quite a lot of dead code in this header. I'm inclined to remove
> everything that's not referenced, rather than try to fix it.

That's quite possible that there is a fair amount of dead code in there
because it was originally the header for the lztext datatype, which if
memory served only existed quietly in one release to support slightly
larger rewrite rules before it was replaced with TOAST.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-10-05 21:22:12 Re: broken dead code in pg_lzcompress.h
Previous Message Tom Lane 2006-10-05 21:04:55 broken dead code in pg_lzcompress.h