Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DateTimeKind connection setting. #479

Merged
merged 3 commits into from
Apr 14, 2018

Conversation

ejball
Copy link
Contributor

@ejball ejball commented Apr 13, 2018

No changes to DateTimeOffset at this point.

@ejball ejball requested a review from bgrainger April 13, 2018 22:08
@ejball
Copy link
Contributor Author

ejball commented Apr 13, 2018

Should define our own MySqlDateTimeKind

Oops, I missed this comment in the issue. I can change it, unless you don't feel strongly about it, @bgrainger.

@@ -26,6 +26,7 @@ public void Defaults()
#endif
Assert.Equal(15u, csb.ConnectionTimeout);
Assert.False(csb.ConvertZeroDateTime);
Assert.Equal(DateTimeKind.Unspecified, csb.DateTimeKind);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be in a #if !BASELINE block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, forgot to run the BASELINE tests, thanks.

public void QueryDateTimeKind(DateTimeKind kindOption, DateTimeKind kindIn, bool success)
{
var csb = AppConfig.CreateConnectionStringBuilder();
csb.DateTimeKind = kindOption;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line won't compile with Connector/NET so this whole test needs to be #if !BASELINE.

@bgrainger
Copy link
Member

Now that you're handling all of Unspecified, Local, and Utc, it doesn't seem as important to add a custom enum.

@ejball
Copy link
Contributor Author

ejball commented Apr 14, 2018

Okay, I'll leave it as DateTimeKind then, thanks.

@ejball
Copy link
Contributor Author

ejball commented Apr 14, 2018

AppVeyor failed but I don't think due to my code.

@@ -549,6 +549,55 @@ public void QueryZeroDateTime(bool convertZeroDateTime)
}
}

[Theory]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MySqlDateTimeKind doesn't exist in Connector/NET so this entire test should be #ifd out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the BASELINE behaviour will be tested by DateTimeKind.Unspecified above?

@ejball
Copy link
Contributor Author

ejball commented Apr 14, 2018

If the tests pass, I'll rebase and force push.

@ejball
Copy link
Contributor Author

ejball commented Apr 14, 2018

Rebased.

@bgrainger bgrainger merged commit 9c450ed into mysql-net:master Apr 14, 2018
@bgrainger
Copy link
Member

Shipped in 0.40.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants