Bug 269577 - sqleditor corrupts data
sqleditor corrupts data
Status: RESOLVED FIXED
Product: db
Classification: Unclassified
Component: SQL Editor
8.2
PC Windows 7
: P1 (vote)
: Dev
Assigned To: matthias42
issues@db
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-17 07:28 UTC by Aleksej
Modified: 2017-03-23 02:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments
an example of an error (1.94 MB, video/x-ms-wmv)
2017-01-17 07:28 UTC, Aleksej
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksej 2017-01-17 07:28:51 UTC
Created attachment 163408 [details]
an example of an error

If you enable sorting, editing of a single line corrupts the data in other rows. Read more watch the video.
Comment 1 matthias42 2017-01-17 18:34:25 UTC
At this point I only have time for the analysis: 

The problem is located in StringTableCellEditor. On each keystroke the current value is committed to the table (lines 110-112):

                if (tc != null && ks.isOnKeyRelease()) {
                    table.getModel().setValueAt(tc.getText(), table.convertRowIndexToModel(row), table.convertColumnIndexToModel(column));
                }

This looks wrong from different perspectives - the intersting question: What was the reason for this implementation?

To give some more perspective of the consequences of this bug (yes this stays P1):

- You have to sort the table base on the column you are editing
- Editing has to change the order of the table
- All changes are reflected to the user in the GUI (so the issue can be worked around)
- Only data in the modified column is affected
Comment 2 Aleksej 2017-01-18 04:57:43 UTC
This problem appeared in version Netbeans 8.0. In earlier versions this was not. I understand the cause of the error. It is easy to fix. I'd like to see this bug fixed in the new version of Netbeans, and other users have not encountered this problem. How soon this issue will fix?
Comment 3 matthias42 2017-01-18 21:26:44 UTC
Thank you for reporting this. A fix was pushed as:

http://hg.netbeans.org/core-main/rev/dd9ce04ed357

In the next few days a nightly build will become available that contains the fix. By then a message will be appended to this bug.

Please grab that nightly or a later one and check if you agree that it is fixed. If you find it fixed, change the status to VERIFIED.
Comment 4 Quality Engineering 2017-03-23 02:47:42 UTC
Integrated into 'main-silver', will be available in build *201703230002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/dd9ce04ed357
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #269577: Don't modify table model directly and use normal TableCellEditor config

processKeyBinding modified the TableModel directly instead of relying on the
Swing TableCellEditor mechanism.

Tested:
- Normal editing in input line
- Copy/Pasting into/from input line
- editing input line and opening textarea dialog initalizes the textarea with input line


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo