Home > Archive > PostgreSQL JDBC > April 2005 > possible bug









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author possible bug
Alberto Rodriguez Galdo

2005-04-27, 8:25 pm

Hi,

I've found that this query fails:

insert into backupItem
(idbackup,pathservid
or,pathoriginal,hash
,esenlace,metadatos)
values
(null,'/home/argaldo/datos/software/tomcat/tomcat/webapps/ubt/backup/dani/null/home/argaldo/test/prueba','/home/argaldo/test/ prueba','1C940736976
FFFFFFFCFFFFFF866EFF
FFFFECFFFFFF827EFFFF
FFDC413F7FFFFFFAF76F
FFFFFF967','false','
<rdf:RDF
xmlns:ubt="http://www.pepe.es/ubt/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<rdf:Description rdf:about="http://www.pepe.es/ubt/archivo">
<ubt:permisos>420</ubt:permisos>
<ubt:UID>1000</ubt:UID>
<ubt:tipoArchivo>UNIX</ubt:tipoArchivo>
<ubt:esEnlace>false</ubt:esEnlace>
<ubt:esEnlaceDuro>false</ubt:esEnlaceDuro>
< ubt:ultimaModificaci
on>1114629588</ ubt:ultimaModificaci
on>
<ubt:GID>1000</ubt:GID>
<ubt:ultimoAcceso>1114644020</ubt:ultimoAcceso>
</rdf:Description>
</rdf:RDF>
')


this query is generated concatenating several strings in Java.

This is the stackTrace:

org.postgresql.util.PSQLException: ERROR: invalid message format
at org.postgresql.core.v3.QueryExecutorImpl. receiveErrorResponse
(QueryExecutorImpl.java:1471)
at org.postgresql.core.v3.QueryExecutorImpl. processResults(Query
ExecutorImpl.java:1256)
at org.postgresql.core.v3.QueryExecutorImpl. execute(QueryExecuto
rImpl.java:175)
at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. execute(AbstractJdbc
2Statement.java:389)
at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. executeWithFlags(Abs
tractJdbc2Statement.java:314)
at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. execute(AbstractJdbc
2Statement.java:306)
at org.apache.tomcat.dbcp.dbcp.DelegatingStatement. execute(DelegatingSt
atement.java:261)
at es.ultreia.ubt.server. ServletRecepcionArch
ivoBackup.doPost(Unknown
Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core. ApplicationFilterCha
in. internalDoFilter(App
licationFilterChain.java:252)
at org.apache.catalina.core. ApplicationFilterCha
in. doFilter(Application
FilterChain.java:173)
at org.apache.catalina.core. StandardWrapperValve
. invoke(StandardWrapp
erValve.java:214)
at org.apache.catalina.core. StandardContextValve
. invoke(StandardConte
xtValve.java:178)
at org.apache.catalina.core.StandardHostValve. invoke(StandardHostV
alve.java:126)
at org.apache.catalina.valves.ErrorReportValve. invoke(ErrorReportVa
lve.java:105)
at org.apache.catalina.valves.AccessLogValve. invoke(AccessLogValv
e.java:526)
at org.apache.catalina.core.StandardEngineValve. invoke(StandardEngin
eValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter. service(CoyoteAdapte
r.java:148)
at org.apache.coyote.http11.Http11Processor. process(Http11Proces
sor.java:825)
at org.apache.coyote.http11. Http11Protocol$Http1
1ConnectionHandler. processConnection(Ht
tp11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint. processSocket(PoolTc
pEndpoint.java:526)
at org.apache.tomcat.util.net. LeaderFollowerWorker
Thread. runIt(LeaderFollower
WorkerThread.java:80)
at org.apache.tomcat.util.threads. ThreadPool$ControlRu
nnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


The same query works using psql in console and phppgadmin and began to
fail as the xml field "metadatos" was added.

I've been playing a while with the query and found also that if I
omit the double quotes (") of the xml field, the query works well with
jdbc, but this is not acceptable as it is a must in that field.

Maybe is it a bug in parsing strings in jdbc driver's internal methods?

I've tested all jdbc drivers version > 7.4


greets,

--
Alberto Rodriguez Galdo
argaldo@gmail.com

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Oliver Jowett

2005-04-27, 8:25 pm

Alberto Rodriguez Galdo wrote:

> This is the stackTrace:
>
> org.postgresql.util.PSQLException: ERROR: invalid message format
> at org.postgresql.core.v3.QueryExecutorImpl. receiveErrorResponse
(QueryExecutorImpl.java:1471)
> at org.postgresql.core.v3.QueryExecutorImpl. processResults(Query
ExecutorImpl.java:1256)
> at org.postgresql.core.v3.QueryExecutorImpl. execute(QueryExecuto
rImpl.java:175)
> at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. execute(AbstractJdbc
2Statement.java:389)
> at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. executeWithFlags(Abs
tractJdbc2Statement.java:314)
> at org.postgresql.jdbc2. AbstractJdbc2Stateme
nt. execute(AbstractJdbc
2Statement.java:306)


Can't reproduce this against 8.0.0 with the build 310 jar. Testcase
attached. What are you doing differently to this testcase? The schema I
used (in case it wasn't an error at the Parse stage) is:

test=# \d backupitem
Table "public.backupitem"
Column | Type | Modifiers
--------------+---------+-----------
idbackup | integer |
pathservidor | text |
pathoriginal | text |
hash | text |
esenlace | text |
metadatos | text |

You might want to try appending '?loglevel=2' to your connection URL;
that should generate screeds of debugging to stderr that may be useful
in debugging this. (send it to me off-list if it's large)

-O

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com