classCoalescing
final class Coalescing
The NULL rule of the expressions that return NULL only when every operand is NULL.
Rule: PG-COALESCING-NULL-001. COALESCE returns its first operand that is not NULL; GREATEST and LEAST ignore NULL operands and return NULL only when all operands are NULL; XMLCONCAT and XMLFOREST omit NULL values in the same way. The result is not NULL when an operand is known not NULL, NULL-able when every operand is, and otherwise depends on the operands. Source: https://www.postgresql.org/docs/17/functions-conditional.html, https://www.postgresql.org/docs/17/functions-xml.html. Termination: one pass. Status: Implemented.
Methods§
public function nullability(list<ScalarFact> $operands): NullabilityAnswers the NULL fact of the result from the facts of the operands.
Parameters
$operands | list<ScalarFact> |
Returns
Test cases 1
Called from 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\Coalesce::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/Coalesce.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\MinMax::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/MinMax.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlConcat::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlConcat.php:67
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlForest::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlForest.php:71
Calls 3
- class-const Nullability::NotNull() line 35
- class-const Nullability::Dependent() line 38
- class-const Nullability::Nullable() line 41
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\Coalesce::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/Coalesce.php:71
- new SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\MinMax::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/MinMax.php:71
- new SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlConcat::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlConcat.php:67
- new SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlForest::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlForest.php:71
Method calls 4
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\Coalesce::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/Coalesce.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Conditional\MinMax::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Conditional/MinMax.php:71
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlConcat::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlConcat.php:67
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Xml\XmlForest::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Xml/XmlForest.php:71