dbTalk Databases Forums  

Re: [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Kris Jurka
 
Posts: n/a

Default Re: [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB - 07-22-2005 , 01:55 PM








On Fri, 22 Jul 2005, Andrus Adamchik wrote:

Quote:
Bug reference: 1780
PostgreSQL version: 8.0.1
Description: JDBC driver "setNull" throws for BLOB and CLOB columns
Details:

Whenver I call PreparedStatement.setNull(int, int) on BLOB or CLOB columns,
an exception below occurs. Driver version: postgresql-8.0-310.jdbc3.jar. But
looks like latest CVS version has the same problem.


This has been fixed in CVS for the 8.0 and development drivers, we just
haven't done a release in nearly three months. I'll put out a release
this weekend unless there are any other outstanding fixes I'm unaware of.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
  #2  
Old   
Andrus Adamchik
 
Posts: n/a

Default Re: [BUGS] BUG #1780: JDBC driver "setNull" throws for BLOB and CLOB - 08-05-2005 , 12:29 AM






Just tested it with build 312 and the original problem went away. Now
I am seeing a new problem with null BLOBs only:

java.sql.SQLException: ERROR: column "blob_col" is of type bytea but
expression is of type oid
at org.postgresql.core.v3.QueryExecutorImpl.receiveEr rorResponse
(QueryExecutorImpl.java:1471)
at org.postgresql.core.v3.QueryExecutorImpl.processRe sults
(QueryExecutorImpl.java:1256)
at org.postgresql.core.v3.QueryExecutorImpl.execute
(QueryExecutorImpl.java:175)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut e
(AbstractJdbc2Statement.java:389)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut eWithFlags
(AbstractJdbc2Statement.java:330)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execut e
(AbstractJdbc2Statement.java:321)
at NullBlob.main(NullBlob.java:26)

In other words "bytea" columns allow inserting non-null blobs, but
null generates the exception above. Here is sample code:

PreparedStatement st = c
.prepareStatement("insert into BLOB_TEST (BLOB_TEST_ID,
BLOB_COL) values (?, ?)");
st.setInt(1, 1);
st.setNull(2, Types.BLOB);
st.execute(); // this line throws the exception above

Andrus



On Jul 22, 2005, at 11:40 PM, Kris Jurka wrote:

Quote:

On Fri, 22 Jul 2005, Kris Jurka wrote:


On Fri, 22 Jul 2005, Andrus Adamchik wrote:


Whenver I call PreparedStatement.setNull(int, int) on BLOB or
CLOB columns,
an exception below occurs. Driver version:
postgresql-8.0-310.jdbc3.jar. But
looks like latest CVS version has the same problem.



This has been fixed in CVS for the 8.0 and development drivers, we
just
haven't done a release in nearly three months. I'll put out a
release
this weekend unless there are any other outstanding fixes I'm
unaware of.



Actually looking more closely, this was fixed in build 311 which is
available, but we should still put out a new release for other fixes.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.