[MCOL-5002] ExeMgr crash with certain subselects Created: 2022-02-25  Updated: 2022-03-14  Resolved: 2022-03-14

Status: Closed
Project: MariaDB ColumnStore
Component/s: ExeMgr
Affects Version/s: 6.3.1
Fix Version/s: 6.3.1

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

Sprint: 10.0.20

 Description   

Consider this query:

select p_brand, p_type, p_size
from v_partsupp, v_part 
where p_partkey = ps_partkey
and ps_suppkey NOT IN
    ( select s_suppkey 
      from v_supplier 
      where s_comment like '%Customer%Complaints%' ) 
limit 10;

With version 6.2.3-1, this query completes correctly. With version 6.3.1 (unreleased) it raises sig6 SIGABT.
If written to use IN rather than NOT IN, the the SIGABT does not happen.

Some analysis shows that the underlying problem has always existed. Starting with 6.3.1, we have enabled more extensive array checking, and this exposes the problem.

In tuplejoiner.cpp around line 604, we find:

  if (UNLIKELY(inUM() && (joinType & MATCHNULLS) && !isNull && !typelessJoin))
  {
    if (smallRG.getColType(largeKeyColumns[0]) == CalpontSystemCatalog::LONGDOUBLE)

There is no guarantee that the index in largeKeyColumns is a valid index in smallRG. largeKeyColumns[n] should only be used to index into largeRG, not smallRG.

So the task here is to determine whether the author intended to comapare smallRG to smallKeyColumns[0] or should it be largeRG to largeKeyColumns[0]. Frankly, in this particular context, it may not matter, but it is important that we compare apples to apples.



 Comments   
Comment by Daniel Lee (Inactive) [ 2022-03-14 ]

Build verified: 6.3.1-1 (#4049)

I could not reproduce the issue using drone build 3571. I don't know at what point the 6.3.1 was broken. I verified build 4049 and it is working fine. I verified it using both 1gb and 10gb databases.

MariaDB [tpch10]> select p_brand, p_type, p_size from partsupp, part  where p_partkey = ps_partkey and ps_suppkey NOT IN     ( select s_suppkey        from supplier        where s_comment like '%Customer%Complaints%' )  limit 10;
+----------+-------------------------+--------+
| p_brand  | p_type                  | p_size |
+----------+-------------------------+--------+
| Brand#22 | ECONOMY BRUSHED NICKEL  |     42 |
| Brand#22 | ECONOMY BRUSHED NICKEL  |     42 |
| Brand#22 | ECONOMY BRUSHED NICKEL  |     42 |
| Brand#22 | ECONOMY BRUSHED NICKEL  |     42 |
| Brand#35 | STANDARD POLISHED STEEL |      9 |
| Brand#35 | STANDARD POLISHED STEEL |      9 |
| Brand#35 | STANDARD POLISHED STEEL |      9 |
| Brand#35 | STANDARD POLISHED STEEL |      9 |
| Brand#41 | SMALL POLISHED NICKEL   |     32 |
| Brand#41 | SMALL POLISHED NICKEL   |     32 |
+----------+-------------------------+--------+
10 rows in set (0.484 sec)

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