zhouqingqing/qpmodel

Selecting just one expression (SELECT 4711;) causes assert failure

PerHChristensen opened this issue · 2 comments

When issuing this query

SELECT 4711;

we get the following stack trace:

"***************** raw plan *************
LogicResult
Output: 4711

***************** optimized plan *************
LogicResult 634
Output: 4711

Memo:
*0: 1, 0, [11903911][NaN]: 4711

Summary: 1,0
Process terminated. Assertion failed.
at qpmodel.optimizer.CMemoGroup.CalculateMinInclusiveCostMember() in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\optimizer.cs:line 367
at qpmodel.optimizer.CMemoGroup.CopyOutMinLogicPhysicPlan() in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\optimizer.cs:line 427
at qpmodel.optimizer.Optimizer.CopyOutOnePlan(SQLStatement stmt, Memo memo) in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\optimizer.cs:line 681
at qpmodel.optimizer.Optimizer.CopyOutOptimalPlan(SQLStatement stmt, Boolean dequeueit) in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\optimizer.cs:line 707
at qpmodel.optimizer.Optimizer.CopyOutOptimalPlan() in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\optimizer.cs:line 717
at qpmodel.Program.Main(String[] args) in C:\Users\pchriste\Source\Repos\qpmodel\qpmodel\Program.cs:line 223

"

When "select 4711" is executed like this

sql = "select 4711";
TU.ExecuteSQL(sql, "4711");

as a unit test this test passes.

But if it is executed from "line 168" in Program.cs we get the exception.

that's because by default MEMO is off and program.cs happen to enabled it.