Repository navigation
Commit b846015
committed
Treat backslashes literally in quoted identifiers
MySQL does not process backslash escape sequences inside quoted identifiers;
the bounding quote is escaped only by doubling it. The lexer was applying
string-literal backslash escaping to backtick identifiers (and, with the new
ANSI_QUOTES support, to double-quoted identifiers), both when scanning for the
closing quote and when unquoting the value.
As a result, an identifier like `a\nb` resolved to "a<newline>b", and `a\`
(a trailing backslash) failed to tokenize because the backslash was treated as
escaping the closing quote. Restrict backslash escaping to string literals so
identifiers preserve backslashes verbatim.
See: https://dev.mysql.com/doc/refman/8.4/en/identifiers.html1 parent 6e792cb commit b846015
4 files changed
Lines changed: 85 additions & 30 deletions
File tree
- packages
- mysql-on-sqlite
- src/mysql
- tests/mysql
- php-ext-wp-mysql-parser/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2904 | 2904 | | |
2905 | 2905 | | |
2906 | 2906 | | |
2907 | | - | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
2908 | 2910 | | |
2909 | 2911 | | |
2910 | 2912 | | |
2911 | 2913 | | |
2912 | 2914 | | |
2913 | | - | |
2914 | | - | |
2915 | | - | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
2916 | 2927 | | |
2917 | 2928 | | |
2918 | 2929 | | |
| |||
2925 | 2936 | | |
2926 | 2937 | | |
2927 | 2938 | | |
2928 | | - | |
2929 | | - | |
2930 | | - | |
| 2939 | + | |
| 2940 | + | |
| 2941 | + | |
| 2942 | + | |
2931 | 2943 | | |
2932 | 2944 | | |
2933 | 2945 | | |
| |||
2938 | 2950 | | |
2939 | 2951 | | |
2940 | 2952 | | |
2941 | | - | |
| 2953 | + | |
2942 | 2954 | | |
2943 | 2955 | | |
2944 | 2956 | | |
| |||
2961 | 2973 | | |
2962 | 2974 | | |
2963 | 2975 | | |
2964 | | - | |
| 2976 | + | |
| 2977 | + | |
2965 | 2978 | | |
2966 | | - | |
2967 | | - | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
2977 | | - | |
2978 | | - | |
2979 | 2979 | | |
| 2980 | + | |
2980 | 2981 | | |
2981 | 2982 | | |
2982 | 2983 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
480 | 526 | | |
481 | 527 | | |
482 | 528 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
784 | 784 | | |
785 | 785 | | |
786 | 786 | | |
787 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
788 | 791 | | |
789 | 792 | | |
790 | 793 | | |
791 | 794 | | |
792 | 795 | | |
793 | | - | |
| 796 | + | |
794 | 797 | | |
795 | 798 | | |
796 | 799 | | |
| |||
816 | 819 | | |
817 | 820 | | |
818 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
819 | 825 | | |
820 | | - | |
821 | | - | |
822 | 826 | | |
823 | 827 | | |
824 | 828 | | |
| |||
0 commit comments