PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Linas Vepstas
Hi, Below follows a series of 12 patches against Guile-DBI and DBD-Postgres. Guile DBI is a wrapper for accessing SQL databases. https://gna.org/projects/guile-dbi/ I'm posting here -- although there used to be guile-dbi-user and guile-dbi-devel mailing lists, these had no subscribers, and quic

[PATCH 1/12] Guile-DBI: Avoid multiple init

2008-09-19 Thread Linas Vepstas
If (use-modules (dbi dbi)) is called multiple times, then guile will crash in various strange ways, often during garbage-collection. Thus, avoid initializaing more than once. From: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbi.c |3 +++ 1 file changed, 3 insertions(+) Index: guile-d

[PATCH 2/12] Guile-DBI: minor cleanup

2008-09-19 Thread Linas Vepstas
Minor cleanup: -- avoid forward decarations -- rename confusingly named function -- free function should return zero, per current guile specs. -- remove deprecated header -- fix typo Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- include/guile-dbi/guile-dbi.h | 10 +++--- src/guil

[PATCH 3/12] Guile-DBI: Fix memory leak

2008-09-19 Thread Linas Vepstas
Fix memory leak; various allocated strins are not freed in assorted error paths. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbi.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) Index: guile-dbi-2.0.0/src/guile-dbi.c =

[PATCH 4/12] Guile-DBII: replace deprecated gh_ functions

2008-09-19 Thread Linas Vepstas
Replace deprecated gh_ functions with modern scm_ functions Also, another memory leak. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbi.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Index: guile-dbi-2.0.0/src/guile-dbi.c ===

[PATCH 6/12] Guile-DBI: Fix crash, avoid recursive free

2008-09-19 Thread Linas Vepstas
There is a particularly nasty crash scenario invloving the garbage collector. The problem is that the dbi free routine calls the dbi close routine, which tries to alloc new SCM nodes. This is bad, because one should not alloc while the garbage collector is running. So add a flag, incidating tha

[PATCH 5/12] Guile-DBI: Use remember_upto_here

2008-09-19 Thread Linas Vepstas
Sprinkle code with some scm_remember_upto_here_1(), as it looks like there's a potential garbage-collection race. Also, simplify a particularly complicated test. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbi.c | 16 ++-- 1 file changed, 10 insertions(+), 6 de

[PATCH 7/12] Guile-DBI: Don't cast away const

2008-09-19 Thread Linas Vepstas
Avoid casting away const. Actually, avoid casting. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- include/guile-dbi/guile-dbi.h |2 +- src/guile-dbi.c | 15 +++ 2 files changed, 8 insertions(+), 9 deletions(-) Index: guile-dbi-2.0.0/include/guile-dbi/guil

[PATCH 8/12] Guile-DBD-postgres: Fix handling of float point columns

2008-09-19 Thread Linas Vepstas
Database columns containing floating point and double values are not handled correctly; they are handled as ints. Fix this. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbd-postgresql.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: guile-dbd-postgr

[PATCH 9/12] Guile-DBD-postgres: Avoid discouraged functions

2008-09-19 Thread Linas Vepstas
Don't use functions from the guile "discouraged" header. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbd-postgresql.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: guile-dbd-postgresql-2.0.0/src/guile-dbd-postgresql.c ==

[PATCH 10/12] Guile-DBD-postgres: Fix off-by-one when fetching rows

2008-09-19 Thread Linas Vepstas
It appears that the current postgres dbd code will return one less row than the database actually contains, which is a disaster if the database holds only one row! Fix this. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbd-postgresql.c |2 +- 1 file changed, 1 insertion(

[PATCH 11/12] Guile-DBD-postgres: Avoid deprecated functions

2008-09-19 Thread Linas Vepstas
Don't use deprecated guile gh_ functions. Also, move some string handling functions around so as to avoid memory leak. Also, avoid some casting. Casting is bad, it can hide errors from the compiler. Signed-off-by: Linas Vepstas <[EMAIL PROTECTED]> --- src/guile-dbd-postgresql.c | 67 +++

[PATCH 12/12] Guile-DBD-postgres: Crash in GC

2008-09-19 Thread Linas Vepstas
Fix a serious bug which results in a crash in the GC. The problem is that the DBI free routine ill call the close routine, which will call this routine, which tries to alloc new SCM cells. But one must not alloc while the garbage collector is runing. Soo.. A previous patch added a flag to indicat

project page

2008-09-19 Thread tantalum
hello i think guiles project page could need at least 2 small changes. 1 replace the link 'anonymous cvs' under 'getting guile' with one to the more up to date page, this one: http://www.gnu.org/software/guile/repository.html 2 that page says to use 'git-clone', which does not exist on my sys

Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Mike Gran
- Original Message > From: Linas Vepstas <[EMAIL PROTECTED]> > > Hi, > > Below follows a series of 12 patches against Guile-DBI and DBD-Postgres. > Linus, thank you for doing this. -Mike Gran

Re: project page

2008-09-19 Thread Ludovic Courtès
Hi, tantalum <[EMAIL PROTECTED]> writes: > 1 > replace the link 'anonymous cvs' under 'getting guile' with one to the > more up to date page, > this one: http://www.gnu.org/software/guile/repository.html > > 2 > that page says to use 'git-clone', which does not exist on my system, > only 'git clo

Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Neil Jerram
2008/9/19 Linas Vepstas <[EMAIL PROTECTED]>: > > I'm posting here -- although there used to be guile-dbi-user and > guile-dbi-devel > mailing lists, these had no subscribers, and quickly filled with spam, as > evidenced by their mail archives. I've applied to get an account on gna.org > to post th

Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Greg Troxel
Also, can anyone provide a summary of all the DB-related libraries for Guile? I believe there's guile-pg, and guile-sqlite, but (i) there could be others I've forgotten, and (ii) it would be great if someone could summarize how they differ / overlap / compare with each other. I am famili

Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Greg Troxel
Also, can anyone provide a summary of all the DB-related libraries for Guile? I believe there's guile-pg, and guile-sqlite, but (i) there could be others I've forgotten, and (ii) it would be great if someone could summarize how they differ / overlap / compare with each other. guile-pg ha

Re: PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres

2008-09-19 Thread Linas Vepstas
2008/9/19 Greg Troxel <[EMAIL PROTECTED]>: > > guile-pg has really nice support for converting postgresql types to and > From scheme types, ? I would be surprised if any database interface returned a string, when the database column was declared an int, so I don't quite understand this ... > and