[MCOL-81] Bug4031 test failing - optimizer override bug Created: 2016-05-24  Updated: 2016-06-02  Resolved: 2016-06-02

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

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


 Description   

This is reported by David.Hall
Re: working_tpch1_compareLogOnly/onClauseJoins/bug4031.sql query one gets a different answer than InfiniDB. It looks like another case where InfiniDB's optimizer is conflicting with MariaDB's optimizer and moving things to the inside of a join when they should stay outside.

This was indeed the same bug that optimized when it shouldn't. The shortcut I took before wasn't good enough. A full search of the list is needed.

		// MariaDB 10.1: cached_table is never available for derived tables.
		// Find the uncached object in table_list
		TABLE_LIST* tblList = ifp->context ? ifp->context->table_list : NULL;
		while (tblList)
		{
			if (strcasecmp(tblList->alias, ifp->table_name) == 0)
			{
				if (!tblList->outer_join)
				{
					sc->derivedTable(derivedName);
					sc->derivedRefCol(cols[j].get());
				}
				break;
			}
			tblList = tblList->next_local;
		}



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

Check ifp->context for NULL. We found a case where it is NULL.

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

QA

I think this one is completely solved.

Comment by Daniel Lee (Inactive) [ 2016-06-02 ]

Build verified:

mscadmin> getsoft
getsoftwareinfo Thu Jun 2 14:44:48 2016

Name : mariadb-columnstore-platform Relocations: (not relocatable)
Version : 1.0 Vendor: MariaDB Corporation Ab
Release : 0 Build Date: Thu 02 Jun 2016 11:12:01 AM CDT
Install Date: Thu 02 Jun 2016 02:31:19 PM CDT Build Host: srvbuilder
Group : Applications Source RPM: mariadb-columnstore-1.0-0.src.rpm

Tested the same test case on the above build and InfiniDB 4.6.0-1, with TPCH 1mb and 1gb databases. Results are matching.

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