This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 215973 - clob data values no longer displayed
Summary: clob data values no longer displayed
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords: NETFIX
: 215903 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-25 23:08 UTC by idclaar
Modified: 2012-10-03 03:20 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
proposed patch v1 (3.71 KB, patch)
2012-07-29 17:31 UTC, matthias42
Details | Diff
build of proposed patch v1 against release72_base (575.29 KB, application/octet-stream)
2012-07-29 17:38 UTC, matthias42
Details

Note You need to log in before you can comment on or make changes to this bug.
Description idclaar 2012-07-25 23:08:46 UTC
When executing select queries in NB 7.1.1 on tables with clob data column, the result table showed clob data values (the actual string data.)  Now in NB 7.2RC1 only <CLOB n Chars> is displayed (n=number value of the characters in the clob.)
Comment 1 matthias42 2012-07-26 17:06:07 UTC
You are seeing the result of fixing the large object (C/BLOB) handling. Both were arbitrarily truncated at a 2000 char/byte mark. This was fixed by fetching the whole value into a local file copy and exposing that as a BLOB/CLOB. So it's not a bug, but a feature :-)

What could be done is displaying the first (random number...) 255 Chars from the CLOB in the Cell renderer, but then the information of the cell length/size is lost. Hm ... if I find time I'll give it some more thought.

As a work around depending on your DBMS you can try casting the columns to the char/varchar type.

select cast(<field> as char(255)) from <table> ...

does that on mysql.
Comment 2 idclaar 2012-07-26 18:53:38 UTC
Thank you for responding so quickly Matthias.  I read through the coments on c/blob enhancements before entering this and thought this issue might be connected.  Casting works fine for now when I know basic data characteristics (simple strings of much less than 255 chars : ), but can you link me to an explanation of how to obtain the local file data through a select in the NB Services SQL Command window?

Thanks again!
Comment 3 matthias42 2012-07-27 15:03:27 UTC
*** Bug 215903 has been marked as a duplicate of this bug. ***
Comment 4 athompson 2012-07-27 15:11:31 UTC
It looks like the same bug as issue#215903
Comment 5 matthias42 2012-07-27 15:11:41 UTC
*** Bug 215903 has been marked as a duplicate of this bug. ***
Comment 6 matthias42 2012-07-27 21:15:52 UTC
(In reply to comment #4)
First - thanks to athompson for you efforts!

(In reply to comment #2)
You can't access the data directly without diving into the datastructures, that hold that data. What happens is this:

1. The result set is created by the database
2. The db module checks the content of each column and load the data
3. if at step 2 something like a longvarchar/lvarchar/varchar(max) (you name it) is encountered, the data is transfered into a local file structure, which is exposed as a CLOB (the most generic form of large character objects)
4. the db dataview modules uses a special cell renderer to display the CLOB

At step 3 the bug was fixed, that previous versions of netbeans flooeded the memory and truncated BLOBs + CLOBs to 2000 chars/bytes. Saving the data into a file lifts memory pressure and doesn't destroy the cell content.

I could implement the solution described in comment #1. This means in the cell a "teaser" is displayed, while the other characteristics remain the same (getting a seperate editor, being able to save/import whole files).

Please note I'm not a netbeans developer, but only a user, that decided to have a closer look at the db module, so I can create the mentioned patch, but a netbeans developer has to decide whether it gets merged or not.
Comment 7 idclaar 2012-07-27 21:29:16 UTC
Given that you aren't a NB dev makes you a hero of the NB community!  I know if you were able to implement this "teaser" it would be greatly appreciated, and it would aid quick sanity check testing, but from what I now understand about LOB data, I think I should not have opened this as a bug in the first place, so please proceed only if you have the bandwidth.  Again, we appreciate your efforts :)
Comment 8 matthias42 2012-07-29 17:31:38 UTC
Created attachment 122504 [details]
proposed patch v1

Attached you find version 1 of the patch that implements the change described in comment #1:

1. The cell content is extracted from the CLOB data content (max. character number extracted is 255)
2. The tooltip holds the data description "<CLOB [characters]>"
Comment 9 matthias42 2012-07-29 17:38:34 UTC
Created attachment 122505 [details]
build of proposed patch v1 against release72_base

Attached you find a build of the dataview module, which is a drop in replacement for the netbeans 7.2 installation.

The file replaces ide/modules/org-netbeans-modules-db-dataview.jar in the installation.

The usual applies: This is a test build, treat it with caution, do backups (especially the original version of the file)!
Comment 10 Jaroslav Havlin 2012-08-07 15:02:20 UTC
Patch applied as http://hg.netbeans.org/core-main/rev/87101179921c

Thank you again, Matthias!
Comment 11 Quality Engineering 2012-08-08 02:34:29 UTC
Integrated into 'main-golden', will be available in build *201208080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/87101179921c
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #215973: clob data values no longer displayed
Comment 12 athompson 2012-08-10 15:01:00 UTC
Outstanding, Matthias!  Now that you've volunteered to fix a bug, you wouldn't mind doing a few more, right?  :)  Here are a few DB bugs that IMNSHO would really improve the experience in Netbeans:

Issue #57979: Support for automatically generated values when adding rows
Issue #202833: show only the specified database/schema by default in the Databases node
Issue #117948: ability to name SQL editor tabs
Issue #200368: CC doesn't work when specifying an alternate DB
Issue #192020: add ability to cycle through SQL history

So, when can I expect these to be done?
Comment 13 neek 2012-10-03 02:50:14 UTC
Just wanted to confirm for anyone else wandering onto this subject right now, the 7.3beta has this issue partly fixed.  SQL results appear with text value expanded.

However, selecting "Copy row values" or "Show SQL script for INSERT" contains the FileBackedCLOB strings as before :(  Bit of a bugger, as that's the feature I'm trying to use.

Is a new patch required for these issues?  Please consider re-opening this bug, or should a new one be raised at this point?
Comment 14 neek 2012-10-03 03:20:00 UTC
Hmm, I think these issues are actually taken care of already, updated yesterday with a patch aimed at 7.3:

https://netbeans.org/bugzilla/show_bug.cgi?id=219117

Sorry :)