Re: Patch for - Change FETCH/MOVE to use int8

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch for - Change FETCH/MOVE to use int8
Date: 2006-08-13 22:19:40
Message-ID: 20060813221939.GA14441@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Dhanaraj M wrote:

I had a quick look:

> ***************
> *** 209,215 ****
>
> /* Return command status if wanted */
> if (completionTag)
> ! snprintf(completionTag, COMPLETION_TAG_BUFSIZE, "%s %ld",
> stmt->ismove ? "MOVE" : "FETCH",
> nprocessed);
> }
> --- 209,215 ----
>
> /* Return command status if wanted */
> if (completionTag)
> ! snprintf(completionTag, COMPLETION_TAG_BUFSIZE, "%s %lld",
> stmt->ismove ? "MOVE" : "FETCH",
> nprocessed);
> }

You shouldn't be using %lld as it breaks on some platforms.
Use INT64_FORMAT instead.

> --- ./src/backend/parser/gram.y Sun Aug 13 00:06:28 2006
> ***************
> *** 116,122 ****
>
> %union
> {
> ! int ival;
> char chr;
> char *str;
> const char *keyword;
> --- 116,122 ----
>
> %union
> {
> ! int64 ival;
> char chr;
> char *str;
> const char *keyword;

I don't think this is the right approach. Maybe it would be reasonable
to add another arm to the %union instead, not sure. The problem is the
amount of ugly casts you have to use below. The scanner code seems to
think that a constant larger than the biggest int4 should be treated as
float, so I'm not sure why this would work anyway.

> ***************
> *** 767,773 ****
> /*
> * Force the queryDesc destination to the right thing. This supports
> * MOVE, for example, which will pass in dest = DestNone. This is okay to
> ! * change as long as we do it on every fetch. (The Executor must not
> * assume that dest never changes.)
> */
> if (queryDesc)
> --- 767,773 ----
> /*
> * Force the queryDesc destination to the right thing. This supports
> * MOVE, for example, which will pass in dest = DestNone. This is okay to
> ! * change as int64 as we do it on every fetch. (The Executor must not
> * assume that dest never changes.)
> */
> if (queryDesc)

Too enthusiastic about the search'n replace I think.

I stopped reading at this point.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Perez 2006-08-13 22:23:22 Re: An Idea for planner hints
Previous Message Dave Page 2006-08-13 22:02:31 Re: [PATCHES] Adding fulldisjunctions to the contrib

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-08-13 22:37:04 Re: [PATCHES] Adding fulldisjunctions to the contrib
Previous Message Jonah H. Harris 2006-08-13 21:02:07 Re: [PATCHES] Adding fulldisjunctions to the contrib