[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: very obscure problem, help needed

From: Neil Jerram
Subject: Re: very obscure problem, help needed
Date: Mon, 9 Oct 2000 21:47:51 +0100

   >           ... are you by any chance doing anything with strings
   > that you got back from Postgres?  I found that it is dangerous to
   > treat such strings as shareable.  Specifically, I found that
   > (use-modules (database postgres))
   > (use-modules (ice-9 string-fun))
   > ...
   > (sans-surrounding-whitespace (pg-getvalue dataset row col))
   > would cause mysterious errors later in the program.

   This is the first time I've heard of such a problem.

   > But if I use a private copy of sans-surrounding-whitespace, in which
   > `make-shared-substring'

   [now deprecated]

   > is replaced by `substring', the program
   > behaves correctly.

   You should have reported this as a bug in guile or guile-pg.

Indeed - my apologies.

   I've checked the guile-pg code and I can't see a problem: the return
   value from pg_getvalue is a guile string created by either a call to
   scm_makfromstr (possibly via scm_makfrom0str).  This copies the string
   pointed to by the return value from the postgres client library into a
   freshly allocated (from scm_makstr) guile string.  Thereafter it
   should behave as any guile string does.

   Does anybody know of any bugs with shared substrings in 1.4?

I think I was using pre-1.4 Guile when I observed this behaviour.  If
I get time, I will try to

- reproduce the behaviour with pre-1.4 Guile, and investigate further

- see whether I still get strange behaviour if I revert to the
  distributed version of string-fun.scm with current CVS Guile.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]