Bug Report #4047
Returning if query was successful in UPDATE
|Target version:||Kohana v3.x - v3.2.0|
Currently the we get the number of affected rows on UPDATE queries.
It would be good if we would also get if the query itself was successful.
I want to update a row with the same data as in the database.
Although the query runs ok, the affected rows will remain 0 because nothing was updated.
We need a differentiation between affected rows and query successful.
#1 Updated by Vit Brunner about 3 years ago
- Kohana_Database_MySQL::query() throws Database_Exception when mysql_query returns false
- Kohana_Database_PDO::query() rethrows PDOException from PDO::query()
In my opinion, it would be better to rethrow as Database_Exception in the second case (for consistency).
If that is done, Kohana_Database::query() should have this in PHPDoc:
#2 Updated by Jeremy Bush about 3 years ago
- Status changed from New to Closed
- Target version set to v3.2.0
- Resolution set to invalid
Yeah, I'm not sure what you mean. An "unsuccessful" query (one that never hit the database) would result in a database exception.
In your scenario, the query was successful.