@@ -70,7 +70,7 @@ public function test_tokenize_invalid_input(): void {
7070 * @return string[] Terminal names, in input order.
7171 */
7272 private static function token_names ( string $ sql , array $ sql_modes = array () ): array {
73- $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80400 , $ sql_modes ) )->remaining_tokens ();
73+ $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80410 , $ sql_modes ) )->remaining_tokens ();
7474 $ names = array ();
7575 foreach ( $ tokens as $ token ) {
7676 $ names [] = $ token ->get_name ();
@@ -88,28 +88,28 @@ public function test_emits_bison_terminals_with_end_markers(): void {
8888 public function test_ignore_space_preserves_function_name_ranges (): void {
8989 // Without "(", COUNT is an identifier whose range excludes trailing whitespace.
9090 $ sql = 'SELECT COUNT FROM t ' ;
91- $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80400 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
91+ $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80410 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
9292 $ this ->assertSame ( 'IDENT ' , $ tokens [1 ]->get_name (), $ sql );
9393 $ this ->assertSame ( 'COUNT ' , $ tokens [1 ]->get_value (), $ sql );
9494 $ this ->assertSame ( 5 , $ tokens [1 ]->length , $ sql );
9595 $ this ->assertSame ( 13 , $ tokens [2 ]->start , $ sql );
9696
9797 $ sql = "SELECT COUNT \t\n FROM t " ;
98- $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80400 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
98+ $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80410 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
9999 $ this ->assertSame ( 'IDENT ' , $ tokens [1 ]->get_name (), $ sql );
100100 $ this ->assertSame ( 'COUNT ' , $ tokens [1 ]->get_value (), $ sql );
101101 $ this ->assertSame ( 5 , $ tokens [1 ]->length , $ sql );
102102 $ this ->assertSame ( 15 , $ tokens [2 ]->start , $ sql );
103103
104104 // With "(", COUNT is a function whose range still excludes the whitespace.
105- $ tokens = ( new WP_MySQL_Lexer ( 'SELECT COUNT (1) ' , 80400 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
105+ $ tokens = ( new WP_MySQL_Lexer ( 'SELECT COUNT (1) ' , 80410 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
106106 $ this ->assertSame ( 5 , $ tokens [1 ]->length );
107107 $ this ->assertSame ( 'COUNT ' , $ tokens [1 ]->get_name () );
108108 $ this ->assertSame ( 'LEFT_PAREN ' , $ tokens [2 ]->get_name () );
109109 $ this ->assertSame ( 13 , $ tokens [2 ]->start );
110110
111111 $ sql = "SELECT COUNT \t\n" ;
112- $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80400 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
112+ $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80410 , array ( 'IGNORE_SPACE ' ) ) )->remaining_tokens ();
113113 $ this ->assertSame ( 'IDENT ' , $ tokens [1 ]->get_name (), $ sql );
114114 $ this ->assertSame ( 'COUNT ' , $ tokens [1 ]->get_value (), $ sql );
115115 $ this ->assertSame ( 5 , $ tokens [1 ]->length , $ sql );
@@ -749,7 +749,7 @@ public function test_ansi_quotes_changes_double_quote_tokenization(
749749 array $ sql_modes ,
750750 string $ expected_token_name
751751 ): void {
752- $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80400 , $ sql_modes ) )->remaining_tokens ();
752+ $ tokens = ( new WP_MySQL_Lexer ( $ sql , 80410 , $ sql_modes ) )->remaining_tokens ();
753753 $ this ->assertSame ( $ expected_token_name , $ tokens [0 ]->get_name (), $ sql );
754754 }
755755
@@ -782,17 +782,17 @@ public function data_national_strings(): array {
782782
783783 public function test_composite_ansi_mode_expands_to_lexer_component_modes (): void {
784784 // ANSI_QUOTES: a double-quoted sequence is a quoted identifier.
785- $ lexer = new WP_MySQL_Lexer ( '"foo" ' , 80400 , array ( 'ANSI ' ) );
785+ $ lexer = new WP_MySQL_Lexer ( '"foo" ' , 80410 , array ( 'ANSI ' ) );
786786 $ this ->assertTrue ( $ lexer ->next_token () );
787787 $ this ->assertSame ( WP_MySQL_Lexer::IDENT_QUOTED , $ lexer ->get_token ()->id );
788788
789789 // PIPES_AS_CONCAT: "||" is the string concatenation operator.
790- $ lexer = new WP_MySQL_Lexer ( '|| ' , 80400 , array ( 'ANSI ' ) );
790+ $ lexer = new WP_MySQL_Lexer ( '|| ' , 80410 , array ( 'ANSI ' ) );
791791 $ this ->assertTrue ( $ lexer ->next_token () );
792792 $ this ->assertSame ( WP_MySQL_Lexer::OR_OR_SYM , $ lexer ->get_token ()->id );
793793
794794 // IGNORE_SPACE: whitespace is permitted between a function name and "(".
795- $ lexer = new WP_MySQL_Lexer ( 'COUNT (1) ' , 80400 , array ( 'ANSI ' ) );
795+ $ lexer = new WP_MySQL_Lexer ( 'COUNT (1) ' , 80410 , array ( 'ANSI ' ) );
796796 $ this ->assertTrue ( $ lexer ->next_token () );
797797 $ this ->assertSame ( WP_MySQL_Lexer::KEYWORDS ['COUNT ' ], $ lexer ->get_token ()->id );
798798 }
@@ -808,7 +808,7 @@ public function test_quoted_identifiers_treat_backslash_literally(
808808 int $ expected_token_id ,
809809 string $ expected_value
810810 ): void {
811- $ lexer = new WP_MySQL_Lexer ( $ sql , 80400 , $ sql_modes );
811+ $ lexer = new WP_MySQL_Lexer ( $ sql , 80410 , $ sql_modes );
812812 $ this ->assertTrue ( $ lexer ->next_token () );
813813
814814 $ token = $ lexer ->get_token ();
0 commit comments