Hello,
I have 2 questions regarding InnoDB tables:
1. In the MySQL manual, it states that
"MySQL begins each client connection with autocommit mode enabled by
default. When autocommit is enabled, MySQL does a commit after each SQL
statement if that statement did not return an error."
Does using BEGIN override this behavior? In other words, with
autocommit on, does BEGIN open up a new transaction and stop committing
until an explicit COMMIT command? Or do I need to turn autocommit off
before multi-query transactions?
2. I have been reading the examples for LOCK IN SHARE MODE and FOR
UPDATE in the manual, but I am still confused as to when I should use
one as opposed to the other. I have gone through tutorials but many
just use the same examples as the manual. I'm sure I'm just missing
something small, but if someone could give a simple example of the
difference between the two, that would be very helpful as the difference
to me seems very suttle.
Thanks in advance.