Red Gate forums :: View topic - Invalid date value generated
Return to RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Generator 1
SQL Data Generator 1 forum

Invalid date value generated

Search in SQL Data Generator 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message

Joined: 20 Dec 2010
Posts: 1

PostPosted: Mon Dec 20, 2010 5:18 pm    Post subject: Invalid date value generated Reply with quote

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.
Back to top
View user's profile Send private message

Joined: 16 Jun 2010
Posts: 1144
Location: My desk.

PostPosted: Tue Dec 21, 2010 6:35 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group