|
3 | 3 | * procedural language
|
4 | 4 | *
|
5 | 5 | * IDENTIFICATION
|
6 |
| - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.41 2005/06/10 16:23:11 neilc Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_funcs.c,v 1.42 2005/06/14 00:10:02 neilc Exp $ |
7 | 7 | *
|
8 | 8 | * This software is copyrighted by Jan Wieck - Hamburg.
|
9 | 9 | *
|
@@ -675,10 +675,12 @@ dump_if(PLpgSQL_stmt_if *stmt)
|
675 | 675 |
|
676 | 676 | dump_stmts(stmt->true_body);
|
677 | 677 |
|
678 |
| -dump_ind(); |
679 |
| -printf(" ELSE\n"); |
680 |
| - |
681 |
| -dump_stmts(stmt->false_body); |
| 678 | +if (stmt->false_body!=NIL) |
| 679 | +{ |
| 680 | +dump_ind(); |
| 681 | +printf(" ELSE\n"); |
| 682 | +dump_stmts(stmt->false_body); |
| 683 | +} |
682 | 684 |
|
683 | 685 | dump_ind();
|
684 | 686 | printf(" ENDIF\n");
|
@@ -908,6 +910,18 @@ dump_dynexecute(PLpgSQL_stmt_dynexecute *stmt)
|
908 | 910 | printf("EXECUTE ");
|
909 | 911 | dump_expr(stmt->query);
|
910 | 912 | printf("\n");
|
| 913 | + |
| 914 | +dump_indent+=2; |
| 915 | +if (stmt->rec!=NULL) |
| 916 | +{ |
| 917 | +dump_ind(); |
| 918 | +printf(" target = %d %s\n",stmt->rec->recno,stmt->rec->refname); |
| 919 | +}elseif (stmt->row!=NULL) |
| 920 | +{ |
| 921 | +dump_ind(); |
| 922 | +printf(" target = %d %s\n",stmt->row->rowno,stmt->row->refname); |
| 923 | +} |
| 924 | +dump_indent-=2; |
911 | 925 | }
|
912 | 926 |
|
913 | 927 | staticvoid
|
@@ -987,7 +1001,7 @@ plpgsql_dumptree(PLpgSQL_function *func)
|
987 | 1001 | printf("\nExecution tree of successfully compiled PL/pgSQL function %s:\n",
|
988 | 1002 | func->fn_name);
|
989 | 1003 |
|
990 |
| -printf("\nFunctions data area:\n"); |
| 1004 | +printf("\nFunction's data area:\n"); |
991 | 1005 | for (i=0;i<func->ndatums;i++)
|
992 | 1006 | {
|
993 | 1007 | d=func->datums[i];
|
@@ -1062,7 +1076,7 @@ plpgsql_dumptree(PLpgSQL_function *func)
|
1062 | 1076 | printf("??? unknown data type %d\n",d->dtype);
|
1063 | 1077 | }
|
1064 | 1078 | }
|
1065 |
| -printf("\nFunctions statements:\n"); |
| 1079 | +printf("\nFunction's statements:\n"); |
1066 | 1080 |
|
1067 | 1081 | dump_indent=0;
|
1068 | 1082 | printf("%3d:",func->action->lineno);
|
|