Received: from u1.abs.net (root@u1.abs.net [207.114.0.131]) by hub.org (8.9.2/8.9.1) with ESMTP id TAA04526 for ; Fri, 9 Apr 1999 19:08:14 -0400 (EDT) (envelope-from byronn@insightdist.com) Received: from insightdist.com (nobody@localhost) by u1.abs.net (8.9.0/8.9.0) with UUCP id SAA29190 for pgsql-interfaces@postgreSQL.org; Fri, 9 Apr 1999 18:52:16 -0400 (EDT) X-Authentication-Warning: u1.abs.net: nobody set sender to insightdist.com!byronn using -f Received: from ceodev by insightdist.com (AIX 3.2/UCB 5.64/4.03) id AA17956; Fri, 9 Apr 1999 18:38:21 -0400 Received: from ppp0_ceodev by ceodev (AIX 4.1/UCB 5.64/4.03) id AA56158; Fri, 9 Apr 1999 18:38:19 -0400 Message-Id: <370E8328.12C47676@insightdist.com> Date: Fri, 09 Apr 1999 18:46:00 -0400 From: Byron Nikolaidis X-Mailer: Mozilla 4.05 [en] (Win95; I) Mime-Version: 1.0 To: Sam@OConnor.net Cc: "pgsql-interfaces@postgreSQL.org" Subject: Re: [INTERFACES] ODBC Driver v06-40-0005 References: <370D697E.55AB30F4@insightdist.com> <370E3EAA.4E43ED87@netspace.net.au> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sam O'Connor wrote: > Hi, > I think I found another problem. > When selecting type text from tclodbc using pgodbc and postgres I was > loosing > one character off the start of the string for every newline in > contained. > When copy_and_conver_field processes selected text fields it converts cr > to cr/lf. (why?) > Actually, its LF to CR/LF when going from the database to odbc. When going the other way (odbc->database), it converts CR/LF to LF. The reason is for Microsoft from what I remember. It might have even been in the odbc spec (I can't quite remember). It probably shouldn't do it if its being run on Unix though? > When data_left is set how ever it uses the original length. > > I changed this: > stmt->bindings[stmt->current_col].data_left = strlen(value); > To this: > stmt->bindings[stmt->current_col].data_left = strlen(ptr); > > Now it works! > Good Job, you found a bug alright! It should be strlen(ptr). When I tested it, I didn't have newlines so it worked ok. I'll put it in for the next release. Byron