Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Roberto Spadim
SET innodb_table_locks=1; SET autocommit=0; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; BEGIN; INSERT INTO m VALUES (1); INSERT INTO t VALUES (1); SELECT @@in_transaction; <- return 1 UNLOCK TABLES; SELECT @@in_transaction; <- return 1 -- SET innodb_table_locks=1; SET autocommit=0; SET TRAN

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Roberto Spadim
well from kb what i understand is: to use unlock with innodb (the engine you use with both tables), you should SET innodb_table_locks=1; SET autocommit=0; after that any LOCK/UNLOCK with innodb tables inside a transaction will commit the transaction try again using innodb_table_locks, and autocomm

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Federico Razzoli
No, becuase the first test case I've posted shows that the reality is different... :) I'm just asking to explain the exact interaction between trx and UNLOCK, because I need to know if statements I use are safe. Federico Mar 23/9/14, Roberto Spadim

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Roberto Spadim
better explained at mariadb kb https://mariadb.com/kb/en/mariadb/documentation/sql-commands/transactions/lock-tables-and-unlock-tables/#limitations ​ ___ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@lists.launchpad.net Un

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Roberto Spadim
this don't work too: LOCK TABLE t WRITE; BEGIN; SELECT @@in_transaction; (return 1) UNLOCK TABLES; SELECT @@in_transaction; (return 1) ​ maybe a wrong documentation 'bug' ___ Mailing list: https://launchpad.net/~maria-discuss Post to : maria-discuss@

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Federico Razzoli
LOCK always commits current transaction. This is documented. But I wasn't able to commit a transaction with UNLOCK. Perhaps I'm missing something? Federico Lun 22/9/14, Roberto Spadim ha scritto: Oggetto: Re: [Maria-discuss] transactions and UNLOC

Re: [Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Roberto Spadim
good question, at least here the implicity commit is with LOCK table and not unlock table CREATE OR REPLACE TABLE m (c INT) ENGINE = InnoDB; CREATE OR REPLACE TABLE t (c INT) ENGINE = myisam; (must be nontransaction table) SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; BEGIN; SELECT @@in_transacti

[Maria-discuss] transactions and UNLOCK TABLES

2014-09-22 Thread Federico Razzoli
In this MySQL manual page: http://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html I read: "UNLOCK TABLES commits a transaction only if any tables currently have been locked with LOCK TABLES to acquire nontransactional table locks." However, this doesn't seem to be the case, at least with Ma