[MCOL-4002] Performing a single insert after a LDI in a transaction does not work Created: 2020-05-14  Updated: 2020-11-12  Resolved: 2020-05-18

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.4.3
Fix Version/s: 1.4.4, 1.5.1

Type: Bug Priority: Major
Reporter: Gagan Goel (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Sprint: 2020-7

 Description   

Inside a transaction, if we perform a bulk insert (such as LDI) followed by a single insert, we don't see the record inserted by the single insert statement. However, the reverse sequence, i.e. performing a single insert followed by a LDI, inside a transaction works fine.

Here are steps to reproduce (here, data.txt is file containing 2 records: 231\n123):

MariaDB [test]> create table c1 (a int)engine=columnstore;
Query OK, 0 rows affected (0.625 sec)
 
MariaDB [test]> start transaction;
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [test]> load data local infile '/home/gagan_goel_mariadb_com/insert-profiling/data.txt' into table c1;
Query OK, 2 rows affected (0.241 sec)                
Records: 2  Deleted: 0  Skipped: 0  Warnings: 0
 
MariaDB [test]> select * from c1;
+------+
| a    |
+------+
|  231 |
|  123 |
+------+
2 rows in set (0.065 sec)
 
MariaDB [test]> insert into c1 values (100);
Query OK, 1 row affected (0.000 sec)
 
MariaDB [test]> select * from c1;
+------+
| a    |
+------+
|  231 |
|  123 |
+------+
2 rows in set (0.030 sec)
 
MariaDB [test]> rollback;
Query OK, 0 rows affected (0.070 sec)
 
MariaDB [test]> select * from c1;
Empty set (0.044 sec)
 
MariaDB [test]> start transaction;
Query OK, 0 rows affected (0.000 sec)
 
MariaDB [test]> insert into c1 values (100);
Query OK, 1 row affected (0.077 sec)
 
MariaDB [test]> select * from c1;
+------+
| a    |
+------+
|  100 |
+------+
1 row in set (0.036 sec)
 
MariaDB [test]> load data local infile '/home/gagan_goel_mariadb_com/insert-profiling/data.txt' into table c1;
Query OK, 2 rows affected (0.087 sec)                
Records: 2  Deleted: 0  Skipped: 0  Warnings: 0
 
MariaDB [test]> select * from c1;
+------+
| a    |
+------+
|  100 |
|  231 |
|  123 |
+------+
3 rows in set (0.013 sec)
 
MariaDB [test]> rollback;
Query OK, 0 rows affected (0.035 sec)
 
MariaDB [test]> select * from c1;
Empty set (0.012 sec)



 Comments   
Comment by Gagan Goel (Inactive) [ 2020-05-15 ]

For QA:

The queries shown in the issue description above should be working as expected (i.e. for the case of an LDI followed by a single insert, in a transaction, we should now see the single insert record in the table).

In addition, we have also added test cases to the regression suite for this: mysql/queries/working_dml/misc/MCOL-4002.sql

Comment by Daniel Lee (Inactive) [ 2020-05-18 ]

Build verified: 1.4.4-1 (Jenkins 20200518)

Reproduced the issue in 1.4.3-4 and verified the fix in 1.4.4-1

Testing rollback and commit, with and without transaction.

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