1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

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

This commit is contained in:
Tom Lane
2010-02-17 01:48:51 +00:00
parent 1f2aeca060
commit ef7604fafa

View File

@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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 = "); printf(" upper = ");
dump_expr(stmt->upper); dump_expr(stmt->upper);
printf("\n"); printf("\n");
dump_ind(); if (stmt->step)
printf(" step = "); {
dump_expr(stmt->step); dump_ind();
printf("\n"); printf(" step = ");
dump_expr(stmt->step);
printf("\n");
}
dump_indent -= 2; dump_indent -= 2;
dump_stmts(stmt->body); dump_stmts(stmt->body);