[MDEV-9571] Encrypted table does not show encrypted="yes" in definition Created: 2016-02-17 Updated: 2016-02-17 Resolved: 2016-02-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Encryption |
| Affects Version/s: | 10.1.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Valerie Parham-Thompson | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos7 |
||
| Description |
|
Using the data encryption at rest feature, when I create a table explicitly via an alter statement, the show create table statement will show "`encrypted`='yes' `encryption_key_id`=1" in the definition. For example:
However, if I implicitly create an encrypted table using the default config, "`encrypted`='yes' `encryption_key_id`=1" does not show in this output. my.cnf contents:
Create a table with this global/default encryption in place:
Table appears to be encrypted when I view it via xxd:
But I can't tell that from within mysql:
or
|
| Comments |
| Comment by Elena Stepanova [ 2016-02-17 ] | |
|
Somehow, there is no unified behavior regarding showing implicit options in SHOW CREATE TABLE. More often than not engine-specific implicit options are not shown, but there are exceptions, e.g. PAGE_CHECKSUM for Aria). Regarding encryption specifically, I think the whole point of implicit encryption is that it's not ingrained upon table creation, but can change depending on the server variables, and the table can be decrypted/encrypted on the fly. If the option appeared in SHOW CREATE TABLE, it would have been even more confusing, and generally unreliable. My guesses might be wrong though, I'll assign this to jplindst to confirm it works as expected. | |
| Comment by Valerie Parham-Thompson [ 2016-02-17 ] | |
|
Thanks, Elena. I look forward to learning more about how it works. I did find a way to tell if a table is encrypted, I believe, with this query:
| |
| Comment by Sergei Golubchik [ 2016-02-17 ] | |
|
If SHOW CREATE TABLE does not show the option, it means the option has the default value. In this case it means that if encryption is globally enabled — the table will be encrypted, if encryption is globally disabled — the table will be not encrypted. Think of it that way — SHOW CREATE TABLE does not shows what properties the table has now, it shows what CREATE TABLE statement one should use to create a new table with exactly the same behavior as the original table. And to create a table that is encrypted when the encryption is globally enabled, and not encrypted when the encryption is globally disabled — such a table should not have ENCRYPTION=YES, that's why SHOW CREATE TABLE does not show it. | |
| Comment by Valerie Parham-Thompson [ 2016-02-17 ] | |
|
OK, thank you for the explanation, Sergei. |