possible bug - Mailing list pgsql-jdbc

From Alberto Rodriguez Galdo
Subject possible bug
Date
Msg-id a8ae983d05042716431a08586c@mail.gmail.com
Whole thread Raw
Responses Re: possible bug
List pgsql-jdbc
Hi,

   I've found that this query fails:

insert into backupItem
(idbackup,pathservidor,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','1C940736976FFFFFFFCFFFFFF866EFFFFFFECFFFFFF827EFFFFFFDC413F7FFFFFFAF76FFFFFFF967','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:ultimaModificacion>1114629588</ubt:ultimaModificacion>
    <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(QueryExecutorImpl.java:1256)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:314)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:306)
        at org.apache.tomcat.dbcp.dbcp.DelegatingStatement.execute(DelegatingStatement.java:261)
        at es.ultreia.ubt.server.ServletRecepcionArchivoBackup.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.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.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

pgsql-jdbc by date:

Previous
From: Martin Keller
Date:
Subject: Problems storing timestamps with calendars
Next
From: Oliver Jowett
Date:
Subject: Re: possible bug