classArityMismatch
final class ArityMismatch
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.Two column counts that PostgreSQL requires to agree differ.
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 UNION SELECT 1, 2') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: each UNION query must have the same number of columnsnew \SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\ArityMismatch(\SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\ArityRule::ValuesRows, 'VALUES', 2, 2) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionProperties§
public ArityRule $rulepublic string $subjectpublic int $availablepublic int $specifiedMethods§
public function __construct(
public ArityRule $rule,
public string $subject,
public int $available,
public int $specified,
)Parameters
$rule | ArityRule | The rule that requires the counts to agree |
$subject | string | The operator or relation name the message names |
$available | int | The count the first part has |
$specified | int | The count the other part has |
Calls 1
- static-call Check::input() line 32
public function message(): stringDescribes the problem in the words of PostgreSQL.
Returns
stringCalls 1
- function-call
sprintfline 40
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ArityMismatchTestcalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\PostgreSql\Rules\Manipulation\InsertFacts::rows() packages/sql-semantics-postgres/src/Rules/Manipulation/InsertFacts.php:66
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:180
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SetOperationFacts::combined() packages/sql-semantics-postgres/src/Rules/Query/Facts/SetOperationFacts.php:72
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\ValuesFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/ValuesFacts.php:45
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\ColumnAliases::apply() packages/sql-semantics-postgres/src/Rules/Resolution/ColumnAliases.php:44