MySQL/MariaDB: the statement splitter and the lexer disagree with the server

Open
#472 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
mariadb, mysql, rust, sql
Domain
cli, databases

Research direction

Start by reading issue #353, which is expected to establish the per-engine lexer seam; the issue names no files or tests. Then check how MySQL and MariaDB parse the three example statements, including whether MySQL supports nested comments, and add a failing test and live-server check for each case. Done when the engine-specific lexer matches server behavior in all three cases.

Written by the indexing model from the issue text.

Description

bug
Need

On MySQL and MariaDB the statement splitter and the lexer read some text differently from the server. All three cases found so far refuse or fail more than they need to; none runs anything the user did not see:

  • A ; inside an executable comment (SELECT 1 /*!50000 ; SELECT 2 */; SELECT 3) splits the statement there.
  • A nested comment (SELECT 1 /* a /* b */ ; */) leaves a stray */ statement on MySQL (to check first whether MySQL itself reads nested comments).
  • In MySQL's default mode a backslash escapes a quote, but 'a\'; DROP TABLE t; -- ' is classified as a DROP.
Plan

One fix per case, each with a test that fails today and a check against a live server, in the engine-specific lexer once the per-engine seam (#353) gives it a home.

Dominant language
Rust
Stars
166
Forks
8
Avg merge
4h 24m
Merged PRs (30d)
291

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DokaDev/datarig

All issues in DokaDev/datarig

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.