| Summary: | Result not displayed when MySQL date type has '0000-00-00' in any record | ||
|---|---|---|---|
| Product: | [Tools] Data Tools | Reporter: | Drew Bertola <dbertola> |
| Component: | SQL Results View | Assignee: | dtp.sqldevtools-inbox <dtp.sqldevtools-inbox> |
| Status: | RESOLVED NOT_ECLIPSE | QA Contact: | |
| Severity: | critical | ||
| Priority: | P3 | ||
| Version: | 1.8 | ||
| Target Milestone: | 1.8.2 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Drew Bertola
So based on your description, it seems you're having issues with executing queries using the SQL Results View? (In reply to comment #1) > So based on your description, it seems you're having issues with executing > queries using the SQL Results View? Yes. One other interesting fact to mention If there is a date type and a record with '0000-00-00', I can use: select concat(date_field) from table; This will display the result. create table scratch.drew_test_dates (
id int unsigned not null primary key auto_increment,
test_date_str char(10),
test_date date not null default '0000-00-00'
);
insert into scratch.drew_test_dates
(test_date_str, test_date)
values
('2010-01-01', '2010-01-01'),
('0000-00-00', '0000-00-00'),
('2010-10-22', '2010-10-22')
;
select * from scratch.drew_test_dates;
select id, test_date_str, test_date from scratch.drew_test_dates;
select id, test_date_str, concat(test_date) from scratch.drew_test_dates;
In PDT:
select * shows no rows returned in results window
select w/ explicit cols show no results...
select w/ explicit cols and date col wrapped in concat() shows expected results.
Connector/J is from 5.1.0 jar.
Eclipse Helios rel: 20100617-1415,
PDTVersion: 1.8.0.v201005280400-7B7C77CcNBGKBaIdEbPQ
Build id: 1.7.2.v20100528-1022
I bumped this back up to critical. It's actually much more harmful to return erroneous data (no result, in this case) than it is to crash. Case in point: select * from patient_reported_drug_allergies; (no result) Point made? So, I found out that this is a connector/J issue. When setting up optional properties for the connection, I can use: zeroDateTimeBehavior=convertToNull (or =round or =exception). |