pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedDBD::Pg and $sth->{ParamValues}
2+ messages / 2 participants
[nested] [flat]
* DBD::Pg and $sth->{ParamValues}
@ 2004-07-02 07:09 jason_e_stewart@users.sourceforge.net
0 siblings, 1 reply; 2+ messages in thread
From: jason_e_stewart@users.sourceforge.net @ 2004-07-02 07:09 UTC (permalink / raw)
To: pgsql-interfaces; +Cc: dbi-dev@perl.org
Hey,
What is the status of the this attribute? I would like to help
implement the code (since I need it for my application).
But I'm a bit confused about what the status of prepared statements is
in the code. I'm assuming the the dbd_st_execute() in dbdimp.c is the
latest code used and that prescan_stmt.c isn't being used.
I'm not a great C coder anymore so pardon my ignorance. From my
reading of the code, there is an array:
const char **paramValues;
which is dynamically allocated:
paramValues = calloc(imp_sth->numphs, sizeof(*paramValues));
but it is never freed, isn't that a memory leak? I'm wondering about
this because in order to make the ParamValues attribute work, I'll
need to make that array part of the statement handle - and I don't
want to be keeping track of memory that is going to vanish out from
underneath me.
Cheers,
jas.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: DBD::Pg and $sth->{ParamValues}
@ 2004-07-02 23:32 Greg Sabino Mullane <greg@turnstep.com>
parent: jason_e_stewart@users.sourceforge.net
0 siblings, 0 replies; 2+ messages in thread
From: Greg Sabino Mullane @ 2004-07-02 23:32 UTC (permalink / raw)
To: pgsql-interfaces; +Cc: dbdpg-general@postgresql.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> What is the status of the this attribute? I would like to help
> implement the code (since I need it for my application).
Feel free to jump in. I'm pretty sure it is unsupported at the moment.
> But I'm a bit confused about what the status of prepared statements is
> in the code. I'm assuming the the dbd_st_execute() in dbdimp.c is the
> latest code used and that prescan_stmt.c isn't being used.
That is correct.
> paramValues = calloc(imp_sth->numphs, sizeof(*paramValues));
>
> but it is never freed, isn't that a memory leak?
Yes, probably so. I don't like the use of calloc anyway, so if you
can find a way to use New() in a loop instead, I'd go that way. Feel
free to strip out the 'y' and 'z' ints as well, looks like those
are leftover debugging aids.
> this because in order to make the ParamValues attribute work, I'll
> need to make that array part of the statement handle - and I don't
> want to be keeping track of memory that is going to vanish out from
> underneath me.
Upon looking at the code again, I think everything you need is already
there, inside of imp_sth->seg->value. But getting rid of that calloc
would still be nice. :)
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200407021933
-----BEGIN PGP SIGNATURE-----
iD8DBQFA5fDvvJuQZxSWSsgRAqR7AKCbp97sb/Y1plTdJ0ucTOiNy2EXgACfQmzE
+X0SUFg+ImHdyUAobivwPoI=
=iCjA
-----END PGP SIGNATURE-----
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-07-02 23:32 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-02 07:09 DBD::Pg and $sth->{ParamValues} jason_e_stewart@users.sourceforge.net
2004-07-02 23:32 ` Greg Sabino Mullane <greg@turnstep.com>
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