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 149041 - Wrong size for some fields in created table
Summary: Wrong size for some fields in created table
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on: 155440
Blocks:
  Show dependency tree
 
Reported: 2008-10-03 10:50 UTC by Roman Mostyka
Modified: 2009-05-12 17:13 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot of the Create Table dialog (8.76 KB, image/png)
2008-12-08 21:59 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-10-03 10:50:40 UTC
1. Connect to "travel" Java DB.
2. Rightclick "Tables" and choose "Create Table...".
3. Set table name, column name, choose INTEGER type, set size to 3 and press "OK".

Result: Table with column is created, but size of column is 10, not 3 as it was set. I guess it can be true not only for
INTEGER type.
Comment 1 Roman Mostyka 2008-10-03 11:04:05 UTC
I tried also with CHAR type. By default size is set to 0, but after table creation I see that column size is 1. I didn't
change anything.
Comment 2 David Vancouvering 2008-11-13 19:34:24 UTC
The problem here is that you *should not* be able to enter a size for types that are of fixed size like CHAR and
INTEGER.  I would be much more concerned if you could actually create a CHAR of size 0 or an INTEGER of size 3.  Yikes!

The size field should only be enabled for variable length types.

We really should fix this for this release, it's a constant source of confusion and annoyance.
Comment 3 John Baker 2008-12-08 21:58:44 UTC
Hi Mike this Create Table dialog needs some work.
Can you please create a wireframe for this

This dialog is opened from a connection, 
expand the connection, 
select Tables then right-click and choose Create Table

I'll attach screenshots of the dialog and also from Eclipse to see how they their dialog looks
Comment 4 John Baker 2008-12-08 21:59:32 UTC
Created attachment 74718 [details]
screenshot of the Create Table dialog
Comment 5 John Baker 2008-12-08 22:05:54 UTC
Sorry Mike

I'll create a new issue.  I thought this was about the size of the UI
Comment 6 John Baker 2008-12-13 03:56:51 UTC
42c2e1024e37

seems to be fixed.

Needs thorough testing with different databases
Comment 7 Roman Mostyka 2008-12-13 18:42:23 UTC
Verified with build 081213.
Comment 8 Quality Engineering 2008-12-14 05:27:27 UTC
Integrated into 'main-golden', will be available in build *200812140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/42c2e1024e37
User: John Baker <jbaker@netbeans.org>
Log: #149041 fix
Comment 9 John Baker 2008-12-14 22:30:47 UTC
Sorry, not fixed.  Need MetaData API for fixed types

b6ea5aebc071 - make ready for API
Comment 10 John Baker 2008-12-15 00:57:36 UTC
This seems like more trouble than it's worth.

Most fields set their own size.

At least for Derby, only VARCHAR, CHAR FOR BIT and BLOB, a user can set the column size.

Consider reducing the priority ?
Comment 11 Quality Engineering 2008-12-15 16:58:00 UTC
Integrated into 'main-golden', will be available in build *200812151401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/b6ea5aebc071
User: John Baker <jbaker@netbeans.org>
Log: #149041 improve code but not fixed until TODO resolved
Comment 12 Jiri Rechtacek 2009-02-10 15:35:29 UTC
Reassigned to new owner.
Comment 13 Jiri Rechtacek 2009-05-12 17:13:23 UTC
Fixed already.