[Koha-bugs] [Bug 18364] LOCK and UNLOCK are not transaction-safe

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 20 13:27:56 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18364

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #62074|0                           |1
        is obsolete|                            |

--- Comment #11 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 62458
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=62458&action=edit
Bug 18364: Do not LOCK/UNLOCK tables from tests

>From the MySQL doc:
"LOCK TABLES is not transaction-safe and implicitly commits any active
transaction before attempting to lock the tables."
If the LOCK/UNLOCK statements are executed from tests, the current transaction
will be committed.
To avoid that we need to guess if this code is execute from testsa or not (yes
it is a bit hacky)

Better ideas are welcome!

Another fix would have been to revert
  commit be156d9ad9e5bcfadab34d44f90e04fd61e256ad
  Bug 15854: Use a READ and WRITE LOCK on message_queue
but theorically a race is still possible.

Existing tests seem to be safe, to test this patch you will need new
tests from bug 17964.
Test plan:
  prove t/db_dependent/Letters/TemplateToolkit.t
twice, and notice that changes have been comitted.

Signed-off-by: Nick Clemens <nick at bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list