rdbms: make affectedRows() work more consistently