db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kristian Waagan (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-3907) Save useful length information for Clobs in store
Date Thu, 15 Jan 2009 08:57:59 GMT

     [ https://issues.apache.org/jira/browse/DERBY-3907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Kristian Waagan updated DERBY-3907:

    Derby Info:   (was: [Patch Available])

Committed patch 5a to trunk with revision 734630.

A quick comment on the following piece of code from EmbedResultSet.getCharacterStream:
            CharacterStreamDescriptor csd = dvd.getStreamWithDescriptor();

            if (csd == null) {

				String val = dvd.getString();
				if (lmfs > 0) {
					if (val.length() > lmfs)
						val = val.substring(0, lmfs);
				java.io.Reader ret = new java.io.StringReader(val);
				currentStream = ret;
				return ret;

            // See if we have to enforce a max field size.
            if (lmfs > 0) {
                csd = new CharacterStreamDescriptor.Builder().copyState(csd).
            java.io.Reader ret = new UTF8Reader(csd, this, syncLock);

The last "if (lmfs < 0)" statement will never be run as long as SQLChar.getStreamWithDescriptor()
returns null, because then the value will be materialized (SQLChar.getString()).
We can allow non-Clob values to be treated as streams as well, but I'm not sure it is worth
it due to the limited size (max 32700 chars).

> Save useful length information for Clobs in store
> -------------------------------------------------
>                 Key: DERBY-3907
>                 URL: https://issues.apache.org/jira/browse/DERBY-3907
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC, Store
>    Affects Versions:
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>             Fix For:
>         Attachments: derby-3907-1a-alternative_approach.diff, derby-3907-2b-header_write_preparation.diff,
derby-3907-2b-header_write_preparation.diff, derby-3907-2b-header_write_preparation.stat,
derby-3907-2c-header_write_preparation-PREVIEW.diff, derby-3907-2c-header_write_preparation-PREVIEW.stat,
derby-3907-2c-header_write_preparation.diff, derby-3907-2c-header_write_preparation.diff,
derby-3907-2c-header_write_preparation.stat, derby-3907-3a-readertoutf8stream_cleanup.diff,
derby-3907-3a-readertoutf8stream_cleanup.diff, derby-3907-3a-readertoutf8stream_cleanup.stat,
derby-3907-3b-readertoutf8stream_cleanup.diff, derby-3907-4a-add_getStreamWithDescriptor.diff,
derby-3907-4a-add_getStreamWithDescriptor.stat, derby-3907-5a-use_getStreamWithDescriptor.diff,
> The store should save useful length information for Clobs. This allows the length to
be found without decoding the whole data stream.
> The following thread raised the issue on what information to store, and also contains
some background information: http://www.nabble.com/Storing-length-information-for-CLOB-on-disk-tp19197535p19197535.html
> The information to store, and the exact format of it, is still to be discussed/determined.
> Currently two bytes are set aside for length information, which is inadequate.

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

View raw message