final class WeightStringParameters
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

The internal form WEIGHT_STRING(string, length, weights, flags) the server writes into view definitions.

Rule: MYSQL-WEIGHT-STRING-002. The three numbers are the result length, the number of weights and the flags of Item_func_weight_string. The result is a binary string; it is NULL when the argument is NULL. Terminates: the operand is a strict part. Source: https://github.com/mysql/mysql-server/blob/8.4/sql/item_strfunc.cc (Item_func_weight_string::print). Status: Implemented.

Typing the internal formdoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT WEIGHT_STRING('ab', 0, 4, 64)");
    $query->field(0)->type->descriptor->name() // => 'VARBINARY'

Properties§

public Scalar $subject
public Numeral $length
public Numeral $weights
public Numeral $flags

Methods§

public function __construct(
    public Scalar $subject,
    public Numeral $length,
    public Numeral $weights,
    public Numeral $flags,
)

Parameters

$subjectScalarThe string
$lengthNumeralThe result length
$weightsNumeralThe number of weights
$flagsNumeralThe flags
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand; the result is a binary string.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 4
public function render(Output $out): void

Writes the call.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 3§

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 1

Relations§

Instantiated in 1