Skip site navigation (1) Skip section navigation (2)

Re: ecpg - GRANT bug

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org, maves(at)csl(dot)co(dot)uk, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: ecpg - GRANT bug
Date: 2001-10-13 04:14:46
Message-ID: 200110130414.f9D4Ekj03587@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Your patch has been added to the PostgreSQL unapplied patches list at:

	http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


> I've noticed general buggyness with ecpg on one of my source files for
> a while now but it only got really annoying after setting up overnight
> build on Linux (output corrupt code), Solaris (output correct code),
> AIX (crashed) and HPUX (crashed).
> 
> After comparing the output from ecpg on Linux and Solaris the
> following type of statement was the root of the crash:
> 
>  EXEC SQL GRANT ALL ON exampletable TO PUBLIC;
> 
> When the parser code was rebuilding the query to pass onto the server
> it was trying to include an extra, non-existent, parameter...
> 
> The bug is present in 7.1.2, 7.1.3 and the current CVS sources. The
> following patch (against CVS version) corrects this bug:
> 
> ./interfaces/ecpg/preproc/preproc.y
> *** ./interfaces/ecpg/preproc/preproc.y.orig	Fri Oct 12 16:22:05 2001
> --- ./interfaces/ecpg/preproc/preproc.y	Fri Oct 12 16:22:09 2001
> ***************
> *** 1693,1699 ****
>   
>   GrantStmt:  GRANT privileges ON opt_table relation_name_list TO grantee_list opt_with_grant
>   				{
> ! 					$$ = cat_str(8, make_str("grant"), $2, make_str("on"), $4, $5, make_str("to"), $7);
>   				}
>   		;
>   
> --- 1693,1699 ----
>   
>   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);
>   				}
>   		;
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-10-13 04:25:28
Subject: Re: PG_DUMP NLS (Russian)
Previous:From: Bruce MomjianDate: 2001-10-13 04:13:32
Subject: Re: TOAST and TEXT

pgsql-bugs by date

Next:From: Tom LaneDate: 2001-10-13 17:43:02
Subject: Re: Bug #477: path ?# path
Previous:From: Bruce MomjianDate: 2001-10-13 01:21:03
Subject: Re: Bug #477: path ?# path

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group