diff --git a/src/gausskernel/runtime/executor/nodeWindowAgg.cpp b/src/gausskernel/runtime/executor/nodeWindowAgg.cpp index c5bd2dbe3888733c2be099d8253297e393d98654..2d5eea00d918a645a85b2e9cebe3f38af4a6d204 100644 --- a/src/gausskernel/runtime/executor/nodeWindowAgg.cpp +++ b/src/gausskernel/runtime/executor/nodeWindowAgg.cpp @@ -254,10 +254,10 @@ static void advance_windowaggregate( if (fcinfo->argnull[i] && strcmp(get_func_name(perfuncstate->wfunc->winfnoid), "bit_and") == 0 && is_binary_type_in_dolphin(aggtranstype) && peraggstate->transValueIsNull && IsA(tle, Var)) { + MemoryContextSwitchTo(old_context); Var* var = (Var*)tle; peraggstate->transValue = get_bit_and_initval(aggtranstype, var->vartypmod); peraggstate->transValueIsNull = false; - MemoryContextSwitchTo(old_context); return; } else if (fcinfo->argnull[i]) { MemoryContextSwitchTo(old_context);