You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2008/12/08 14:12:44 UTC
[jira] Created: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
-----------------------------------------------------------------------------------------------------------------
Key: DERBY-3977
URL: https://issues.apache.org/jira/browse/DERBY-3977
Project: Derby
Issue Type: Bug
Components: JDBC
Affects Versions: 10.4.2.0, 10.3.3.0
Reporter: Kristian Waagan
Priority: Minor
Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
I believe the fix is simple enough - change one of the exceptions.
Which one most closely describes the situation?
A release note is needed for this fix.
Also note the following from the Java API docs:
"void truncate(long len)
throws SQLException
Truncates the CLOB value that this Clob designates to have a length of len characters.
Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
"
This opens for a change of behavior as well.
There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654827#action_12654827 ]
Knut Anders Hatlen commented on DERBY-3977:
-------------------------------------------
PostgreSQL's JDBC driver doesn't appear to throw an exception for len>=length+1. In code called from Clob.truncate(), I found this comment:
/**
* Truncates the large object to the given length in bytes.
* If the number of bytes is larger than the current large
* object length, the large object will be filled with zero
* bytes. This method does not modify the current file offset.
*/
The comment talks about bytes, but the code is also used for character data, so I guess truncate(length+1) appends "\u0000".
MySQL Connector/J throws an exception, if I read the code correctly.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656021#action_12656021 ]
Knut Anders Hatlen commented on DERBY-3977:
-------------------------------------------
The release note looks good to me. Some minor comments:
Perhaps the example error messages should have a real number instead of {0} in them? And maybe that section is clearer if we say "Before: XJ076: ...." and "Now: XJ079: ....".
In the "Application Changes Required" section, we should repeat that it's only when calling Clob.truncate() one should look for XJ079 instead of XJ076, since we still use XJ076 other places. For example: "Look for SQLState XJ079 instead of XJ076 when Clob.truncate() is called."
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan reassigned DERBY-3977:
--------------------------------------
Assignee: Kristian Waagan
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Derby Info: [Patch Available, Release Note Needed] (was: [Release Note Needed])
Affects Version/s: 10.5.0.0
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Derby Info: [Patch Available, Release Note Needed] (was: [Release Note Needed, Patch Available])
Fix Version/s: 10.5.0.0
Committed patch 1a to trunk with revision 726695.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: derby-3977-1a-change_emb_exception.diff, derby-3977-2a-error_message_typo_fix.diff, derby-3977-2a-error_message_typo_fix.stat, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654845#action_12654845 ]
Kathey Marsden commented on DERBY-3977:
---------------------------------------
JCC 3.57 with DB2 throws an SQLException, SQLState 42815. Invalid length x
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Attachment: releaseNote.html
Attached a first revision of the release notes. Please give me feedback on it.
I also discovered a typo in the error message for one of the exceptions.
Fixing that doesn't warrant another release note, does it?
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Attachment: derby-3977-1a-change_emb_exception.diff
Patch 1a changes the exception thrown in the embedded driver from XJ076 to XJ079. It now matches the client driver.
I ran derbyall and suites.All, and got no failures due to the change of exception (except for the two new tests, which I have modified in the patch).
Patch ready for review.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656970#action_12656970 ]
Knut Anders Hatlen commented on DERBY-3977:
-------------------------------------------
Thanks for the updated release note. It looks good to me.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: derby-3977-1a-change_emb_exception.diff, derby-3977-2a-error_message_typo_fix.diff, derby-3977-2a-error_message_typo_fix.stat, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Attachment: releaseNote.html
Thank you for the feedback, Knut Anders.
Attaching new revision of the release notes where the suggested changes have been addressed.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan resolved DERBY-3977.
------------------------------------
Resolution: Fixed
Derby Info: [Release Note Needed] (was: [Release Note Needed, Patch Available])
Issue has been fixed.
Thanks for the feedback on the release notes, Knut Anders.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: derby-3977-1a-change_emb_exception.diff, derby-3977-2a-error_message_typo_fix.diff, derby-3977-2a-error_message_typo_fix.stat, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654789#action_12654789 ]
Knut Anders Hatlen commented on DERBY-3977:
-------------------------------------------
Since it's a length and not a position, I guess the exception thrown by the client is more accurate.
If we throw exceptions for length+2 and up, I think it's reasonable to throw an exception for length+1 as well, even though the wording in the spec is a bit unclear. Do we have any other alternatives?
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Priority: Minor
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan updated DERBY-3977:
-----------------------------------
Attachment: derby-3977-2a-error_message_typo_fix.stat
derby-3977-2a-error_message_typo_fix.diff
Patch 2a fixes the typo in the error message. The XML file and 4 translation files are touched.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Attachments: derby-3977-1a-change_emb_exception.diff, derby-3977-2a-error_message_typo_fix.diff, derby-3977-2a-error_message_typo_fix.stat, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (DERBY-3977) Clob.truncate with a value greater
than the Clob length raises different exceptions in embedded and client
driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12654808#action_12654808 ]
Kristian Waagan commented on DERBY-3977:
----------------------------------------
We don't have any good alternatives in my opinion, but I'm curious about what the databases that do support truncating to length+1 do!
I'll make a patch for the issue.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0
> Reporter: Kristian Waagan
> Priority: Minor
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (DERBY-3977) Clob.truncate with a value greater than
the Clob length raises different exceptions in embedded and client driver
Posted by "Kristian Waagan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DERBY-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kristian Waagan closed DERBY-3977.
----------------------------------
Release note attached and the issue has been fixed. Closing.
> Clob.truncate with a value greater than the Clob length raises different exceptions in embedded and client driver
> -----------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-3977
> URL: https://issues.apache.org/jira/browse/DERBY-3977
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.3.3.0, 10.4.2.0, 10.5.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.5.0.0
>
> Attachments: derby-3977-1a-change_emb_exception.diff, derby-3977-2a-error_message_typo_fix.diff, derby-3977-2a-error_message_typo_fix.stat, releaseNote.html, releaseNote.html
>
>
> Calling Clob.truncate with a value that is greater then the Clob length raises different SQLExceptions in the client and the embedded driver.
> o Client: SQLState.BLOB_LENGTH_TOO_LONG - XJ079
> o Embedded: SQLState.BLOB_POSITION_TOO_LARGE - XJ076
> I believe the fix is simple enough - change one of the exceptions.
> Which one most closely describes the situation?
> A release note is needed for this fix.
> Also note the following from the Java API docs:
> "void truncate(long len)
> throws SQLException
> Truncates the CLOB value that this Clob designates to have a length of len characters.
> Note: If the value specified for pos is greater then the length+1 of the CLOB value then the behavior is undefined. Some JDBC drivers may throw a SQLException while other drivers may support this operation.
> "
> This opens for a change of behavior as well.
> There seems to an inconsistency in the docs, possibly due to rephrasing - it references both len and pos. The latter isn't used anywhere else in the JavaDoc for truncate.
> And what should the result of truncate(length+1) be?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.