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

From Neil Conway
Subject Re: psql: backslash fix
Date
Msg-id 1015886973.2119.11.camel@jiro
Whole thread Raw
In response to Re: psql: backslash fix  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: psql: backslash fix  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
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


pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql: backslash fix
Next
From: Bruce Momjian
Date:
Subject: Re: psql: backslash fix