[MCOL-1456] Query doesn't try REDO_PHASE1 Created: 2018-06-06  Updated: 2019-02-21  Resolved: 2019-02-21

Status: Closed
Project: MariaDB ColumnStore
Component/s: MDB Plugin
Affects Version/s: 1.2
Fix Version/s: 1.2.3

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

Issue Links:
PartOf
includes MDEV-16511 Server tries to create and use GROUP ... Closed
Relates
relates to MCOL-1457 operating mode 0 fails under certain ... Closed

 Description   

In test working_tpch1_compareLogOnly/tableMode/autoswitch.sql, we find the following:

SELECT SUM(L_EXTENDEDPRICE * (1 - L_DISCOUNT)) AS REVENUE FROM LINEITEM, PART WHERE ( P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#41' AND P_CONTAINER IN ( 'SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') AND L_QUANTITY >= 3 AND L_QUANTITY <= 3 + 1 AND P_SIZE BETWEEN 1 AND 5 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON' ) OR ( P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#33' AND P_CONTAINER IN ( 'MED BAG', 'MED BOX', 'MED PKG', 'MED PACK') AND L_QUANTITY >= 14 AND L_QUANTITY <= 14 + 1 AND P_SIZE BETWEEN 1 AND 10 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON' ) OR ( P_PARTKEY = L_PARTKEY AND P_BRAND = 'Brand#45' AND P_CONTAINER IN ( 'LG CASE', 'LG BOX', 'LG PACK', 'LG PKG') AND L_QUANTITY >= 25 AND L_QUANTITY <= 25 + 1 AND P_SIZE BETWEEN 1 AND 15 AND L_SHIPMODE IN ('AIR', 'AIR REG') AND L_SHIPINSTRUCT = 'DELIVER IN PERSON' );

In 1.1 this would cause an autoswitch to mode 0 and the query completes:
-------------

REVENUE

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

607989.6988

-------------
1 row in set, 1 warning (15.93 sec)

In 1.2, it doesn't matter what the vtable mode is, we always get this error:
ERROR 1815 (HY000): Internal error: IDB-1000: 'lineitem' and 'part' are not joined.



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

There's more to it than that. It breaks with mode 0. OK, maybe disabling GROUP BY push down would help. Or maybe fixing GROUP BY push down to handle this.

But even so, when in mode 2 (auto fail-over to mode 0), it doesn't auto fail-over. It just fails and never sets REDO_PHASE1. Verified in gdb.

Comment by Roman [ 2018-06-21 ]

The create_calpont_group_by_handler() checks both infinidb_vtable_mode and vtable_status before returns the GROUP BY handler, so query processing in autoswitch mode follows the pre-1.2 behavior.

Comment by Roman [ 2018-06-21 ]

Please review the workaround.

Comment by David Hall (Inactive) [ 2018-06-22 ]

This bug report is only for the ability to autoswitch, which the patch fixes. However the query still doesn't work in mode 0. See MCOL-1457.

Comment by Daniel Lee (Inactive) [ 2019-02-21 ]

Build verified: 1.2.3-1
server commit:
61f32f2
engine commit:
46cc344

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