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

SQLite: Store char as TEXT by default #15044

Merged
merged 1 commit into from
Mar 18, 2019
Merged

SQLite: Store char as TEXT by default #15044

merged 1 commit into from
Mar 18, 2019

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Mar 15, 2019

This also fixes some bugs in the relational char type mapping:

Resolves #15020

Providers, the behavior of CharTypeMapping has changed in a way that may break derived types.

This also fixes some bugs in the relational char type mapping:
- LINQ constants converted to int produced the wrong literal
- Apostrophe char values weren't escaped (fixes #8764)

Resolves #15020

Providers, the behavior of CharTypeMapping has changed in a way that may break derived types.
protected override string GenerateNonNullSqlLiteral(object value)
{
// NB: We can get Int32 values here too due to compiler-introduced convert nodes
var charValue = Convert.ToChar(Check.NotNull(value, nameof(value)));
Copy link
Member

Choose a reason for hiding this comment

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

At least from Query funcletizer side it should preserve char constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feel free to remove it as part of the query changes. (Or not since there's no harm in leaving it.) I effectively just moved code that was already in the SQLite provider.

@bricelam bricelam merged commit a801679 into dotnet:master Mar 18, 2019
@bricelam bricelam deleted the char branch March 18, 2019 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft.Data.Sqlite: Store char as TEXT
2 participants