Commit 711804fd authored by Tom Lane's avatar Tom Lane

Prevent #option dump from crashing on FORI statement with null step. Reported by Pavel.

parent 9cbcfca4
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.88 2010/01/19 01:35:31 tgl Exp $ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.89 2010/02/17 01:48:45 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -543,10 +543,13 @@ dump_fori(PLpgSQL_stmt_fori *stmt) ...@@ -543,10 +543,13 @@ dump_fori(PLpgSQL_stmt_fori *stmt)
printf(" upper = "); printf(" upper = ");
dump_expr(stmt->upper); dump_expr(stmt->upper);
printf("\n"); printf("\n");
if (stmt->step)
{
dump_ind(); dump_ind();
printf(" step = "); printf(" step = ");
dump_expr(stmt->step); dump_expr(stmt->step);
printf("\n"); printf("\n");
}
dump_indent -= 2; dump_indent -= 2;
dump_stmts(stmt->body); dump_stmts(stmt->body);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment