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

Re: cursor control

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Johann Zuschlag" <zuschlag2(at)online(dot)de>
Cc: <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: cursor control
Date: 2005-10-07 15:06:35
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E4CC327D@ratbert.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgsql-odbc
 

> -----Original Message-----
> From: Johann Zuschlag [mailto:zuschlag2(at)online(dot)de] 
> Sent: 07 October 2005 15:53
> To: Dave Page
> Cc: pgsql-odbc(at)postgresql(dot)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.


pgsql-odbc by date

Next:From: doggie tameDate: 2005-10-07 18:31:34
Subject:
Previous:From: Johann ZuschlagDate: 2005-10-07 14:52:43
Subject: cursor control

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