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.
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.)
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.
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!
*** Bug 215903 has been marked as a duplicate of this bug. ***
It looks like the same bug as issue#215903
(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.
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 :)
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]>"
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)!
Patch applied as http://hg.netbeans.org/core-main/rev/87101179921c Thank you again, Matthias!
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
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?
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?
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 :)