[MCOL-361] table mode 0 and 2 has bad result Created: 2016-10-14 Updated: 2016-11-22 Resolved: 2016-11-22 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MDB Plugin |
| Affects Version/s: | 1.0.3 |
| Fix Version/s: | 1.0.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS |
||
| Sprint: | 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> show warnings; --------
--------
-------- mysql> <Columnstore>
---------
MariaDB [tpch1]> show warnings;
--------
-------- MariaDB [tpch1]> |
| Comments |
| Comment by David Hall (Inactive) [ 2016-10-14 ] |
|
This test is repeated in tablemode.sql which uses table mode 0 and may be easier to debug in table mode 0 |
| Comment by David Hall (Inactive) [ 2016-10-14 ] |
|
All queries that work in table mode 1 (vtable mode) should work in table mode 0 (no vtable). In tablemode.sql, we find the following query that returns the proper answer in table mode 1, yet returns an empty set in table mode 0: SELECT L_SHIPMODE, SUM( CASE WHEN O_ORDERPRIORITY = '1-URGENT' OR O_ORDERPRIORITY = '2-HIGH' THEN 1 ELSE 0 END) AS HIGH_LINE_COUNT,SUM( CASE WHEN O_ORDERPRIORITY <> '1- URGENT' AND O_ORDERPRIORITY <> '2-HIGH'THEN 1 ELSE 0 END) AS LOW_LINE_COUNT FROM ORDERS,LINEITEM WHERE o_custkey < 100 and O_ORDERKEY = L_ORDERKEY AND L_SHIPMODE IN ('FOB','SHIP') AND L_COMMITDATE < L_RECEIPTDATE AND L_SHIPDATE < L_COMMITDATE AND L_RECEIPTDATE >= date '1994-01-01' AND L_RECEIPTDATE < date '1994-01-01' + interval '1' year GROUP BY L_SHIPMODE ORDER BY L_SHIPMODE; |
| Comment by David Hall (Inactive) [ 2016-10-19 ] |
|
These tests are now commented out in working_tpch1_compareLogOnly/tableMode/autoswitch.sql and tablemode.sql |
| Comment by Andrew Hutchings (Inactive) [ 2016-10-24 ] |
|
Duplicate of |
| Comment by David Hall (Inactive) [ 2016-10-24 ] |
|
No. |
| Comment by David Hall (Inactive) [ 2016-11-01 ] |
|
When MariaDB server is setting up the IN array, it doesn't copy the strings, but rather keeps pointers to the Strings in the items. Later, in engine processing, we use the c_ptr() function to access the data because Strings are not zero terminated. c_ptr() forces a zero termination. Unfortunately, it also may cause a realloc, which invalidates the pointers in the IN array. |
| Comment by David Hall (Inactive) [ 2016-11-01 ] |
|
Replaced all uses of c_ptr() in Columnstore of String references from the server. In all cases, we were trying to instantiate or assign a std::string. Use instead std::string::assign(str->ptr(), str->length()). ptr() and length() do not modify the String's data. Andrew: Please review. For some damn reason I can't put this into review state. |
| Comment by Daniel Lee (Inactive) [ 2016-11-22 ] |
|
Build verified: 1.0.5-1 mcsadmin> getsoft Name : mariadb-columnstore-platform Verified both vtable modes 0 and 1 returned the results now. |