Details

    Description

      Hio,

      set global sql_safe_updates=1;
      set local sql_safe_updates=1;
      

      works properly, but adding
      sql_safe_updates=1 tigger this error

      "unknown variable 'sql_safe_updates=1'"

      Already reported years ago for MySQL 5.5 here:

      https://bugs.mysql.com/bug.php?id=66536

      Attachments

        Activity

          workarounds: init-connect (per user), init-file (globally), safe-updates in [mysql] section of my.cnf

          serg Sergei Golubchik added a comment - workarounds: init-connect (per user), init-file (globally), safe-updates in [mysql] section of my.cnf
          Richard Richard Stracke added a comment - - edited

          Both ....

          init-connect (per user)
          init-file (globally)

          not work.

          [mysqld]
           
          init_connect='SET sql_safe_updates=on'
           
          init_file='/etc/mysql/safeupdates.sql'
          

          content of '/etc/mysql/safeupdates.sql' :

          set global sql_safe_updates=on
          

          restart service

          MariaDB [(none)]> show variables like 'sql_safe%';
          +------------------+-------+
          | Variable_name    | Value |
          +------------------+-------+
          | sql_safe_updates | OFF   |
          +------------------+-------+
          1 row in set (0.00 sec)
           
          MariaDB [(none)]> show variables like 'init%';
          +---------------+----------------------------+
          | Variable_name | Value                      |
          +---------------+----------------------------+
          | init_connect  | SET sql_safe_updates=on    |
          | init_file     | /etc/mysql/safeupdates.sql |
          | init_slave    |                            |
          +---------------+----------------------------+
          3 rows in set (0.00 sec
          
          

          Richard Richard Stracke added a comment - - edited Both .... init-connect (per user) init-file (globally) not work. [mysqld]   init_connect= 'SET sql_safe_updates=on'   init_file= '/etc/mysql/safeupdates.sql' content of '/etc/mysql/safeupdates.sql' : set global sql_safe_updates= on restart service MariaDB [(none)]> show variables like 'sql_safe%' ; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | sql_safe_updates | OFF | +------------------+-------+ 1 row in set ( 0.00 sec)   MariaDB [(none)]> show variables like 'init%' ; +---------------+----------------------------+ | Variable_name | Value | +---------------+----------------------------+ | init_connect | SET sql_safe_updates=on | | init_file | /etc/mysql/safeupdates.sql | | init_slave | | +---------------+----------------------------+ 3 rows in set ( 0.00 sec

          Your init file is missing a semicolon, you should see an error in the error log if you check it.

          For init-connect, apparently you're trying as root, it's not executed for super-users.

          elenst Elena Stepanova added a comment - Your init file is missing a semicolon, you should see an error in the error log if you check it. For init-connect , apparently you're trying as root, it's not executed for super-users.
          julien.fritsch Julien Fritsch added a comment - - edited

          serg any reason for the priority change, please?

          julien.fritsch Julien Fritsch added a comment - - edited serg any reason for the priority change, please?

          Because Major is a "Major loss of function.", Minor is "Minor loss of function, or other problem where easy workaround is present.". This is the case where an easy workaround is present, right?

          Anyway, this is a very simple issue to fix, so sure, let's fix it

          serg Sergei Golubchik added a comment - Because Major is a "Major loss of function.", Minor is "Minor loss of function, or other problem where easy workaround is present.". This is the case where an easy workaround is present, right? Anyway, this is a very simple issue to fix, so sure, let's fix it

          It needs GET_BIT support from 10.3, so can only be added to 10.3. I've cherry-picked it into 10.3 and reverted from 5.5

          serg Sergei Golubchik added a comment - It needs GET_BIT support from 10.3, so can only be added to 10.3. I've cherry-picked it into 10.3 and reverted from 5.5

          People

            wlad Vladislav Vaintroub
            Richard Richard Stracke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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