[MCOL-43] Function Join fails Created: 2016-05-06  Updated: 2016-06-15  Resolved: 2016-05-31

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

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

Centos 6.5



 Description   

ref: working_tpch1_compareLogOnly/fnJoin/fj002.sql.log

Join is reporting incorrect answer. count = 1 rather than proper count.



 Comments   
Comment by David Hall (Inactive) [ 2016-05-13 ]

There seems to be nothing wrong with the join. The error appears in the INSERT...SELECT that builds the table used in this join.

create table yabbaDabbaDoo(o_orderkey int, dt date, dtm datetime)engine=infinidb;

insert into yabbaDabbaDoo select o_orderkey, o_orderdate, date_add(o_orderdate, interval o_orderkey second) from orders where o_orderkey <= 100;

For some reason, the date_add function is storing NULL in every row. This only fails for INSERT_SELECT.

select o_orderkey, o_orderdate, date_add(o_orderdate, interval o_orderkey second) from orders where o_orderkey <= 100;

returns the correct data.

Comment by David Hall (Inactive) [ 2016-05-16 ]

This issue stems from the introduction in mysql5.6 of MYSQL_TYPE_DATETIME2. This internal data type has a different encoding than MYSQL_TYPE_DATETIME.

During execution of the insert...select, the system creates a column of type MYSQL_TYPE_DATETIME to represent the result of the date_add. When it generates the data for the insert column – dtm – it uses MYSQL_TYPE_DATETIME2. When these were of the same type pre-mysql5.6, it was a straight forward memcpy that put the data into the output buffer. Now a conversion takes place, a conversion Columnstore was not prepared to handle.

This is fixed by testing inserted DATETIME data for MYSQL_TYPE_DATETIME2 and using the new decoding functions if true.

Comment by David Hall (Inactive) [ 2016-05-16 ]

For QA

Comment by Dipti Joshi (Inactive) [ 2016-05-31 ]

dleeyhHas this been verified ?

Comment by Daniel Lee (Inactive) [ 2016-05-31 ]

Build verified:

getsoftwareinfo Tue May 31 10:30:28 2016

Name : mariadb-columnstore-platform Relocations: (not relocatable)
Version : 1.0 Vendor: MariaDB Corporation Ab
Release : 0 Build Date: Fri 27 May 2016 04:07:53 PM EDT
Install Date: Mon 30 May 2016 11:32:15 AM EDT Build Host: srvbuilder

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