On Apr 9, 4:45 pm, Jeremy Evans <[email protected]> wrote:
> If process A does:
>
>   UPDATE a SET name = 'newbar' WHERE id = 1;
>
> and shortly thereafter process B does:
>
>   UPDATE a SET name = 'newbar' WHERE id = 1;
>
> Both processes should have the dataset return 1.  I believe this is
> true on most databases, but I could be wrong.

On most reasonable databases and adapters, this does return 1.
However, on MySQL with both the native adapter and the do adapter, it
returns 0.  On MySQL with the JDBC adapter, it returns 1.  It also
doesn't return 1 on the ADO adapter, but a lot of things don't work
there.

I would really like to enable this behavior by default, but I can't
without adding some lower level code that Sequel::Model can check to
see if database/adapter reports the accurate number of rows (returning
the number of rows matched by the filter rather than just the rows
where the query modified the data in the row).

Because of MySQL's behavior, this same issue affects the
instance_filters plugin when using it.  MySQL should still work
correctly with the optimistic_locking plugin, since the lock column is
incremented with every save.

The current status of the patch I'm working on is at 
http://pastie.org/916142.txt.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to