mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-30 19:00:29 +08:00
Fix ecpg parsing of sizeof().
The last fix used the wrong non-terminal to define valid types.
This commit is contained in:
parent
559d535819
commit
ef8b3b00b5
@ -1856,20 +1856,20 @@ DeallocateStmt: DEALLOCATE prepared_name { $$ = $2; }
|
||||
| DEALLOCATE PREPARE ALL { $$ = mm_strdup("all"); }
|
||||
;
|
||||
|
||||
Iresult: Iconst { $$ = $1; }
|
||||
| '(' Iresult ')' { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
|
||||
| Iresult '+' Iresult { $$ = cat_str(3, $1, mm_strdup("+"), $3); }
|
||||
| Iresult '-' Iresult { $$ = cat_str(3, $1, mm_strdup("-"), $3); }
|
||||
| Iresult '*' Iresult { $$ = cat_str(3, $1, mm_strdup("*"), $3); }
|
||||
| Iresult '/' Iresult { $$ = cat_str(3, $1, mm_strdup("/"), $3); }
|
||||
| Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); }
|
||||
| ecpg_sconst { $$ = $1; }
|
||||
| ColId { $$ = $1; }
|
||||
| ColId '(' ColId ')' { if (pg_strcasecmp($1, "sizeof") != 0)
|
||||
mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
|
||||
else
|
||||
$$ = cat_str(4,$1, mm_strdup("("), $3, mm_strdup(")"));
|
||||
}
|
||||
Iresult: Iconst { $$ = $1; }
|
||||
| '(' Iresult ')' { $$ = cat_str(3, mm_strdup("("), $2, mm_strdup(")")); }
|
||||
| Iresult '+' Iresult { $$ = cat_str(3, $1, mm_strdup("+"), $3); }
|
||||
| Iresult '-' Iresult { $$ = cat_str(3, $1, mm_strdup("-"), $3); }
|
||||
| Iresult '*' Iresult { $$ = cat_str(3, $1, mm_strdup("*"), $3); }
|
||||
| Iresult '/' Iresult { $$ = cat_str(3, $1, mm_strdup("/"), $3); }
|
||||
| Iresult '%' Iresult { $$ = cat_str(3, $1, mm_strdup("%"), $3); }
|
||||
| ecpg_sconst { $$ = $1; }
|
||||
| ColId { $$ = $1; }
|
||||
| ColId '(' var_type ')' { if (pg_strcasecmp($1, "sizeof") != 0)
|
||||
mmerror(PARSE_ERROR, ET_ERROR, "operator not allowed in variable definition");
|
||||
else
|
||||
$$ = cat_str(4, $1, mm_strdup("("), $3.type_str, mm_strdup(")"));
|
||||
}
|
||||
;
|
||||
|
||||
execute_rest: /* EMPTY */ { $$ = EMPTY; }
|
||||
|
Loading…
Reference in New Issue
Block a user