You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 69340fe
Browse filesBrowse the repository at this point in the historyBrowse files
## Summary
This PR fixes lexer edge cases and related string handling:
- **String values:** Preserve binary and single-byte charset payloads
and correctly decode escaped newlines.
- **Function names:** Exclude trailing whitespace from function-name
token ranges under `IGNORE_SPACE`.
- **Version comments:** Support six-digit versions from MySQL 8.1,
preserve five-digit fallback parsing and unversioned numeric content,
and recognize vertical tabs as whitespace.
- **WordPress validation:** Mirror the parent `wpdb::query()` charset
checks, retaining its binary-data and prevalidated-query exemptions.
- **`LIKE BINARY` patterns:** Preserve raw bytes instead of producing
`NULL` during GLOB conversion, and handle escaped newlines.
The lexer fixes cover both PHP packages and the native extension.
## Why
The token decoder's UTF-8 regex modifier caused an accidental
`TypeError` for legitimate binary data as well as malformed text.
Decoding must preserve bytes; charset enforcement needs column types and
SQL mode. Mirroring WordPress's checks restores its expected validation
behavior.
Regression tests cover decoding, token ranges, version comments, and
pattern conversion. CI expectations remove the `test_strip_invalid_text`
cases fixed by decoding and the two invalid-query tests fixed by
WordPress validation.
## Remaining limitations
- Direct MySQL-on-SQLite writes can still accept invalid text under
strict mode; full charset enforcement remains driver work. WordPress's
checks retain their exemptions, including tables containing binary
columns.
- SQLite GLOB can still treat distinct invalid UTF-8 sequences as equal.
The `LIKE BINARY` fix preserves pattern bytes but does not provide fully
byte-correct matching.
- Legacy multibyte charsets such as Big5 and GBK remain unsupported by
the decoder.
0 commit comments