Re: [GENERAL] Postgres 7.3b1 + JDBC3 (2002-09-05) truncates SQL

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Barry Lind <barry(at)xythos(dot)com>
Cc: "H(dot) Meyer" <nospaming(at)gmx(dot)net>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [GENERAL] Postgres 7.3b1 + JDBC3 (2002-09-05) truncates SQL
Date: 2002-09-18 22:22:54
Message-ID: 20020918222254.GC25435@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

I've seen something like this -- it was due to an embedded null (\0) in a
string value being inserted (presumably at the end of 'SCRAPBOOK', here)
which the JDBC driver doesn't escape and the backend appears to treat as
"end of query string". Took me a while to find as printing Strings doesn't
show nulls!

I experimented with escaping it in the driver, but it looks like the backend
doesn't support embedded nulls in TEXT either? (the stored value is silently
truncated at the null).

-O

On Wed, Sep 18, 2002 at 10:08:14AM -0700, Barry Lind wrote:
> I can't reproduce this problem. Can you submit a simple test case that
> reproduces the problem?
>
> thanks,
> --Barry
>
>
>
> H. Meyer wrote:
> >hi
> >
> >i have a very wired problem.
> >when i try to execute the following SQL command:
> >
> >INSERT INTO SERIES
> >(seriesDateTime,modality,seriesnumber,seriesinstanceuid,seriesdescr,bodypartexamined,slicethickness,sequencename,viewdirection,studytype,fieldofview,contrastAgent,numberseriesrelatedimages,manufacturermodel,stuParent,insertTimestamp)
> >VALUES ('2002-05-07 14:34:12.0', 'MR', '2',
> >'1.2.804.114118.1.20020507.143415.2812940098.1.1', 'SCRAPBOOK', '',
> >'006.000000E+00', 'b0_1000', 'HEAD', 'MEA', '261*261', '', 0, 'MAGNETOM
> >Harmony', '1.3.12.2.1107.5.2.5.10288.20020426150938000', '2002-09-17
> >11:07:30.293');
> >
> >via the JDBC3 beta driver for postgres 7.3b1 i get the following error.
> >
> >2002-09-17 11:07:30 [24588] LOG: query: INSERT INTO SERIES
> >(seriesDateTime,modality,seriesnumber,seriesinstanceuid,seriesdescr,bodypartexamined,slicethickness,sequencename,viewdirection,studytype,fieldofview,contrastAgent,numberseriesrelatedimages,manufacturermodel,stuParent,insertTimestamp)
> >VALUES ('2002-05-07 14:34:12.0', 'MR', '2',
> >'1.2.804.114118.1.20020507.143415.2812940098.1.1', 'SCRAPBOOK
> >2002-09-17 11:07:30 [24588] ERROR: parser: unterminated quoted string
> >at or near "'SCRAPBOOK" at character 349
> >2002-09-17 11:07:30 [24588] LOG: statement: INSERT INTO SERIES
> >(seriesDateTime,modality,seriesnumber,seriesinstanceuid,seriesdescr,bodypartexamined,slicethickness,sequencename,viewdirection,studytype,fieldofview,contrastAgent,numberseriesrelatedimages,manufacturermodel,stuParent,insertTimestamp)
> >VALUES ('2002-05-07 14:34:12.0', 'MR', '2',
> >'1.2.804.114118.1.20020507.143415.2812940098.1.1', 'SCRAPBOOK

[...]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Garo Hussenjian 2002-09-19 00:27:56 Boolean internal representation
Previous Message Tom Lane 2002-09-18 21:50:16 Re: posix style regexp?

Browse pgsql-jdbc by date

  From Date Subject
Next Message J S 2002-09-19 02:40:11 multiple users accessing database
Previous Message Barry Lind 2002-09-18 22:00:55 Re: postgresql-7.2.2 jdbc compile failure