• Vadim Zeitlin's avatar
    Return -1 from get_affected_rows() in ODBC backend if unknown · e7e7fb78
    Vadim Zeitlin authored
    It is not always possible to get the number of affected rows after a
    partially executed statement, some drivers provide this information, but
    some others, notable MS SQL native client one, do not.
    
    Return -1 from get_affected_rows() to at least allow distinguishing this
    situation from the one in which we can really know that no rows were
    affected, in which case 0 would be returned.
    
    Notice that this indirectly fixes the "Get affected rows" unit test
    which was broken by the previous fix of #495 as it made the partial
    insert actually work, while it was completely broken before because
    "1\0" string couldn't be converted to a number and so the check for
    get_affected_rows() wasn't being executed at all. But now that the
    string is the correct "1", the check started being executed and failing.
    e7e7fb78