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 256890 - When selecting 'View Data' the resulting SQL statement has no limit
Summary: When selecting 'View Data' the resulting SQL statement has no limit
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 8.1
Hardware: All All
: P2 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-01 11:34 UTC by Two
Modified: 2016-05-28 23:03 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Two 2015-12-01 11:34:02 UTC
How to reproduce:
1) Select any database table
2) Right click -> View Data

The generated SQL statement will fetch ALL data from the table despite that only the first 20 entries are displayed.

Issue:

When this is executed on a database table with many entries (worst case: on a live DB), the entire table is transmitted, causing a huge load on the database and network. This is not only unnecessary, but also cannot be interrupted other than by force-closing Netbeans.

Solution:

The generated SQL statement should include 'LIMIT 20' to limit the amount of rows returned to what is displayed.
Comment 1 bambule 2016-05-17 15:05:20 UTC
This is really an annoying issue and simple to fix. Often I have to kill NB because it try to fetch the maximum of results until the timeout break the query.
Comment 2 matthias42 2016-05-28 23:03:19 UTC
The fix is pushed as:

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

In the next few days a nightly build will be available that contains this fix, please test that and report your findings. If you find the bug fixed, please change the status of this bug to VERIFIED.