Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.0.3
-
None
-
CentOS
-
2016-21, 2016-22
Description
Re working_tpch1_compareLogOnly/tableMode/autoswitch.sql
When a query fails in vtable mode table mode 2 tries again using table mode 0 in which Columnstore sends the query using the standard engine mechanism, which is much slower. But it does allow syntax that vtable mode rejects.
The purpose of this test is to test the auto-switch capabilities of vtable mode 2. That part is working. However, the test has uncovered a bug in vtable mode 0.
In this case, the following query works in InfiniDB, but not Columnstore:
<InfiniDB>
mysql> 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' );
-------------
REVENUE |
-------------
607989.6988 |
-------------
1 row in set, 1 warning (13.89 sec)
mysql> show warnings; -------------------------------------------------------------------------------------------------------------------------------------------------------------------
Level | Code | Message |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note | 1051 | Unknown table '$vtable_1' |
Note | 1051 | Unknown table '$vtable_1' |
Warning | 9999 | The query includes syntax that is not supported by InfiniDB distributed mode. The execution was switched to standard mode with downgraded performance. |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 rows in set (0.00 sec)
mysql>
<Columnstore>
MariaDB [tpch1]> 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' );
---------
REVENUE |
---------
NULL | // Should not be NULL --------- 1 row in set, 1 warning (3.69 sec) |
MariaDB [tpch1]> show warnings;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Level | Code | Message |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Note | 1051 | Unknown table 'infinidb_vtable.$vtable_684' |
Error | 1815 | Internal error: IDB-1000: 'lineitem' and 'part' are not joined. |
Note | 1051 | Unknown table 'infinidb_vtable.$vtable_684' |
Warning | 9999 | The query includes syntax that is not supported by MariaDB Columnstore distributed mode. The execution was switched to standard mode with downgraded performance. |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4 rows in set (0.00 sec)
MariaDB [tpch1]>