pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
cursor control
2+ messages / 2 participants
[nested] [flat]

* cursor control
@ 2005-10-07 14:52 Johann Zuschlag <zuschlag2@online.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Johann Zuschlag @ 2005-10-07 14:52 UTC (permalink / raw)
  To: dpage@vale-housing.co.uk; +Cc: pgsql-odbc

Hi Dave,

I don't understand the following in qresult.c:

503:        /* Speed up access */
504:        int                     fetch_count = self->fetch_count;

And then:

515:        if (fetch_count < fetch_count)
516:        {
517:                /* return a row from cache */
518:                mylog("next_tuple: fetch_count < fcount:
          returning tuple %d, fcount = %d\n", fetch_count, num_backend_rows);
519:                self->tupleField = the_tuples + (fetch_count * self->num_fields);               /* next row */
520:                self->fetch_count++;
521:                return TRUE;
522:        }
523:        else if (self->num_backend_rows < self->cache_size)

Maybe I'm misled. But  I assume (fetch_count < fetch_count) will never 
become true.

Regards
Johann




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: cursor control
@ 2005-10-07 15:06 Dave Page <dpage@vale-housing.co.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Dave Page @ 2005-10-07 15:06 UTC (permalink / raw)
  To: Johann Zuschlag <zuschlag2@online.de>; +Cc: pgsql-odbc

 

> -----Original Message-----
> From: Johann Zuschlag [mailto:zuschlag2@online.de] 
> Sent: 07 October 2005 15:53
> To: Dave Page
> Cc: pgsql-odbc@postgresql.org
> Subject: cursor control
> 
> Hi Dave,
> 
> I don't understand the following in qresult.c:
> 
> 503:        /* Speed up access */
> 504:        int                     fetch_count = self->fetch_count;
> 
> And then:
> 
> 515:        if (fetch_count < fetch_count)
> 516:        {
> 517:                /* return a row from cache */
> 518:                mylog("next_tuple: fetch_count < fcount:
>           returning tuple %d, fcount = %d\n", fetch_count, 
> num_backend_rows);
> 519:                self->tupleField = the_tuples + 
> (fetch_count * self->num_fields);               /* next row */
> 520:                self->fetch_count++;
> 521:                return TRUE;
> 522:        }
> 523:        else if (self->num_backend_rows < self->cache_size)
> 
> Maybe I'm misled. But  I assume (fetch_count < fetch_count) 
> will never 
> become true.

Probably not :-). I would guess that it should read:

if (fetch_count < num_backend_rows)

However Anoop and Sivakumar are fixing Use Declare/Fetch at the moment
which means they are probably hacking code around here so I don't want
to go tweaking things right now.

Regards, dave.




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-10-07 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-07 14:52 cursor control Johann Zuschlag <zuschlag2@online.de>
2005-10-07 15:06 Re: cursor control Dave Page <dpage@vale-housing.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox