Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7755

new syntax: SET variable = value FOR account

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      It would be great if we could have this syntax:

      SET variable = value FOR account

      The variable should be set immediately when specified user connects.

      This would allow us to configure an application's settings without affecting the global behavior. This is useful for closed source applications, and for applications we'd prefer not to touch (for example because we want to be able to upgrade the open source application with a trivial apt-get, or because the maintainer of the application is unreliable).

      Of course we'd also need a way to configure this in my.cnf, and a syntax to ask the server the default variables for a given user.

      I hope this is possible.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Until this is implemented, you can emulate this, I think, with, a stored procedure and --init-connect:

            CREATE PROCEDURE autoexec ()
            BEGIN
              IF USER() = 'foo@bar' THEN
                SET variable = value;
               ...
             END IF
            END
            

            and

            --init-connect='call autoexec()'
            
            Show
            serg Sergei Golubchik added a comment - Until this is implemented, you can emulate this, I think, with, a stored procedure and --init-connect : CREATE PROCEDURE autoexec () BEGIN IF USER() = 'foo@bar' THEN SET variable = value; ... END IF END and --init-connect='call autoexec()'

              People

              • Assignee:
                Unassigned
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: