Skip to content

Parse MySQL SET GLOBAL variables #1694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mvzink opened this issue Jan 31, 2025 · 2 comments · Fixed by #1757 or #1767
Closed

Parse MySQL SET GLOBAL variables #1694

mvzink opened this issue Jan 31, 2025 · 2 comments · Fixed by #1757 or #1767

Comments

@mvzink
Copy link
Contributor

mvzink commented Jan 31, 2025

In addition to SESSION and LOCAL qualifiers, MySQL allows GLOBAL for modifying system variables:

mysql> SET GLOBAL max_connections = 1000;
Query OK, 0 rows affected (0.00 sec)

sqlparser currently interprets global as a variable name and fails to parse:

$ echo -n "SET GLOBAL max_connections = 1000;" | cargo run --example cli - --mysql
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.02s
     Running `target/debug/examples/cli - --mysql`
Parsing from stdin using MySqlDialect
2025-01-31T00:44:22.858Z DEBUG [sqlparser::parser] Parsing sql 'SET GLOBAL max_connections = 1000;'...
Error during parsing: ParserError("Expected: equals sign or TO, found: max_connections at Line: 1, Column: 12")
mvzink added a commit to mvzink/datafusion-sqlparser-rs that referenced this issue Jan 31, 2025
This also stops rewriting `SESSION` away.

Closes apache#1694
@mvzink
Copy link
Contributor Author

mvzink commented Feb 4, 2025

As mentioned in #1696, this may be best accomplished in combination with #1697; possibly this issue should just be closed in favor of that one.

@mvzink
Copy link
Contributor Author

mvzink commented Mar 12, 2025

Oops, looks like #1757 marked this as closed when it should have marked #1697 as closed. I don't have permissions to reopen this; are you able to @iffyio ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants