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 73168 - regression?? values are all empty in table with MySQL ODBC
Summary: regression?? values are all empty in table with MySQL ODBC
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 5.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2006-03-02 05:21 UTC by Masaki Katakai
Modified: 2006-05-15 13:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot - working on 4.1 (22.42 KB, image/png)
2006-03-02 05:22 UTC, Masaki Katakai
Details
screenshot - but the same operation failed on 5.0 (16.97 KB, image/png)
2006-03-02 05:24 UTC, Masaki Katakai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2006-03-02 05:21:13 UTC
NetBeans 5.0: English version
Windows: 2000 JA
MySQL ODBC: 3.51
JDK: 1.5.0_05

I'm now trying to use JDBC-ODBC for MySQL on my Windows 2k Japanese.
I downloaded MySQL ODBC 3.51 driver, installed it to my Win2K box.
I created a new connection for the MySQL ODBC. Connection is OK but
when I tried "View Data" from table, it returns all empty. See
attachment.

When I tried the same operation on 4.1 ml release, it displayed fine.
So is this regression?? (See attachment)

When I tried simply with "JDBC", it returns correct values in table.
Comment 1 Masaki Katakai 2006-03-02 05:22:46 UTC
Created attachment 29078 [details]
screenshot - working on 4.1
Comment 2 Masaki Katakai 2006-03-02 05:24:06 UTC
Created attachment 29079 [details]
screenshot - but the same operation failed on 5.0
Comment 3 Andrei Badea 2006-03-02 12:59:12 UTC
Yes, it looks like a regression. What is the data type and effective collation
and character set of that column? What is the MySQL server version? Are other
data types displayed correctly?

Also, what do you mean by "I tried with 'JDBC'"? Do you mean the Connector/J
driver, or maybe a JDBC program that you wrote yourself to display the data in
that table?
Comment 4 Masaki Katakai 2006-03-02 13:04:10 UTC
"JDBC" means that I tried another database connection with JDBC driver on
Runtime tab. I did the same operation on Runtime tab, it works fine.

I'll check MySQL version.
Comment 5 Masaki Katakai 2006-03-06 02:28:44 UTC
MySQL version is 4.0.22, running on Red Hat Enterprise Linux AS release 3.
The table is LONGVARCHAR.

I'm sorry I don't have another DB what I can try.
Comment 6 Andrei Badea 2006-05-15 12:17:06 UTC
I can reproduce it. Caused by the SQL editor calling ResultSet.getObject() and
then the typed getter based on the column data type, which in this case is
ResultSet.getCharacterStream(). It does so in order to detect the NULL values
(when getObject() returns null). But the getCharacterStream() method returns an
empty stream if getObject() is called before it.

It looks incorrect for the SQL editor to read the data twice for each column, so
I will try to fix it to use ResultSet.wasNull() after having called the typed
getter and not call getObject() at all. This unfortunately introduces a new bug,
at least on reporter's configuration (JDBC-ODBC bridge and Connector/ODBC with
MySQl 4.0): the NULL values are not detected properly, because
ResultSet.wasNull() seems to return false for them. But this is a bug in the
JDBC driver and I don't intend to work around it.
Comment 7 Andrei Badea 2006-05-15 13:35:05 UTC
Fixed.

Checking in src/org/netbeans/modules/db/sql/execute/ResultSetTableModelSupport.java;
/cvs/db/core/src/org/netbeans/modules/db/sql/execute/ResultSetTableModelSupport.java,v
 <--  ResultSetTableModelSupport.java
new revision: 1.2.2.3.2.2; previous revision: 1.2.2.3.2.1
done