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 154855 - Wrong view for BIT type
Summary: Wrong view for BIT type
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ ahimanikya
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-07 01:27 UTC by Roman Mostyka
Modified: 2009-02-19 20:38 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 Roman Mostyka 2008-12-07 01:27:12 UTC
1. Connect to MySQL DB and expand it's node.
2. Rightclick "Tables" node and choose "Create Table".
3. Add table with 1 columns with BIT type and then add some values with "Insert Record" dialog.
4. Rightclick added table and choose "View Data".

Result: Data is shown as checkboxes, but BIT values are returned as binary values.
(http://dev.mysql.com/doc/refman/5.0/en/bit-field-values.html). User isn't able to set "1010" for field with BIT type.
Comment 1 _ ahimanikya 2008-12-07 10:31:35 UTC
MySQL Driver returns BIT for BIT(1) and VARBINARY for BIT(n) where n > 1

So, here here what we will do. We will continue to show the checkbox for BIT(1), since by MySQL manual BIT(1) is
equivalent to Boolean, but for column BIT(n) where n > 1, we will display 0's and 1's
Comment 2 Roman Mostyka 2008-12-07 16:36:32 UTC
Is there way to show all data for BIT value the same? I think we can mislead customer if we have different view for the
same type. We should have consistent view for all types.
Comment 3 _ ahimanikya 2008-12-07 17:25:15 UTC
MySQL driver does return BIT(1) as BIT or Boolean and we have to use getBoolean() and setBoolean() to read/write BIT(1)
data, where as BIT(n), where n > 1 is returned as binary data, It actually returns BitString which require special
handling for read/write. 

I am going to check the fix, if you still feel BIT(1) should also be treated same as BIT(n) where n > 1; then I will try
to do something. 

See this: http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-type-conversions.html
Comment 4 _ ahimanikya 2008-12-07 17:32:43 UTC
http://hg.netbeans.org/main/rev/e5101e34f6bc
Comment 5 _ ahimanikya 2008-12-07 18:16:19 UTC
Fixed.
Comment 6 Roman Mostyka 2008-12-08 12:04:54 UTC
Verified with build 081207.
Comment 7 Quality Engineering 2008-12-09 18:31:34 UTC
Integrated into 'main-golden', will be available in build *200812091520* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e5101e34f6bc
User: ahimanikya@netbeans.org
Log: Issue #154855 Default value isn't inserted