Skip to content

Affected rows count is inconsistent with other database drivers #600

@Grauenwolf

Description

@Grauenwolf

I'm working on an ORM. And one of the things it does is check the affected rows count after performing an update using ExecuteAsNonQuery(). If the count isn't 1, it throws an error saying the row couldn't be found.

Currently I've tested this design with

  • SQL Sever (SqlClient and OleDB)
  • PostgreSQL (Npgsql)
  • SQLite (System.Data.SQLite and SQLitePCLRaw)
  • Access (OleDB)
  • MySQL (MySqlConnector and Oracle's driver)

So far MySqlConnector is the only one that doesn't return 1 when the record was found, but no changes were made.


If I add "UseAffectedRows=false" to the connection string, it will work. But this means modifying the connection string I'm given, which would be weird from the user's perspective.

I don't know what the right answer if for MySqlConnector, but I felt that I should bring the inconsistency to your attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions