Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.

From: Kevin Hale Boyes <kcboyes(at)gmail(dot)com>
To: Robert Haas <rhaas(at)postgresql(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.
Date: 2013-10-03 22:38:52
Message-ID: CADAecHWWstByBh40wE_WXtsrSv31Ed5k+pD1QbRDXx06KuCgKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

My C is very rusty but the traversal of SeqTableData doesn't seem correct.
It saves the seqtab->next pointer into next, frees seqtab and then
dereferences it.
Shouldn't that last line be: seqtab = next?

Kevin.

+/*
+ * Flush cached sequence information.
+ */
+void
+ResetSequenceCaches(void)
+{
+ SeqTableData *next;
+
+ while (seqtab != NULL)
+ {
+ next = seqtab->next;
+ free(seqtab);
+ seqtab = seqtab->next;
+ }

On 3 October 2013 14:23, Robert Haas <rhaas(at)postgresql(dot)org> wrote:

> Add DISCARD SEQUENCES command.
>
> DISCARD ALL will now discard cached sequence information, as well.
>
> Fabrízio de Royes Mello, reviewed by Zoltán Böszörményi, with some
> further tweaks by me.
>
> Branch
> ------
> master
>
> Details
> -------
>
> http://git.postgresql.org/pg/commitdiff/d90ced8bb22194cbb45f58beb0961251103aeff5
>
> Modified Files
> --------------
> doc/src/sgml/ref/discard.sgml | 12 +++++++++++-
> src/backend/commands/discard.c | 8 +++++++-
> src/backend/commands/sequence.c | 16 ++++++++++++++++
> src/backend/parser/gram.y | 9 ++++++++-
> src/backend/tcop/utility.c | 3 +++
> src/bin/psql/tab-complete.c | 2 +-
> src/include/commands/sequence.h | 1 +
> src/include/nodes/parsenodes.h | 1 +
> src/test/regress/expected/sequence.out | 3 +++
> src/test/regress/sql/sequence.sql | 2 ++
> 10 files changed, 53 insertions(+), 4 deletions(-)
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-10-04 00:16:41 Re: [COMMITTERS] pgsql: Add DISCARD SEQUENCES command.
Previous Message Robert Haas 2013-10-03 20:23:50 pgsql: Add DISCARD SEQUENCES command.

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2013-10-03 22:55:45 Re: Any reasons to not move pgstattuple to core?
Previous Message Robert Haas 2013-10-03 22:34:06 Re: Any reasons to not move pgstattuple to core?