Skip to content

Executing multiple statements with ExecuteNonQuery might result in lost rows #32740

Closed

Description

@vonzshik

File a bug

Having multiple statements in a query (for example, multiple inserts) and executing them via ExecuteNonQuery might result in no error, but inserts being rollbacked. I presume it's because any errors during later statements are catched:

try
{
while (NextResult())
{
}
}
catch
{
}

Reminds me of the exact same bug we had in Npgsql @roji

Include your code

vonzshik/Microsoft.Data.Sqlite-LostInsertBug

Include version information

Microsoft.Data.Sqlite version: 8.0.0
Target framework: .NET 8
Operating system: Windows 10

Activity

  1. changed the title [-]Querying multiple statements with ExecuteNonQuery might result in lost rows[/-] [+]Executing multiple statements with ExecuteNonQuery might result in lost rows[/+] on Jan 7, 2024
  2. self-assigned this
    on Jan 18, 2024
  3. added this to the Backlog milestone on Jan 18, 2024
  4. removed their assignment
    on Aug 31, 2024
  5. added theissue type on Jun 15, 2025
  6. added a commit that references this issue on Sep 14, 2026
    425dfe7
  7. modified the milestones: Backlog, 12.0.0 on Sep 14, 2026
  8. added a commit that references this issue on Sep 25, 2026
    06dd127
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions