Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
1.1.0
-
None
-
2017-20, 2017-21
Description
When working on MCOL-902, which complains about the reported execution time time, the sample query crashes mysqld. The crash is due to a failure to check return code at ha_exec_plan.cpp around line 3608. The call to buildReturnedColumn() fails, sets gwi.fatalParseError and returns NULL. The return value is used without checking first. In general, buildReturnedColumn() should never fail, as all syntax is checked before getting to this point. However, something is stripping the schema name off of the GROUP_CONCAT's ORDER BY clause.
After fixing the crash issue, the query fails with:
ERROR 1178 (42000): The storage engine for the table doesn't support IDB-3009: Unknown column '..g_position', which is why buildReturnedColumn() reports an error.
This query works in 1.0
CREATE TABLE `phased_genotype` ( `animalID` varchar(18) DEFAULT NULL, `mid` int(11) DEFAULT NULL, `phase` tinyint(4) DEFAULT NULL ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
CREATE TABLE `phased_snp_info` ( `mid` int(11) DEFAULT NULL, `chr` tinyint(4) DEFAULT NULL, `position` bigint(20) DEFAULT NULL, `g_position` int(11) DEFAULT NULL ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
select animalID,group_concat(phase order by b.g_position separator '') as g from phased_genotype a,phased_snp_info b where a.mid=b.mid group by animalID;
Attachments
Issue Links
- relates to
-
MCOL-902 Group_concat() performance and gettrace() elapsed time
-
- Closed
-
There is special Columnstore code in sql_select.cc to prevent just this issue. Unfortunately, the surrounding code has been changed to the point that the action was being taken too soon, so the special code had to move a few lines:
// @InfiniDB We don't need tmp table for vtable create phase. Plus
// to build tmp table may corrupt some field table_name & db_name (for some reason)
if (thd->infinidb_vtable.vtable_state == THD::INFINIDB_CREATE_VTABLE)
need_tmp = false;
Moving this to below the call to make_join_readinfo() fixes the problem.