aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2001-02-26 14:42:54 +0000
committerMichael Meskes <meskes@postgresql.org>2001-02-26 14:42:54 +0000
commit06e3d84d88222696f3bc65fa0d7bfe3dfeac889d (patch)
tree08667dd8de14a75df81e06b37ebb6f5e52d98749
parentf6f8c332b1b594d9b6f62662b4734ab2eae5123f (diff)
downloadpostgresql-06e3d84d88222696f3bc65fa0d7bfe3dfeac889d.tar.gz
postgresql-06e3d84d88222696f3bc65fa0d7bfe3dfeac889d.zip
Fixed variable handling in preproc.y.
-rw-r--r--src/interfaces/ecpg/ChangeLog4
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y19
2 files changed, 14 insertions, 9 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 1bfa8d12e99..1ae8f7a9d44 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -1055,5 +1055,9 @@ Wed Jan 31 17:11:04 CET 2001
Mon Feb 19 08:25:14 CET 2001
- Synced gram.y and preproc.y.
+
+Mon Feb 26 15:22:04 CET 2001
+
+ - Fixed misplaced variables FoundInto and QueryIsRule.
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index ecb21d1b20e..29bfb3662d0 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -1247,12 +1247,13 @@ OptInherit: INHERITS '(' relation_name_list ')' { $$ = cat_str(3
* SELECT ... INTO.
*/
-CreateAsStmt: CREATE OptTemp TABLE relation_name OptCreateAs AS SelectStmt
+CreateAsStmt: CREATE OptTemp TABLE relation_name OptCreateAs AS
+ { FoundInto = 0; } SelectStmt
{
if (FoundInto == 1)
mmerror(ET_ERROR, "CREATE TABLE/AS SELECT may not specify INTO");
- $$ = cat_str(7, make_str("create"), $2, make_str("table"), $4, $5, make_str("as"), $7);
+ $$ = cat_str(7, make_str("create"), $2, make_str("table"), $4, $5, make_str("as"), $8);
}
;
@@ -2042,6 +2043,7 @@ RuleStmt: CREATE RULE name AS
ON event TO event_object where_clause
DO opt_instead RuleActionList
{
+ QueryIsRule=0;
$$ = cat_str(10, make_str("create rule"), $3, make_str("as on"), $7, make_str("to"), $9, $10, make_str("do"), $12, $13);
}
;
@@ -2510,7 +2512,6 @@ select_no_parens: simple_select
select_clause: simple_select
{
- FoundInto = 0;
$$ = $1;
}
@@ -3808,17 +3809,17 @@ ColLabel: ECPGLabelTypeName { $$ = $1; }
SpecialRuleRelation: OLD
{
- if (QueryIsRule)
- $$ = make_str("old");
- else
+ if (!QueryIsRule)
mmerror(ET_ERROR, "OLD used in non-rule query");
+
+ $$ = make_str("old");
}
| NEW
{
- if (QueryIsRule)
- $$ = make_str("new");
- else
+ if (!QueryIsRule)
mmerror(ET_ERROR, "NEW used in non-rule query");
+
+ $$ = make_str("new");
}
;