File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6049,4 +6049,10 @@ public function testSelectColumnNames(): void {
60496049 $ result = $ this ->assertQuery ( "SELECT CONCAT('a', 'b') AS alias_concat " );
60506050 $ this ->assertSame ( array ( 'alias_concat ' ), array_keys ( (array ) $ result [0 ] ) );
60516051 }
6052+
6053+ public function testSetStatement (): void {
6054+ $ this ->assertQuery ( 'SET NAMES utf8mb4 ' );
6055+ $ this ->assertQuery ( 'SET CHARSET utf8mb4 ' );
6056+ $ this ->assertQuery ( 'SET CHARACTER SET utf8mb4 ' );
6057+ }
60526058}
Original file line number Diff line number Diff line change @@ -2089,6 +2089,20 @@ private function execute_set_statement( WP_Parser_Node $node ): void {
20892089 }
20902090
20912091 if (
2092+ $ part instanceof WP_MySQL_Token
2093+ && WP_MySQL_Lexer::NAMES_SYMBOL === $ part ->id
2094+ ) {
2095+ // "SET NAMES ..." is a no-op for now.
2096+ // TODO: Validate charset compatibility with UTF-8.
2097+ // See: https://github.com/WordPress/sqlite-database-integration/issues/192
2098+ } elseif (
2099+ $ part instanceof WP_Parser_Node
2100+ && 'charsetClause ' === $ part ->rule_name
2101+ ) {
2102+ // "SET CHARACTER SET ..." is a no-op for now.
2103+ // TODO: Validate charset compatibility with UTF-8.
2104+ // See: https://github.com/WordPress/sqlite-database-integration/issues/192
2105+ } elseif (
20922106 $ part instanceof WP_Parser_Node
20932107 && (
20942108 'internalVariableName ' === $ part ->rule_name
You can’t perform that action at this time.
0 commit comments