classCountMismatch
final class CountMismatch
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.Two lists whose lengths MySQL requires to agree, with the lengths written.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT 1 UNION SELECT 1, 2') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: The used SELECT statements have a different number of columns (1 and 2).Properties§
public CountedList $listpublic int $expectedpublic int $actualMethods§
public function __construct(public CountedList $list, public int $expected, public int $actual)Parameters
$list | CountedList | The lists that disagree |
$expected | int | The length the first list fixes |
$actual | int | The length of the list that disagrees |
public function message(): stringDescribes the disagreement in the words of the server.
Returns
stringTest cases 1
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 5
IntoVariablesTest::testADifferentNumberOfColumnsIsReportedcallsQueryStatementTest::testDeriveQueryDerivesTheTargetsAndReportsTheirCountcallsSetOperationTest::testDeriveQueryReportsOperandsOfDifferentLengthscallsValuesQueryTest::testDeriveQueryReportsRowsOfDifferentLengthscallsCommonTableExpressionTest::testAColumnListOfAnotherLengthIsReportedcalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\MySql\Rules\Query\DerivedShapes::shape() packages/sql-semantics-mysql/src/Rules/Query/DerivedShapes.php:58
- new SqlSemantics\Platform\MySql\Rules\Query\ResultSlots::combine() packages/sql-semantics-mysql/src/Rules/Query/ResultSlots.php:57
- new SqlSemantics\Platform\MySql\Rules\Query\ResultSlots::values() packages/sql-semantics-mysql/src/Rules/Query/ResultSlots.php:106
- new SqlSemantics\Platform\MySql\Rules\Query\TailFacts::derive() packages/sql-semantics-mysql/src/Rules/Query/TailFacts.php:50
- new SqlSemantics\Platform\MySql\Statement\Dml\Insert\RowAlias::deriveRelation() packages/sql-semantics-mysql/src/Statement/Dml/Insert/RowAlias.php:81