提交 fec843c3 编写于 作者: D Daniel Gustafsson

Catch exceptions from C++ in EXPLAIN for DXL generation

When generating DXL output in EXPLAIN {ANALYZE}, make sure to catch
any exceptions generated on the C++ side to avoid a server crash on
queries where ORCA fail to generate a plan. A better job of catching
the various different possible exceptions and generating nice error
messages can be made, this closes the current hole of trivial core
dumps on for example this: EXPLAIN (dxl) SELECT * FROM pg_class;
上级 c7b08234
......@@ -113,7 +113,18 @@ CGPOptimizer::SzDXLPlan
Query *pquery
)
{
return COptTasks::SzOptimize(pquery);
GPOS_TRY;
{
return COptTasks::SzOptimize(pquery);
}
GPOS_CATCH_EX(ex);
{
errstart(ERROR, ex.SzFilename(), ex.UlLine(), NULL, TEXTDOMAIN);
errfinish(errcode(ERRCODE_INTERNAL_ERROR),
errmsg("Optimizer failed to produce plan"));
}
GPOS_CATCH_END;
return NULL;
}
//---------------------------------------------------------------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册