Everyone,

The issue of round-tripping binary data in and out of the database seems
to be a problem with the nsmysql driver -- probably others, too, that
use the nsdb API.

The core of the problem (for the nsmysql driver) is that it uses
Ns_SetPutValue() to return the data for the columns, which in turn dups
the "string" using ns_strcopy() which in turn call ns_strdup() which
eventually uses strcpy() and strlen() -- obviously, working with binary
data with embedded NULLs, this will not give the desired effect.

I'm keen to add an ns_memcopy() to nsthread/memory.c which complements
ns_strcopy() except it would take a length arg and use memcpy() instead.
But then, I'd have to go through and rework the Ns_Set*() functions to
introduce a matching function that also took length as well.  But then,
it'd be possible to store keys and values in an ns_set with embedded
NULLs.

I know Jim's keen on revamping the nsdb API, but if we want to continue
using ns_set's and be able to store binary data in them, this might be a
useful change, anyhow.

I'm also wondering if this would be a good time to convert ns_set's to
store Tcl_Obj's instead of char*'s ... what are people's thoughts on
that?

-- Dossy

--
Dossy Shiobara                       mail: [EMAIL PROTECTED]
Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to