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

GRANT inside an SP does not work well on 2nd execution

Details

    • 10.2.4-5

    Description

      I run this script:

      DROP PROCEDURE IF EXISTS sp1;
      CREATE PROCEDURE sp1()
        GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
      CALL sp1();
      

      It seems to work fine.
      However, if I call sp1() for the second time, it returns a strange warning:

      CALL sp1();
      SHOW WARNINGS;
      

      +---------+------+--------------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                              |
      +---------+------+--------------------------------------------------------------------------------------+
      | Warning | 1366 | Incorrect string value: '\xA5\xA5\xA5\xA5\xA5\xA5...' for column 'Password' at row 1 |
      +---------+------+--------------------------------------------------------------------------------------+
      

      Attachments

        Activity

          Same with prepared statements.

          MySQL 5.5-5.7 and MariaDB 5.5, 10.0 are not affected.

          elenst Elena Stepanova added a comment - Same with prepared statements. MySQL 5.5-5.7 and MariaDB 5.5, 10.0 are not affected.

          CREATE PROCEDURE sp1()
            GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass';
          CALL sp1();
          CALL sp1();
          drop user 'foo'@'%';
          drop procedure sp1;
          

          sanja Oleksandr Byelkin added a comment - CREATE PROCEDURE sp1() GRANT ALL PRIVILEGES ON *.* TO 'foo'@'%' IDENTIFIED BY 'pass'; CALL sp1(); CALL sp1(); drop user 'foo'@'%'; drop procedure sp1;

          Buffer for password hash was allocated in wrong memory.

          sanja Oleksandr Byelkin added a comment - Buffer for password hash was allocated in wrong memory.

          revision-id: b730003a34661cbd3dc2beea73130cb67cebd30c (mariadb-10.2.2-257-gb730003a346)
          parent(s): 27f20d192c118c3c8ae03d8e29759f343e46ad78
          committer: Oleksandr Byelkin
          timestamp: 2016-12-21 17:41:48 +0100
          message:

          MDEV-11584: GRANT inside an SP does not work well on 2nd execution

          Allocate password hash in statment memory

          sanja Oleksandr Byelkin added a comment - revision-id: b730003a34661cbd3dc2beea73130cb67cebd30c (mariadb-10.2.2-257-gb730003a346) parent(s): 27f20d192c118c3c8ae03d8e29759f343e46ad78 committer: Oleksandr Byelkin timestamp: 2016-12-21 17:41:48 +0100 message: MDEV-11584 : GRANT inside an SP does not work well on 2nd execution Allocate password hash in statment memory —

          10.1 version:
          revision-id: 33b01257190cef414a4b0f00bf36ee6a3ceda0a7 (mariadb-10.1.20-6-g33b01257190)
          parent(s): 9e032d6150b39cf36a22e7c1503e06fae9c4016d
          committer: Oleksandr Byelkin
          timestamp: 2016-12-21 20:11:14 +0100
          message:

          MDEV-11584: GRANT inside an SP does not work well on 2nd execution

          Allocate password hash in statment memory

          sanja Oleksandr Byelkin added a comment - 10.1 version: revision-id: 33b01257190cef414a4b0f00bf36ee6a3ceda0a7 (mariadb-10.1.20-6-g33b01257190) parent(s): 9e032d6150b39cf36a22e7c1503e06fae9c4016d committer: Oleksandr Byelkin timestamp: 2016-12-21 20:11:14 +0100 message: MDEV-11584 : GRANT inside an SP does not work well on 2nd execution Allocate password hash in statment memory —

          People

            sanja Oleksandr Byelkin
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.