diff options
author | Bruce Momjian <bruce@momjian.us> | 2001-10-15 18:16:31 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2001-10-15 18:16:31 +0000 |
commit | 394925b60dad238c3eb5f9b21b282b3d116bec62 (patch) | |
tree | cb84295e03c019ff5b0b61f30b1c749fc6883d18 | |
parent | b261cb9fa19c44bf9c1688df05104aa6e8d94108 (diff) | |
download | postgresql-394925b60dad238c3eb5f9b21b282b3d116bec62.tar.gz |
> Uh, isn't the correct fix
> ! $$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5,
> make_str("to"), $7, $8);
> ISTM your patch loses the opt_with_grant clause. (Of course the
> backend doesn't currently accept that clause anyway, but that's no
> reason for ecpg to drop it.)
My patch doesn't loose the option, it's never been passed on anyway:
opt_with_grant: WITH GRANT OPTION
{
mmerror(ET_ERROR, "WITH GRANT OPTION is not supported. Only relation owners can
set privileges");
}
| /*EMPTY*/
;
The existing code in ecpg/preproc/preproc.y to handle the WITH option
simply throws an error and aborts the processing... The patch below
prevents the segfault and also passes on the WITH option to the
backend, probably a better fix.
Lee Kindness
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 8db1982c2c..f35f21c1e6 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1693,7 +1693,7 @@ comment_text: StringConst { $$ = $1; } GrantStmt: GRANT privileges ON opt_table relation_name_list TO grantee_list opt_with_grant { - $$ = cat_str(7, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7); + $$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7, $8); } ; @@ -1769,11 +1769,8 @@ grantee_list: grantee { $$ = $1; } | grantee_list ',' grantee { $$ = cat_str(3, $1, make_str(","), $3); } ; -opt_with_grant: WITH GRANT OPTION - { - mmerror(ET_ERROR, "WITH GRANT OPTION is not supported. Only relation owners can set privileges"); - } - | /*EMPTY*/ +opt_with_grant: WITH GRANT OPTION { $$ = make_str("with grant option"); } + | /*EMPTY*/ { $$ = EMPTY; } ; |