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 256518 - Second paste adds unnecessary rows in the "Insert rows" dialog
Summary: Second paste adds unnecessary rows in the "Insert rows" dialog
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-11 15:30 UTC by a.kasparas
Modified: 2016-09-01 11:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description a.kasparas 2015-11-11 15:30:53 UTC
On second (and following) paste operations empty rows are added when they are not necessary.

How to reproduce:
1) Create table:
CREATE TABLE IF NOT EXISTS `bug_demo` (
  `c1` int(11) DEFAULT NULL,
  `c2` int(11) DEFAULT NULL,
  `c3` int(11) DEFAULT NULL,
  `c4` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

2) Navigate to newly created table and choose "View Data...". Empty table is shown.

3) Open spreadsheet application of your choice (I used libreoffice), create spreadsheet with following data:
   A   B
1  11  12
2  21  22

4) Select A1:B2 and copy to clipboard

5) In netbeans press "Insert Record(s)", put cursor in column C1 of the first row. 

6) Paste. Notice that window now contains two rows.

7) Put cursor into column C3 of the first row. Paste again.

Notice that window already contains three rows (BUG). Expected result -- only two rows.

8) Put cursor into column C2 of the first row and paste yet another time.

Notice that windows already contains four rows (BUG). Expected result -- only two rows.

If more than two rows are pasted, even more unnecessary rows are added.  If one has to fill wide table and paste just a handful of columns here and there, he will need to remove empty lines at bottom before submitting to server.
Comment 1 matthias42 2015-11-11 21:32:23 UTC
Thank you for finding this. Indeed the logic to dissect the pasted value was of.

A fix is committed as:

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

In the next few days a nightly build will be created and a message will be posted here then. Please test that build and check if you agree, that the issue is fixed. If so, please change the status of this bug to VERIFIED. If not please also add a comment here with the remaining issue.
Comment 2 Quality Engineering 2015-11-14 03:01:41 UTC
Integrated into 'main-silver', will be available in build *201511140002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/a087e247935f
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #256518: Fix paste behaviour in InsertRecordDialog
Comment 3 a.kasparas 2015-11-19 08:28:04 UTC
I have just checked with 201511190002 nightly. Bug is fixed.

Thanks a lot for the fix! I was very impressed when fix for this bug was made in few hours time!
Comment 4 matthias42 2015-11-20 17:59:15 UTC
Thank you for checking - marking bug as VERIFIED then.