Value returned from RowsAffected
Value returned from RowsAffected
When I make an updating in a table where doesn't affect any line, using MyQuery, the RowsAffected returned is 1.
Example:
insert into products ( product_id, product_price) values (1, 0)
the value of Product_price in update is same the value in the insert
update products set product_price = 0 where Product_id = 1
RowsAffected returned is 1
Example:
insert into products ( product_id, product_price) values (1, 0)
the value of Product_price in update is same the value in the insert
update products set product_price = 0 where Product_id = 1
RowsAffected returned is 1
Re: Value returned from RowsAffected
RowsAffected returns a number of records responding WHERE clause. RowsAffected doesn't consider that actually update can be not performed as new data coincide with old data.
We found in function mysql_rel_connect() in MySQL API Documentation the parameter client_flag that is a combination of flags, for example, CLIENT_COMPRESS and CLIENT_FOUND_ROWS.
CLIENT_FOUND_ROWS when set, return the number of found(matched) rows, not the number of affected rows.
CLIENT_FOUND_ROWS is usually 0, but it is set in MyDAC.
In TMyConnectionOptions exist a property Compress that probably change flag CLIENT_COMPRESS
Would it be possible you add a property in TMyConnectionOptions that change flag CLIENT_FOUND_ROWS ?????
Thanks
CLIENT_FOUND_ROWS when set, return the number of found(matched) rows, not the number of affected rows.
CLIENT_FOUND_ROWS is usually 0, but it is set in MyDAC.
In TMyConnectionOptions exist a property Compress that probably change flag CLIENT_COMPRESS
Would it be possible you add a property in TMyConnectionOptions that change flag CLIENT_FOUND_ROWS ?????
Thanks
Have cases that I want to know the number of found(matched) rows responding WHERE clause, regardless what it was actually updated.
In these cases the flag CLIENT_FOUND_ROWS must be set. This is standard behavior for MyDac.
Have cases that I want to Know the number of affected rows to make a log of data actually changed.
In these cases the flag CLIENT_FOUND_ROWS must be not set. This is standard behavior for MySQL Server.
I believe that these cases are more important than cases above
In these cases the flag CLIENT_FOUND_ROWS must be set. This is standard behavior for MyDac.
Have cases that I want to Know the number of affected rows to make a log of data actually changed.
In these cases the flag CLIENT_FOUND_ROWS must be not set. This is standard behavior for MySQL Server.
I believe that these cases are more important than cases above