Skip to content

Support MySQL SET PERSIST/PERSIST_ONLY/LOCAL and dotted user variables #52

Description

@renecannao

ProxySQL PR #5893 surfaced ParserSQL SET grammar gaps while porting obsolete ProxySQL PR #5088 TAP coverage.

ParserSQL currently does not fully parse these MySQL SET forms through the SET AST:

SET persist character_set_server = 'utf8mb4';
SET persist_only innodb_buffer_pool_size = '1G';
SET PERSIST max_allowed_packet = 1073741824;
SET @@PERSIST.max_allowed_packet = 1073741824;
SET PERSIST_ONLY sql_mode = 'STRICT_TRANS_TABLES';
SET @@PERSIST_ONLY.sql_mode = 'STRICT_TRANS_TABLES';
SET LOCAL wait_timeout = 10;
SET LOCAL sql_mode := CONCAT(@@sql_mode, ',STRICT_TRANS_TABLES');
SET @'mix' := 1, LOCAL wait_timeout := 20;
SET @user.var := 7;

Expected behavior:

  • Treat MySQL LOCAL, PERSIST, and PERSIST_ONLY as SET assignment scopes where valid.
  • Handle comma-separated assignments that begin with those scope tokens.
  • Normalize @@persist.var / @@persist_only.var as scoped system variables.
  • Parse dotted single-at user variables like @user.var as a single variable target.

ProxySQL should consume this via a normal ParserSQL update, not a vendored local patch.

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