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

Handle composite keys in SqliteDataReader.GetStream() #23590

Merged
merged 1 commit into from
Jan 5, 2021

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Dec 4, 2020

Fixes #23554

@bricelam bricelam requested a review from a team December 4, 2020 22:21
{
using (var command = _connection.CreateCommand())
{
command.CommandText = "SELECT COUNT(*) FROM pragma_table_info($table) WHERE pk != 0;";
Copy link
Contributor Author

@bricelam bricelam Jan 5, 2021

Choose a reason for hiding this comment

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

We could avoid sending this if primaryKey != 1. But the chances of selecting only part of a composite key or not selecting the first component before the rest (which just happen to be an INTEGER) is so low that it'll probably never matter.

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

Successfully merging this pull request may close these issues.

SqliteDataReader.GetStream is not working correctly in presence of composite primary keys
2 participants