|
3 | 3 | *
|
4 | 4 | * Copyright (c) 2000-2010, PostgreSQL Global Development Group
|
5 | 5 | *
|
6 |
| - * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.227 2010/08/14 13:59:49 tgl Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.228 2010/08/14 14:20:35 tgl Exp $ |
7 | 7 | */
|
8 | 8 | #include "postgres_fe.h"
|
9 | 9 | #include "command.h"
|
@@ -611,17 +611,17 @@ exec_command(const char *cmd,
|
611 | 611 | /*
|
612 | 612 | * lineno "1" should correspond to the first line of the
|
613 | 613 | * function body. We expect that pg_get_functiondef() will
|
614 |
| - * emit that on a line beginning with "AS $function", and that |
615 |
| - * there can be no such line before the real start of the |
616 |
| - * function body. Increment lineno by the number of lines |
617 |
| - * before that line, so that it becomes relative to the first |
618 |
| - * line of the function definition. |
| 614 | + * emit that on a line beginning with "AS ", and that there |
| 615 | + * can be no such line before the real start of the function |
| 616 | + * body. Increment lineno by the number of lines before that |
| 617 | + * line, so that it becomes relative to the first line of the |
| 618 | + * function definition. |
619 | 619 | */
|
620 | 620 | const char *lines = query_buf->data;
|
621 | 621 |
|
622 | 622 | while (*lines != '\0')
|
623 | 623 | {
|
624 |
| - if (strncmp(lines, "AS $function", 12) == 0) |
| 624 | + if (strncmp(lines, "AS ", 3) == 0) |
625 | 625 | break;
|
626 | 626 | lineno++;
|
627 | 627 | /* find start of next line */
|
@@ -1150,17 +1150,17 @@ exec_command(const char *cmd,
|
1150 | 1150 | /*
|
1151 | 1151 | * lineno "1" should correspond to the first line of the
|
1152 | 1152 | * function body. We expect that pg_get_functiondef() will
|
1153 |
| - * emit that on a line beginning with "AS $function", and that |
1154 |
| - * there can be no such line before the real start of the |
1155 |
| - * function body. |
| 1153 | + * emit that on a line beginning with "AS ", and that there |
| 1154 | + * can be no such line before the real start of the function |
| 1155 | + * body. |
1156 | 1156 | *
|
1157 | 1157 | * Note that this loop scribbles on func_buf.
|
1158 | 1158 | */
|
1159 | 1159 | while (*lines != '\0')
|
1160 | 1160 | {
|
1161 | 1161 | char *eol;
|
1162 | 1162 |
|
1163 |
| - if (in_header && strncmp(lines, "AS $function", 12) == 0) |
| 1163 | + if (in_header && strncmp(lines, "AS ", 3) == 0) |
1164 | 1164 | in_header = false;
|
1165 | 1165 | /* increment lineno only for body's lines */
|
1166 | 1166 | if (!in_header)
|
|
0 commit comments