From de0a7729ed8e5a24b526c568538096e3299f5cdf Mon Sep 17 00:00:00 2001 From: Bhuvnesh Chaudhary Date: Thu, 20 Apr 2017 15:09:40 -0700 Subject: [PATCH] Handle NULL while deriving propagation expression [#143443847] While constructing the propagation expression in case of queries involving default list partitions which have indexes, we ended up with NULLs crashing the database. Currently, we fallback to planner. But we need to handle it in a better way in future. Signed-off-by: Dhanashree Kashid --- .../src/translate/CTranslatorExprToDXLUtils.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp b/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp index f927bd0a21..6ba0989abe 100644 --- a/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp +++ b/libgpopt/src/translate/CTranslatorExprToDXLUtils.cpp @@ -564,7 +564,7 @@ CTranslatorExprToDXLUtils::UlPartKeyLevel // CTranslatorExprToDXLUtils::PdxlnPartialScanTestRange // // @doc: -// Construct a test expression for the given range +// Construct a test expression for the given range or list // based part constraint // //--------------------------------------------------------------------------- @@ -589,6 +589,17 @@ CTranslatorExprToDXLUtils::PdxlnPartialScanTestRange else // list partition { IDatum *pdatum = prng->PdatumLeft(); + if (pdatum == NULL) + { + // TODO: In case of default partitions, we end up with NULL for Left and Right Datum. + // Currently we fallback and should handle it better in future. + GPOS_RAISE + ( + gpdxl::ExmaDXL, + gpdxl::ExmiExpr2DXLUnsupportedFeature, + GPOS_WSZ_LIT("Queries over default list partition that have indexes") + ); + } GPOS_ASSERT(pdatum->FMatch(prng->PdatumRight())); CDXLDatum *pdxldatum = Pdxldatum(pmp, pmda, pdatum); -- GitLab