classTuple
final class Tuple
implements TypeDescriptor
uses Snapshot
Public API: explicitly declared with
@visibility public.The type of a row of several values: a row constructor or a subquery of several columns (ROW_RESULT).
Only the number of columns is part of the type: comparisons, IN and row subqueries require rows of equal width. Source: https://dev.mysql.com/doc/refman/8.4/en/row-subqueries.html.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE (a, b) IS NULL') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: Operand should contain 1 column(s), not 2.Properties§
public int $widthMethods§
public function __construct(public int $width)Parameters
$width | int | The number of columns; at least two |
Calls 1
- static-call Check::input() line 31
public function name(): stringNames the type as the server's result type.
Returns
stringTest cases 1
Test cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 7
OperandsTest::testComparableReportsTheFirstDifferentWidthcallsOperandsTest::testSingleAnswersAValueWithoutTypeForARowAndTheFactOtherwisecallsOperandsTest::testSingleReportsARowcallsOperandsTest::testWidthCountsTheColumnsOfAKnownValuecallsSubqueryRowsTest::testValueIsTheOneColumnOrARowcallsRowTest::testDeriveScalarIsARowOfTheWidthcallsScalarSubqueryTest::testDeriveScalarIsARowForSeveralColumnscalls
Relations§
Instantiated in 2
Type checks 3
- instanceof SqlSemantics\Platform\MySql\Rules\Call\TypeClasses::classes() packages/sql-semantics-mysql/src/Rules/Call/TypeClasses.php:40
- instanceof SqlSemantics\Platform\MySql\Rules\Expression\Operands::width() packages/sql-semantics-mysql/src/Rules/Expression/Operands.php:49
- instanceof SqlSemantics\Platform\MySql\Rules\Expression\TypeAggregation::merge() packages/sql-semantics-mysql/src/Rules/Expression/TypeAggregation.php:114