Issue Details (XML | Word | Printable)

Key: DERBY-2430
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: V.Narayanan
Reporter: V.Narayanan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby
DERBY-310

setObject(int targetType, Blob source) and setObject(int targetType, Clob source) should disallow updates on all targetTypes except BLOB and CLOB respectively

Created: 09/Mar/07 07:50 AM   Updated: 16/Jun/07 04:26 PM
Return to search
Component/s: Network Client
Affects Version/s: None
Fix Version/s: 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
HTML File Licensed for inclusion in ASF works releaseNote.html 2007-06-16 04:25 PM Rick Hillegas 4 kB
HTML File Licensed for inclusion in ASF works releaseNote.html 2007-06-16 04:17 PM Rick Hillegas 4 kB
HTML File Licensed for inclusion in ASF works releaseNote.html 2007-06-15 12:15 PM V.Narayanan 4 kB
File Licensed for inclusion in ASF works setObjectForClobBlob_v1.diff 2007-03-09 07:58 AM V.Narayanan 6 kB
File Licensed for inclusion in ASF works setObjectForClobBlob_v1.stat 2007-03-09 07:58 AM V.Narayanan 0.3 kB
Environment: All
Issue Links:
Blocker
 
Reference
 

Issue & fix info: Release Note Needed
Resolution Date: 16/Jun/07 04:26 PM


 Description  « Hide
updateBlob(int columnIndex, Blob x), updateClob(int columnIndex, Clob x) can be implemented by forwarding calls to setObject(int targetType, Blob source), setObject(int targetType, Clob source). If this this done then

1) updateClob on a CHAR/VARCHAR/LONG VARCHAR column throws an exception on the Embedded Driver but not on the NetworkClient
2) updateBlob works on a CHAR/VARCHAR/LONG VARCHAR FOR BIT DATA throws an exception on the Embedded Driver but not on the NetworkClient

From what the JDBC 4.0 spec says (pg 198 table b-5) the Embedded behaviour seems to be correct.

This can be fixed by Matching Embedded behaviour. This would involve throwing an exception in the cases mentioned above



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
V.Narayanan added a comment - 09/Mar/07 07:58 AM
The above patch removes the code that allows types other than Clob and Blob in the setObject method of CrossConverters class. I have also fixed a failure in UpdatableResultSetTest.java . This involved adding the SQLState of the exception that will be thrown when we do a updateClob or a updateBlob on the disallowed types into the updateObjectRulesTableForNetworkClient array.

I am running derbyall with this patch. I shall post the results soon. I have put this up for review.

Narayanan

V.Narayanan added a comment - 09/Mar/07 12:12 PM
I had one failure in derbynet/testSecMec.java when I ran derbyall and it did not seem related to my patch.

I request for this patch to be please considered for a commit.

--------------------------------------------------------------------------------------------------
The diff for derbynet/testSecMec.java said this

< TEST_DS - USRSSBPWD + BUILTIN (T4):EXCEPTION testSecurityMechanism() Connection authentication failure occurred. Reason: userid or password invalid.
< Turning OFF Derby BUILTIN authentication
< USRSSBPWD + BUILTIN (T5): jdbc:derby://xxxFILTERED_HOSTNAMExxx:xxxFILTEREDPORTxxx/wombat;user=neelima;password=lee;shutdown=true;securityMechanism=8 - EXCEPTION DERBY SQL error: SQLCODE: -1, SQLSTATE: 08006, SQLERRMC: Database 'wombat' shutdown.
< -----
< Testing with derby.drda.securityMechanism=INVALID_VALUE
< EXPECTED EXCEPTION DRDA_InvalidValue.U:Invalid value, INVALID_VALUE, for derby.drda.securityMechanism.
< -----
< Testing with derby.drda.securityMechanism=
< EXPECTED EXCEPTION DRDA_InvalidValue.U:Invalid value, , for derby.drda.securityMechanism.
< Completed testSecMec
Test Failed.

V.Narayanan added a comment - 12/Mar/07 02:15 PM
I did a svn update in the checkout in which I had done this modification. After this I did a svn update and the output did not reveal any broken files

M java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java
M java/client/org/apache/derby/client/am/CrossConverters.java
X tools/testing/derby

This issue blocks 2443 for which I have put in a patch for review alone

I request a interested person to consider this patch for review and comment and if everything is ok a commit recommendation or a commit.

thanx,
Narayanan

V.Narayanan added a comment - 12/Mar/07 02:16 PM
pardon my earlier typo. I meant to say I did a "svn status" after doing a "svn update".

Knut Anders Hatlen added a comment - 13/Mar/07 07:50 AM
Thanks Narayanan. The patch looks good. Committed revision 517577.
I set the "Release Note Needed" flag to indicate that this change should be mentioned in the release notes for 10.3. It would be OK to incorporate the release note for this issue into the release note for DERBY-1610.

V.Narayanan added a comment - 13/Mar/07 08:30 AM
Thank you for the commit knut. This patch blocks issue 2443 and this commit will help me in submitting a final patch to that issue.

Thanx a ton for this one,
Narayanan

V.Narayanan added a comment - 15/Jun/07 12:14 PM
Re-opening to attach release note.

V.Narayanan added a comment - 15/Jun/07 12:15 PM
Attaching the release note for this issue

V.Narayanan added a comment - 15/Jun/07 12:28 PM
All patches submitted and committed and release note added

Rick Hillegas added a comment - 16/Jun/07 04:16 PM
Reopen issue so that I can scrub the release note.

Rick Hillegas added a comment - 16/Jun/07 04:17 PM
Attaching scrubbed version the release note. This removes the cruft inserted by an html editor, which the SAX parser can't digest.

Rick Hillegas added a comment - 16/Jun/07 04:25 PM
Correct unbalanced paragraph tag in release note.