Skip to content

Parse MySQL SET GLOBAL variables #1694

Description

@mvzink

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")

Activity

  1. added a commit that references this issue on Jan 31, 2025
    c0b5b20
  2. mvzink commented on Feb 4, 2025

    @mvzink
    ContributorAuthor

    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.

  3. mvzink commented on Mar 12, 2025

    @mvzink
    ContributorAuthor

    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 ?

  4. reopened this on Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions