Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-3962

add clear status if tablespace is encrypted or not

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.7, Not 5.5, Not 5.6
    • Fix Version/s: None
    • Component/s: None

      Description

      First of all thanks to Robert Golebiowski and Sergei Glushchenko for taking time to investigate this.

      If we have a general tablespace which is encrypted but doesn't include tables yet it seems it's hard for user to get info if it's encrypted or not and should it eventually include encrypted tables or not. For single tablespaces it's easier since you can check table info.

      After investigation Sergei found that FLAG field in INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES has bit number 13 set if tablespace is encrypted.
      Here's copy-paste from Sergei:

      I_S.INNODB_SYS_TABLESPACES has a "flag" field. Encrypted tablespace has bit 13 set. You can check it with "flag & 8192". And seems like MySQL is capable of bitwise operations. https://dev.mysql.com/doc/refman/5.7/en/bit-functions.html
      

      And so it seems to work:

      5.7.21>select SPACE, NAME, FLAG, FLAG & 8192 from INNODB_SYS_TABLESPACES where NAME in ('foo', 'test/t2', 'bar', 'noencrypt');
      +-------+-----------+-------+-------------+
      | SPACE | NAME      | FLAG  | FLAG & 8192 |
      +-------+-----------+-------+-------------+
      |    29 | foo       | 10240 |        8192 |
      |    30 | test/t2   |  8225 |        8192 |
      |    31 | bar       | 10240 |        8192 |
      |    32 | noencrypt |  2048 |           0 |
      +-------+-----------+-------+-------------+
      4 rows in set (0.01 sec)
      

      It would be good to extract this info somewhere so that users and tools can see it easier.

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                robert.golebiowski Robert Golebiowski
                Reporter:
                tomislav.plavcic@percona.com Tomislav Plavcic
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 23 minutes
                  23m