Repository navigation
Commit 087e83f
authored
Add ANSI_QUOTES and SQL mode validation (#452)
## Summary
This PR improves SQL mode handling and adds **`ANSI_QUOTES`** and
**`ANSII`** support. This includes:
- **SQL mode storage:** SQL modes use MySQL's native bitmap and
canonical order.
- **Validation:** Named and numeric assignments are validated with
MySQL-compatible errors.
- **ANSI_QUOTES:** `ANSI_QUOTES` is supported by the driver, standalone
parser, and native lexer.
- **ANSI** Composite `ANSI` SQL mode is expanded into its component
modes.
- **Quoted identifiers:** Fixed backslash behavior in quoted
identifiers.
- **Native builds:** Lexer constants are regenerated, and the
generator's monorepo path is fixed.
## Why
The `ANSI_QUOTES` SQL mode support keeps reappearing in our recent
performance optimization and parser experiments. This PR extracts and
completes that functionality.
Additionally, the driver stored arbitrary mode names, accepted invalid
assignments, always treated double quotes as string delimiters, did not
expand did not expand composite SQL modes, and applied string escaping
to quoted identifiers. The standalone parser and native lexer lacked
equivalent quoted-identifier handling.1 parent 38a6921 commit 087e83f
13 files changed
Lines changed: 907 additions & 58 deletions
File tree
- packages
- mysql-on-sqlite
- src
- mysql
- sqlite
- tests
- mysql
- mysql-parser
- src
- tests
- php-ext-wp-mysql-parser
- src
- tools
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
2209 | 2210 | | |
2210 | 2211 | | |
2211 | 2212 | | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
2212 | 2226 | | |
2213 | 2227 | | |
2214 | 2228 | | |
| |||
2891 | 2905 | | |
2892 | 2906 | | |
2893 | 2907 | | |
2894 | | - | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
2895 | 2911 | | |
2896 | 2912 | | |
2897 | 2913 | | |
2898 | 2914 | | |
2899 | 2915 | | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
| 2922 | + | |
| 2923 | + | |
| 2924 | + | |
| 2925 | + | |
| 2926 | + | |
| 2927 | + | |
| 2928 | + | |
| 2929 | + | |
| 2930 | + | |
| 2931 | + | |
2903 | 2932 | | |
2904 | 2933 | | |
2905 | 2934 | | |
| |||
2912 | 2941 | | |
2913 | 2942 | | |
2914 | 2943 | | |
2915 | | - | |
2916 | | - | |
2917 | | - | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
2918 | 2947 | | |
2919 | 2948 | | |
2920 | 2949 | | |
| |||
2925 | 2954 | | |
2926 | 2955 | | |
2927 | 2956 | | |
2928 | | - | |
| 2957 | + | |
2929 | 2958 | | |
2930 | 2959 | | |
2931 | 2960 | | |
| |||
2948 | 2977 | | |
2949 | 2978 | | |
2950 | 2979 | | |
2951 | | - | |
| 2980 | + | |
2952 | 2981 | | |
2953 | | - | |
2954 | | - | |
2955 | | - | |
2956 | | - | |
2957 | 2982 | | |
| 2983 | + | |
2958 | 2984 | | |
2959 | 2985 | | |
2960 | 2986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
78 | 80 | | |
79 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
| |||
0 commit comments