db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3741) SQL LENGTH function materializes CLOB into memory
Date Mon, 21 Jul 2008 16:51:31 GMT

    [ https://issues.apache.org/jira/browse/DERBY-3741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615304#action_12615304
] 

Kathey Marsden commented on DERBY-3741:
---------------------------------------

Suran asked me off-line for some pointers on this issue, but I am posting my response to the
issue to keep the discussion on the list and allow room for anyone to correct me if what I
say is wrong.

Probably the first best approach is to write the test. Write a test ClobMemTest which is similar
to BlobMemTest and add it to the memory suite.  Make sure you have some multibyte characters
so we are sure we are getting the character length and not the byte length when we fix this.
 The test should pass normally but fail when run with the target junit-lowmem.

As for the code change, I think we are looking to change SQLChar.getLength(). I believe the
character length is encoded in the stream in some cases so we want to retrieve that if possible
and if not read (skip)  the entire stream to get the character length. Either way we will
need to reset the stream in the end to make sure we are positioned back at the beginning of
the stream.  The changes should be the same as those made to SQLBinary.getLength() for BLOBS
(DERBY-3732)  but not exactly the same because we are dealing with characters.

Hope this helps. Please let us know as you have more questions.







> SQL LENGTH function materializes CLOB into memory
> -------------------------------------------------
>
>                 Key: DERBY-3741
>                 URL: https://issues.apache.org/jira/browse/DERBY-3741
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.3.0, 10.4.1.3, 10.5.0.0
>            Reporter: Kathey Marsden
>            Assignee: Suran Jayathilaka
>         Attachments: LargeLengthClob.zip
>
>
> Similar to DERBY-3732, the SQL LENGTH function also materializes CLOB's into memory.
 See attached repro.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message