Re: [gnome-db] IMPACTED_ROWS

Vivien Malerba <[email protected]>
Newsgroups gmane.comp.gnome.db
Message-ID <[email protected]>
On 23 March 2011 18:56, Piotr Pokora <[email protected]> wrote:
> Hi!
>
>>>
>>> I propose to add MATCHED_ROW if possible.
>>
>> So the definition of this "returned value" would be: if present, gives
>> the number of rows which would have have been modified but were not
>> because the statement did not modify any value?
>>
>> I can add this for MySQL but I don't think any other database return this
>> value.
>
> Yeah... I think it's so MySQL specific.
>
> But in case of MySQL provider, 0 returned from
> gda_connection_statement_execute_non_select is ambiguous and gda should
> resolve it.
>
> If database provides MATCHED_ROW, set it.
> If not, set it using IMPACTED_ROW value.

The IMPACTED_ROW value should always be there (I don't want any "API break").
So I propose to modify the call to mysql_real_connect() to use the
CLIENT_FOUND_ROWS flag which has the effect that the
mysql_affected_rows() function returns the number of matched rows
instead of the number of the number of modified rows. This way the
IMPACTED_ROW will be like for any other provider.

Is this Ok for you?

>
> Solution like this could nicely work.
> Of course for gda > 4.2

For 4.2.x and 5.x or only for 5.x? If it is considered a correction
then it's for both, otherwise it's only for 5.x. I'd prefer that it be
for 4.2.x and 5.x.

Vivien
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.