diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-17 01:48:51 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-02-17 01:48:51 +0000 |
commit | ef7604fafa6538e6e6f3884cf7c8f59da47e3535 (patch) | |
tree | 9e9247cee770074a6ea65d7734c527bc5245ab1f | |
parent | 1f2aeca060f02fdefc544bfe26aba54247a6ddb0 (diff) | |
download | postgresql-ef7604fafa6538e6e6f3884cf7c8f59da47e3535.tar.gz postgresql-ef7604fafa6538e6e6f3884cf7c8f59da47e3535.zip |
Prevent #option dump from crashing on FORI statement with null step. Reported by Pavel.
-rw-r--r-- | src/pl/plpgsql/src/pl_funcs.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/pl/plpgsql/src/pl_funcs.c b/src/pl/plpgsql/src/pl_funcs.c index 5a3b621a4ef..671ef47777a 100644 --- a/src/pl/plpgsql/src/pl_funcs.c +++ b/src/pl/plpgsql/src/pl_funcs.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.79 2009/06/11 14:49:14 momjian Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.79.2.1 2010/02/17 01:48:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -798,10 +798,13 @@ dump_fori(PLpgSQL_stmt_fori *stmt) printf(" upper = "); dump_expr(stmt->upper); printf("\n"); - dump_ind(); - printf(" step = "); - dump_expr(stmt->step); - printf("\n"); + if (stmt->step) + { + dump_ind(); + printf(" step = "); + dump_expr(stmt->step); + printf("\n"); + } dump_indent -= 2; dump_stmts(stmt->body); |