docs: public CompiledPlan plan() throws PlanningErrorException {
          // reset any error message
          m_recentErrorMsg = null;
  
          // what's going to happen next:
          //  If a parameterized statement exists, try to make a plan with it
          //  On success return the plan.
          //  On failure, try the plan again without parameterization
  
          if (m_paramzInfo != null) {
              try {
                  // compile the plan with new parameters
                  CompiledPlan plan = compileFromXML(m_paramzInfo.getParameterizedXmlSQL(),
                                                     m_paramzInfo.getParamLiteralValues());
                  if (plan != null) {
                      if (plan.extractParamValues(m_paramzInfo)) {
                          return plan;
                      }
                  }
                  else if (DEBUGGING_STATIC_MODE_TO_RETRY_ON_ERROR) {
                      compileFromXML(m_paramzInfo.getParameterizedXmlSQL(),
                                     m_paramzInfo.getParamLiteralValues());
                  }
                  // fall through to try replan without parameterization.
              }
              catch (Exception | StackOverflowError e) {
                  // ignore any errors planning with parameters
                  // fall through to re-planning without them
                  m_hasExceptionWhenParameterized = true;
  
                  // note, expect real planning errors ignored here to be thrown again below
                  m_recentErrorMsg = null;
                  m_partitioning.resetAnalysisState();
              }
          }
  
          // if parameterization isn't requested or if it failed, plan here
          CompiledPlan plan = compileFromXML(m_xmlSQL, null);
          if (plan == null) {
              if (DEBUGGING_STATIC_MODE_TO_RETRY_ON_ERROR) {
                  plan = compileFromXML(m_xmlSQL, null);
              }
              throw new PlanningErrorException(m_recentErrorMsg);
          }
  
          return plan;
      }