[MCOL-4126] Update or delete followed by insert to a different table may not work and leaves tablelock Created: 2020-06-29  Updated: 2020-07-10  Resolved: 2020-07-09

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.5.2
Fix Version/s: 1.5.3

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


 Description   

In ha_mcs_impl.cpp doUpdateDelete(), it sets ci.tableOid (that's the cal_connection_info struct).
It never un-sets it. The next command may use this. An Insert most certainly will, causing serious consternation in the following code that may leave a table lock behind.

drop table if exists T4126_1;
drop table if exists T4126_2;
 
create table T4126_1 (idx int, col varchar(20)) engine=columnstore;
create table T4126_2 (idx int, col varchar(20), col2 varchar(20)) engine=columnstore;
insert into T4126_1 values (3, 'a');
select * from T4126_1;
 
insert into T4126_2 values (1, 'lamp', 'table lamp');  
select * from T4126_2;
update T4126_2 set col = "floor lamp" where col = 'lamp';
 
drop table if exists T4126_1;
drop table if exists T4126_2;
 
create table T4126_1 (idx1 int, col1 varchar(20)) engine=columnstore;
insert into T4126_1 values (3, 'a');                       <<-- Will break here and leave a lock on
select * from T4126_1;
drop table if exists sT4126_1;



 Comments   
Comment by David Hall (Inactive) [ 2020-06-29 ]

There's a regression PR for this as well

Comment by Patrick LeBlanc (Inactive) [ 2020-06-30 ]

Spotted add'l paths that need cleaning, reopening.

Comment by Gagan Goel (Inactive) [ 2020-07-08 ]

David.Hall Does this also need to go into 1.4 and 1.2?

Comment by Daniel Lee (Inactive) [ 2020-07-09 ]

Build verified: 1.5.3-1 (drone build #287)

Reproduced the issue in 1.5.2-1

MariaDB [mytest]> insert into T4126_1 values (3, 'a');
ERROR 1815 (HY000): Internal error: CAL0001: IDB-2006: 'mytest.t4126_2' does not exist in Columnstore.

and verified in 1.5.3-1

Comment by Daniel Lee (Inactive) [ 2020-07-10 ]

Restarted in 1.5.3-1 (drone #280)

MariaDB [d1]> create table T4126_1 (idx1 int, col1 varchar(20)) engine=columnstore;
Query OK, 0 rows affected (0.189 sec)

MariaDB [d1]> insert into T4126_1 values (3, 'a');
ERROR 1815 (HY000): Internal error: CAL0001: IDB-2006: 'd1.t4126_2' does not exist in Columnstore.

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