mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-05-28 13:01:26 +03:00
MCOL-1472 Add switch to handle nested case
This commit is contained in:
parent
ced7eb4046
commit
7ec1ccac5e
@ -1268,7 +1268,7 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip)
|
|||||||
ifp->functype() == Item_func::ISNOTNULL_FUNC)
|
ifp->functype() == Item_func::ISNOTNULL_FUNC)
|
||||||
{
|
{
|
||||||
ReturnedColumn* rhs = NULL;
|
ReturnedColumn* rhs = NULL;
|
||||||
if (!gwip->rcWorkStack.empty())
|
if (!gwip->rcWorkStack.empty() && !gwip->inCaseStmt)
|
||||||
{
|
{
|
||||||
rhs = gwip->rcWorkStack.top();
|
rhs = gwip->rcWorkStack.top();
|
||||||
gwip->rcWorkStack.pop();
|
gwip->rcWorkStack.pop();
|
||||||
@ -3267,7 +3267,12 @@ FunctionColumn* buildCaseFunction(Item_func* item, gp_walk_info& gwi, bool& nonS
|
|||||||
if (funcName == "case_searched" &&
|
if (funcName == "case_searched" &&
|
||||||
(i < arg_offset))
|
(i < arg_offset))
|
||||||
{
|
{
|
||||||
|
// MCOL-1472 Nested CASE with an ISNULL predicate. We don't want the predicate
|
||||||
|
// to pull off of rcWorkStack, so we set this inCaseStmt flag to tell it
|
||||||
|
// not to.
|
||||||
|
gwi.inCaseStmt = true;
|
||||||
sptp.reset(buildParseTree((Item_func*)(item->arguments()[i]), gwi, nonSupport));
|
sptp.reset(buildParseTree((Item_func*)(item->arguments()[i]), gwi, nonSupport));
|
||||||
|
gwi.inCaseStmt = false;
|
||||||
if (!gwi.ptWorkStack.empty() && *gwi.ptWorkStack.top()->data() == sptp->data())
|
if (!gwi.ptWorkStack.empty() && *gwi.ptWorkStack.top()->data() == sptp->data())
|
||||||
{
|
{
|
||||||
gwi.ptWorkStack.pop();
|
gwi.ptWorkStack.pop();
|
||||||
|
@ -147,6 +147,9 @@ struct gp_walk_info
|
|||||||
int32_t recursionHWM;
|
int32_t recursionHWM;
|
||||||
std::stack<int32_t> rcBookMarkStack;
|
std::stack<int32_t> rcBookMarkStack;
|
||||||
|
|
||||||
|
// Kludge for MCOL-1472
|
||||||
|
bool inCaseStmt;
|
||||||
|
|
||||||
gp_walk_info() : sessionid(0),
|
gp_walk_info() : sessionid(0),
|
||||||
fatalParseError(false),
|
fatalParseError(false),
|
||||||
condPush(false),
|
condPush(false),
|
||||||
@ -162,7 +165,8 @@ struct gp_walk_info
|
|||||||
lastSub(0),
|
lastSub(0),
|
||||||
derivedTbCnt(0),
|
derivedTbCnt(0),
|
||||||
recursionLevel(-1),
|
recursionLevel(-1),
|
||||||
recursionHWM(0)
|
recursionHWM(0),
|
||||||
|
inCaseStmt(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
~gp_walk_info() {}
|
~gp_walk_info() {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user