[MDEV-10561] Transactions not ACID compliant? Created: 2016-08-15 Updated: 2016-10-17 Resolved: 2016-10-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.0.20 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Volker Cordes | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | need_feedback | ||
| Environment: |
debian jessie |
||
| Description |
|
Hello, I ran into a problem when testing MariaDB with my application. Transactions do not work as expected. To reproduce I opened two connections to the database and entered the following statements:
Am I missing something or is this a bug? Regards, |
| Comments |
| Comment by Daniel Black [ 2016-08-16 ] | |
|
This looks like you are using MyISAM for the table type. MyISAM isn't a transactional database and it would exhibit the behaviour you describe. Try again using innodb.
| |
| Comment by Elena Stepanova [ 2016-08-16 ] | |
|
I agree with danblack, what you've described, if we take it literately, is not InnoDB behavior.
Thanks. | |
| Comment by Volker Cordes [ 2016-08-17 ] | |
|
Hello, I'm using innodb for all my tables. I expected step 8 to fail, because I was thinking that with optimistic locking the first transaction to commit wins and for later transactions with conflicts the commit fails. Volker | |
| Comment by Elena Stepanova [ 2016-09-19 ] | |
|
My previous comment still applies. In your scenario, with the default transaction isolation level REPEATABLE-READ (and other two levels, for that matter), UPDATE on step 6 should wait for COMMIT from the other connection, rather then return immediately as you describe. At least that's how it works for me on a simple table with two fields and one row. If it's not so, please provide the structure and the contents of your test table (table dump if possible, if not then the output of SHOW CREATE TABLE and SELECT * FROM table if there are only few rows, or SHOW TABLE STATUS). Please also attach your cnf file(s) or the output of SHOW VARIABLES from both connections which you use for your test. With SERIALIZABLE it should also work differently from the initial scenario that you described – not COMMIT on step 8 would fail, but UPDATE on step 6. | |
| Comment by Elena Stepanova [ 2016-10-17 ] | |
|
Please comment to re-open if you have further information on the issue. |