Splits fragment at its top-level ANDs: those outside parentheses and outside CASE … END, other
than the AND of a BETWEEN. Where the lexer reads [ and ] as operators (PostgreSQL), an AND or
OR between them outside parentheses is part of a bracket name, not a top-level one. Returns the
terms as written, or null when the fragment has a top-level OR, because putting each term in
its own parentheses would then change its meaning. A fragment with no top-level AND comes back as
its only term.
Splits
fragmentat its top-level ANDs: those outside parentheses and outside CASE … END, other than the AND of a BETWEEN. Where the lexer reads[and]as operators (PostgreSQL), an AND or OR between them outside parentheses is part of a bracket name, not a top-level one. Returns the terms as written, ornullwhen the fragment has a top-level OR, because putting each term in its own parentheses would then change its meaning. A fragment with no top-level AND comes back as its only term.