[MCOL-736] transaction gets autocommitted if non columnstore query executed Created: 2017-06-02  Updated: 2017-06-12  Resolved: 2017-06-12

Status: Closed
Project: MariaDB ColumnStore
Component/s: MariaDB Server
Affects Version/s: 1.0.9
Fix Version/s: 1.0.10, 1.1.0

Type: Bug Priority: Major
Reporter: David Thompson (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: community

Sprint: 2017-12

 Description   

It looks like ColumnStore is not respecting a transaction ROLLBACK if, inside the transaction, we issue a SELECT statement.

This happens regardless of the table engine (we tested with InnoDB and ColumStore).

Test case:

CREATE TABLE `countries_innodb` (
`code` varchar(255) NOT NULL
) ENGINE=InnoDB;

INSERT INTO countries_innodb (code) VALUES ('BR');

BEGIN;
INSERT INTO countries_innodb (code) VALUES ('UK');
SELECT 'INSIDE TRANSACTION' AS '';
ROLLBACK;

– Result: two countries.
– Expected: one country.
SELECT * FROM countries_innodb;

It looks like only the SELECT generates this behavior. If we INSERT or UPDATE multiple times, the transaction is still ROLL'd back fine.

Current version: 1.0.9.



 Comments   
Comment by David Thompson (Inactive) [ 2017-06-02 ]

This works correctly if the table being inserted is columnstore and you query a columnstore table in the select (i.e. the transaction is wholly within the columnstore world). The innodb / innodb case should really work however and indicates a possible break in our fork. Hybrid cases need to be examined to see if we can support these easily or not.

Comment by Andrew Hutchings (Inactive) [ 2017-06-08 ]

The drop part of the vtable process is triggering an implicit commit. Since this is a temporary table we can add the 'temporary' keyword to the drop and the implicit commit on select will stop.

Comment by Andrew Hutchings (Inactive) [ 2017-06-08 ]

Two pull requests in server and two in regression suite.

Comment by Daniel Lee (Inactive) [ 2017-06-12 ]

Builds tested: Github source 1.0.10, 1.1.0

1.1.0

[root@localhost mariadb-columnstore-server]# git show
commit 594ef1807a5d6cba45cf7c2bed03cccdc32f177a
Merge: a5f191d ce815f9
Author: David.Hall <david.hall@mariadb.com>
Date: Thu Jun 8 10:12:50 2017 -0500

Merge pull request #55 from mariadb-corporation/MCOL-736

MCOL-736 Fix implicit commit on SELECT

[root@localhost mariadb-columnstore-engine]# git show
commit 3e1bdfb1e97490f3d66339eb11d1d1de1222487a
Author: david hill <david.hill@mariadb.com>
Date: Wed Jun 7 15:09:09 2017 -0500

MCOL-628 fix non-root disk, hardcoded path issue

1.0.10

[root@localhost mariadb-columnstore-server]# git show
commit e8bf04ce2b6b67ee399b3626dff6055f35d50c60
Merge: a02e745 9c0aa3c
Author: David.Hall <david.hall@mariadb.com>
Date: Thu Jun 8 10:13:15 2017 -0500

Merge pull request #54 from mariadb-corporation/MCOL-736-1.0

MCOL-736 Fix implicit commit on SELECT

commit 4d5a59d3d104cda2a7715b4e619318e43e964214
Author: david hill <david.hill@mariadb.com>
Date: Fri Jun 2 11:03:12 2017 -0500

MCOL-538 - fix spelling issue

Tested innodb, columnstore, and innodb/columnstore combination.

MariaDB [mytest]> CREATE TABLE `countries_innodb` (
-> `code` varchar(255) NOT NULL
-> ) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)

MariaDB [mytest]> INSERT INTO countries_innodb (code) VALUES ('BR');
Query OK, 1 row affected (0.00 sec)

MariaDB [mytest]> BEGIN;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mytest]> INSERT INTO countries_innodb (code) VALUES ('UK');
Query OK, 1 row affected (0.01 sec)

MariaDB [mytest]> SELECT 'INSIDE TRANSACTION' AS '';
--------------------

 

--------------------

INSIDE TRANSACTION

--------------------
1 row in set (0.00 sec)

MariaDB [mytest]> ROLLBACK;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mytest]> SELECT * FROM countries_innodb;
------

code

------

BR

------
1 row in set (0.01 sec)

MariaDB [mytest]> CREATE TABLE `countries_columnstore` (
-> `code` varchar(255) NOT NULL
-> ) ENGINE=columnstore;
Query OK, 0 rows affected (0.32 sec)

MariaDB [mytest]> CREATE TABLE `countries_innodb` (
-> `code` varchar(255) NOT NULL
-> ) ENGINE=innodb;
ERROR 1050 (42S01): Table 'countries_innodb' already exists
MariaDB [mytest]> INSERT INTO countries_innodb (code) VALUES ('USA');
Query OK, 1 row affected (0.00 sec)

MariaDB [mytest]> INSERT INTO countries_columnstore (code) VALUES ('BR');
Query OK, 1 row affected (0.34 sec)

MariaDB [mytest]> BEGIN;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mytest]> INSERT INTO countries_columnstore (code) VALUES ('UK');
Query OK, 1 row affected (0.05 sec)

MariaDB [mytest]> select * from countries_innodb;
------

code

------

BR
USA

------
2 rows in set (0.00 sec)

MariaDB [mytest]> SELECT 'INSIDE TRANSACTION' AS '';
--------------------

 

--------------------

INSIDE TRANSACTION

--------------------
1 row in set (0.00 sec)

MariaDB [mytest]> ROLLBACK;
Query OK, 0 rows affected (0.06 sec)

MariaDB [mytest]> SELECT * FROM countries_columnstore;
------

code

------

BR

------
1 row in set (0.03 sec)

Generated at Thu Feb 08 02:23:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.