Hi

xmlexpr_is_immutable(XmlExpr *xexpr)
{
    switch (xexpr->op)
    {
        case IS_XMLCONCAT:
        case IS_XMLPARSE:
        case IS_XMLPI:
        case IS_XMLROOT:
        case IS_XMLSERIALIZE:
        case IS_DOCUMENT:
            /* These variants manipulate XML text in a self-contained way */
            return true;

        case IS_XMLELEMENT:
        case IS_XMLFOREST:

            /*
             * These variants invoke I/O conversion functions for a wide
range
             * of data types, and have various special rules too, so in some
             * cases they are only stable.  In principle we could analyze
             * their behavior precisely, but keeping such code in sync with
             * the actual implementation seems like more maintenance risk
than
             * it's worth.
             */
            return false;

            /* There is intentionally no default: case here */
    }
    /* We shouldn't get here, but if we do, say "not immutable" */
    return false;
}

I don't understand why IS_XMLCONCAT is marked as immutable. In this case,
the result should depend on arguments, and arguments can be stable.

Regards

Pavel

Reply via email to