diff options
| author | Michael Meskes <meskes@postgresql.org> | 2006-06-26 14:12:02 +0000 |
|---|---|---|
| committer | Michael Meskes <meskes@postgresql.org> | 2006-06-26 14:12:02 +0000 |
| commit | 4b98d423d77682308423ed3c4470b741f08f7b23 (patch) | |
| tree | 03d7b62a3788b14e830d823959361977fb8aa83d /src/interfaces/ecpg/preproc/preproc.y | |
| parent | 6bf44d51ead8e37fe3f75d18f64049392f902668 (diff) | |
| download | postgresql-4b98d423d77682308423ed3c4470b741f08f7b23.tar.gz | |
Added missing braces to prevent a segfault after usage of an undeclared cursor.
Diffstat (limited to 'src/interfaces/ecpg/preproc/preproc.y')
| -rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 8e1ad2e81d..a005e71f28 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.324 2006/06/06 11:31:55 meskes Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.325 2006/06/26 14:12:02 meskes Exp $ */ /* Copyright comment */ %{ @@ -292,6 +292,7 @@ add_additional_variables(char *name, bool insert) mmerror(PARSE_ERROR, ET_ERROR, "trying to access an undeclared cursor %s\n", name); return NULL; } + if (insert) { /* add all those input variables that were given earlier @@ -837,9 +838,11 @@ stmt: AlterDatabaseStmt { output_statement($1, 0, connection); } struct cursor *ptr; if ((ptr = add_additional_variables($1, true)) != NULL) + { output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL); - ptr->opened = true; + ptr->opened = true; + } } | ECPGPrepare { |
