From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5989: Assertion failure on UPDATE of big value
Date: Wed, 20 Apr 2011 14:16:33 -0500
Message-ID: <4DAEEAC1020000250003CAB7@gw.wicourts.gov> (raw)
In-Reply-To: <27328.1303313171@sss.pgh.pa.us>
References: <201104201411.p3KEBOfA009414@wwwmaster.postgresql.org>
<4DAEB087020000250003CA8B@gw.wicourts.gov>
<4DAEF7E6.7080107@enterprisedb.com>
<4DAEF7E6.7080107@enterprisedb.com>
<27328.1303313171@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Egad. If that's it, my confidence in the amount of testing SSI
> has gotten has just dropped dramatically.
If I'm reading this correctly, it would appear that nobody has
updated anything to a TOASTed value in a build against HEAD in
testing *anything* in the last two and a half months. And the
regression tests don't include a single UPDATE to a TOASTed value
anywhere. That seems like a significant code coverage deficiency.
Attached is a patch to cure the latter of these. I'm submitting
this separately since it seems a good idea regardless of what
happens with the related SSI issue.
It is, of course, no excuse for making a dumb mistake like that, but
it wouldn't have survived the day on my machine or Dan's, much less
been submitted as a patch or committed, with the attached general
test of update-to-TOAST functionality in the regression tests.
-Kevin
Attachments:test-update-to-toast.patch (text/plain, 1.2K) download
*** a/src/test/regress/expected/update.out
--- b/src/test/regress/expected/update.out
***************
*** 87,90 **** ERROR: invalid reference to FROM-clause entry for table "update_test"
--- 87,99 ----
LINE 1: UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a...
^
HINT: Perhaps you meant to reference the table alias "t".
+ -- Make sure that we can update to a TOASTed value.+ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car';+ SELECT a, b, char_length(c) FROM update_test;+ a | b | char_length + -----+----+-------------+ 100 | 20 | + 11 | 41 | 10000+ (2 rows)+
DROP TABLE update_test;
*** a/src/test/regress/sql/update.sql
--- b/src/test/regress/sql/update.sql
***************
*** 54,57 **** UPDATE update_test SET (a,b) = (select a,b FROM update_test where c = 'foo')
--- 54,61 ----
-- to the original table name
UPDATE update_test AS t SET b = update_test.b + 10 WHERE t.a = 10;
+ -- Make sure that we can update to a TOASTed value.+ UPDATE update_test SET c = repeat('x', 10000) WHERE c = 'car';+ SELECT a, b, char_length(c) FROM update_test;+
DROP TABLE update_test;
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, heikki.linnakangas@enterprisedb.com, tgl@sss.pgh.pa.us
Subject: Re: BUG #5989: Assertion failure on UPDATE of big value
In-Reply-To: <4DAEEAC1020000250003CAB7@gw.wicourts.gov>
References: <201104201411.p3KEBOfA009414@wwwmaster.postgresql.org> <4DAEB087020000250003CA8B@gw.wicourts.gov> <4DAEF7E6.7080107@enterprisedb.com> <27328.1303313171@sss.pgh.pa.us> <4DAEEAC1020000250003CAB7@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox