Re: psql: backslash fix - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: psql: backslash fix
Date
Msg-id 200203112250.g2BMokE24929@candle.pha.pa.us
Whole thread Raw
In response to Re: psql: backslash fix  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-patches
Oh, just checking.  Thank you.

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

Neil Conway wrote:
> On Mon, 2002-03-11 at 17:44, Bruce Momjian wrote:
> >
> > Is this change required:
> >
> >
> >                         &end_of_cmd);
> >
> > !                               success = slashCmdStatus != CMD_ERROR;
> >
> >                                 if ((slashCmdStatus == CMD_SEND || slashCmdStatus == CMD_NEWEDIT) &&
> >                                         query_buf->len == 0)
> > --- 467,473 ----
> >                                                    query_buf->len > 0 ? query_buf : previous_buf,
> >
> >                         &end_of_cmd);
> >
> > !                               success = (slashCmdStatus != CMD_ERROR);
> >
> >
> > I thought != was done before =, and my associativity chart shows that:
>
> Yes, that is correct. That change was just for readability (IMHO, it's
> silly to depend on operator precedence when a pair of brackets makes the
> intent of the code a lot clearer).
>
> The actual functional change is the second part of the patch:
>
> *** 476,482 ****
>                                         appendPQExpBufferStr(query_buf,
> previous_buf->data);
>                                 }
>
> !                               if (slashCmdStatus == CMD_SEND)
>                                 {
>                                         success =
> SendQuery(query_buf->data);
>                                         query_start = i + thislen;
> --- 476,482 ----
>                                         appendPQExpBufferStr(query_buf,
> previous_buf->data);
>                                 }
>
> !                               if (slashCmdStatus == CMD_SEND ||
> slashCmdStatus == CMD_ERROR)
>                                 {
>                                         success =
> SendQuery(query_buf->data);
>                                         query_start = i + thislen;
>
> Cheers,
>
> Neil
>
> --
> Neil Conway <neilconway@rogers.com>
> PGP Key ID: DB3C29FC
>
>

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

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: psql: backslash fix
Next
From: Bruce Momjian
Date:
Subject: Re: Domain Patch