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 <rh...@postgresql.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-committ...@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>

Reply via email to