Invalid date value generated

The simplest way to populate your database with test data.

Moderators: David Atkinson, Anu Deshpande, Lionel

Invalid date value generated

Postby kcurley » Mon Dec 20, 2010 5:18 pm

I'm recently used the SQL Data Generator (version to generate test data for one of my applications. In the process, I encountered an issue where a date value generated by the Data Generator was an invalid date. The date value generated was Apr 4, 1992, 2:53 AM EST, which according to the daylight savings is invalid (since the clock jumped from 2:00 to 3:00.

The SQL Server DB allowed this invalid date value to be created and the JDBC driver did not throw an exception when the value was retrieved from the DB. Instead, the JDBC driver auto-corrected the date value, incrementing the hour value by one hour to insure it's a valid date. Management Studio showed the time as 2:53 while my app showed the time as 3:53 after the value was retrieved through the JDBC driver.
Posts: 1
Joined: Mon Dec 20, 2010 5:11 pm

Postby james.billings » Tue Dec 21, 2010 6:35 pm

Thanks for your post.

I don't think Data Generator performs validation to account for DST which is why you have encountered this issue.

I've logged it as a bug (ref SDG-923) although the problem is a bit more complex than it would initially appear. I don't think all regions necessarily switch daylight savings at the same point (so the US will perhaps do it a couple of weeks after/before the UK for instance). This means the invalid date you have could well be valid in another country!

So, it may be possible to fix it, but we'd also need to investigate region checking, and would it be the region of your PC, or the SQL Server you're working against (they could be different...)

In any case, I've logged it, as I mentioned above, and we'll let you know if a fix becomes available.
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Return to SQL Data Generator 1

Who is online

Users browsing this forum: No registered users and 0 guests