Hi Roland,
On 5 Aug 2009, at 12:14, Roland Bouman wrote:
Hi!
On Wed, Aug 5, 2009 at 11:37 AM, Konstantin Osipov<[email protected]>
wrote:
All tables used in a statement are locked at once, before
execution.
Then we update the first table, while accumulating PKs of the
second table in a temporary table.
Then we go over temporary table and update the rows in the second
table, using the accumulated PKs.
For MyISAM, this is as atomic as you get with LOCK TABLE t1 WRITE,
t2 WRITE, and then running the two updates.
Yes. So if some error occurs while dealing with the second table (say,
a constraint violation) then you could end up having processed only
all of the first table, and half of the second with MyISAM, right? At
least, that's how I understood it.
Correct.
But then, that's correct when you do it with the tables separately too
within LOCK/UNLOCK TABLES (because you can not ROLLBACK the changes to
t1).
The only way to do it properly is to have application or procedural
logic, if you really must use non-transactional tables and really need
the changes to be verified across both tables before they are issued.
Best regards
Mark
--
Mark Leith
MySQL Regional Support Manager, Americas
Sun Microsystems, Inc., http://www.sun.com/mysql/
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp