classNameConversion
final class NameConversion
implements MissingInput
uses Snapshot
@visibility public.The conversion MySQL applies to the text of an introduced string from the character set of its introducer to the system character set.
Rule: MYSQL-SELECT-ITEM-NAME-001. The server names an unaliased string literal after its value converted from the character set of the literal to the system character set (utf8mb3), keeping at most 255 bytes of whole characters. For an introducer whose characters are not ASCII bytes (ucs2, utf16, utf16le, utf32), and for text with bytes outside ASCII in a character set other than binary, utf8mb3 and utf8mb4, the name depends on the server's conversion table of that character set, which the profile does not carry. A text read in the client character set depends on the session state character_set_client instead. Source: sql/item.cc (Name_string::copy) and sql/thr_malloc.cc (sql_strmake_with_convert) of each release, https://dev.mysql.com/doc/refman/8.4/en/charset-introducer.html. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT x FROM (SELECT _latin2'é') AS d", []);
$query->field('x')->type->missing[0]->describe() // => 'the conversion MySQL applies to text in the character set latin2 when it names a column after it'Properties§
public string $charsetMethods§
public function __construct(public string $charset)Parameters
$charset | string | The character set of the introducer, as written in lower case |
public function describe(): stringDescribes the missing input.
Returns
stringTest cases 1
Test cases 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::stored() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:215
- new SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::stored() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:226
- new SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::narrowed() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:240