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

Reconsider ER_INCORRECT_GLOBAL_LOCAL_VAR

    XMLWordPrintable

Details

    • New Feature
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • Variables
    • None

    Description

      Having three error codes for "wrong scope for variable" seems extraneous; it's also not future-proof.

      • ER_GLOBAL_VARIABLE
      • ER_LOCAL_VARIABLE
      • ER_INCORRECT_GLOBAL_LOCAL_VAR

      The difference between the errors for SELECT @@... and SET @@...-... can look inconsistent to users who expect the @@variable syntax to be "universal":

      SELECT @@SESSION.connect_timeout;
      --> ER_INCORRECT_GLOBAL_LOCAL_VAR: Variable 'connect_timeout' is a GLOBAL variable
      SET @@SESSION.connect_timeout= 12;
      --> ER_GLOBAL_VARIABLE: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
       
      SELECT @@GLOBAL.default_master_connection;
      --> ER_INCORRECT_GLOBAL_LOCAL_VAR: Variable 'default_master_connection' is a SESSION variable
      SET @@GLOBAL.default_master_connection= '';
      --> ER_LOCAL_VARIABLE: Variable 'default_master_connection' is a SESSION variable and can't be used with SET GLOBAL
      

      Attachments

        Activity

          People

            ParadoxV5 Jimmy Hú
            ParadoxV5 Jimmy Hú
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.