Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
92ff5236
Commit
92ff5236
authored
Apr 10, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change ENCRYPTION_KEY_ID to be HA_TOPTION_SYSVAR
instead of manually implenting "default from a sysvar" in the code
parent
dd8f9319
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
32 deletions
+24
-32
mysql-test/suite/innodb/r/innodb-page_encryption.result
mysql-test/suite/innodb/r/innodb-page_encryption.result
+2
-2
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+11
-15
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+11
-15
No files found.
mysql-test/suite/innodb/r/innodb-page_encryption.result
View file @
92ff5236
...
...
@@ -14,7 +14,7 @@ Table Create Table
innodb_defkey CREATE TABLE `innodb_defkey` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='ON'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='ON'
`ENCRYPTION_KEY_ID`=5
show create table innodb_compact;
Table Create Table
innodb_compact CREATE TABLE `innodb_compact` (
...
...
@@ -213,7 +213,7 @@ Table Create Table
innodb_defkey CREATE TABLE `innodb_defkey` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='ON'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='ON'
`ENCRYPTION_KEY_ID`=5
update innodb_normal set c1 = c1 +1;
update innodb_compact set c1 = c1 + 1;
update innodb_compressed set c1 = c1 + 1;
...
...
storage/innobase/handler/ha_innodb.cc
View file @
92ff5236
...
...
@@ -548,6 +548,13 @@ ib_cb_t innodb_api_cb[] = {
(
ib_cb_t
)
ib_cursor_stmt_begin
};
static
MYSQL_SYSVAR_UINT
(
default_encryption_key
,
srv_default_encryption_key
,
PLUGIN_VAR_RQCMDARG
,
"Default encryption key id used for table encryption."
,
NULL
,
NULL
,
FIL_DEFAULT_ENCRYPTION_KEY
,
1
,
UINT_MAX32
,
0
);
/**
Structure for CREATE TABLE options (table options).
It needs to be called ha_table_option_struct.
...
...
@@ -569,7 +576,7 @@ ha_create_table_option innodb_table_option_list[]=
/* With this option the user can enable encryption for the table */
HA_TOPTION_ENUM
(
"ENCRYPTION"
,
encryption
,
"DEFAULT,ON,OFF"
,
0
),
/* With this option the user defines the key identifier using for the encryption */
HA_TOPTION_
NUMBER
(
"ENCRYPTION_KEY_ID"
,
encryption_key_id
,
0
,
1
,
UINT_MAX32
,
1
),
HA_TOPTION_
SYSVAR
(
"ENCRYPTION_KEY_ID"
,
encryption_key_id
,
default_encryption_key
),
HA_TOPTION_END
};
...
...
@@ -11375,11 +11382,8 @@ ha_innobase::check_table_options(
}
}
if
(
options
->
encryption_key_id
!=
0
)
{
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
/* ignore this to allow alter table without changing page_encryption_key ...*/
}
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_ON
||
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
...
...
@@ -11451,8 +11455,7 @@ ha_innobase::create(
/* Cache table options */
ha_table_option_struct
*
options
=
form
->
s
->
option_struct
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
ulint
key_id
=
(
options
->
encryption_key_id
==
0
)
?
srv_default_encryption_key
:
options
->
encryption_key_id
;
ulint
key_id
=
options
->
encryption_key_id
;
DBUG_ENTER
(
"ha_innobase::create"
);
...
...
@@ -19155,13 +19158,6 @@ static MYSQL_SYSVAR_UINT(encryption_rotation_iops, srv_n_fil_crypt_iops,
innodb_encryption_rotation_iops_update
,
srv_n_fil_crypt_iops
,
0
,
UINT_MAX32
,
0
);
static
MYSQL_SYSVAR_UINT
(
default_encryption_key
,
srv_default_encryption_key
,
PLUGIN_VAR_RQCMDARG
,
"Default encryption key id used for table encryption."
,
NULL
,
NULL
,
FIL_DEFAULT_ENCRYPTION_KEY
,
1
,
UINT_MAX32
,
0
);
static
MYSQL_SYSVAR_BOOL
(
scrub_log
,
srv_scrub_log
,
PLUGIN_VAR_OPCMDARG
|
PLUGIN_VAR_READONLY
,
"Enable background redo log (ib_logfile0, ib_logfile1...) scrubbing"
,
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
92ff5236
...
...
@@ -613,6 +613,13 @@ ib_cb_t innodb_api_cb[] = {
(
ib_cb_t
)
ib_cursor_stmt_begin
};
static
MYSQL_SYSVAR_UINT
(
default_encryption_key
,
srv_default_encryption_key
,
PLUGIN_VAR_RQCMDARG
,
"Default encryption key id used for table encryption."
,
NULL
,
NULL
,
FIL_DEFAULT_ENCRYPTION_KEY
,
1
,
UINT_MAX32
,
0
);
/**
Structure for CREATE TABLE options (table options).
It needs to be called ha_table_option_struct.
...
...
@@ -634,7 +641,7 @@ ha_create_table_option innodb_table_option_list[]=
/* With this option the user can enable encryption for the table */
HA_TOPTION_ENUM
(
"ENCRYPTION"
,
encryption
,
"DEFAULT,ON,OFF"
,
0
),
/* With this option the user defines the key identifier using for the encryption */
HA_TOPTION_
NUMBER
(
"ENCRYPTION_KEY_ID"
,
encryption_key_id
,
0
,
1
,
UINT_MAX32
,
1
),
HA_TOPTION_
SYSVAR
(
"ENCRYPTION_KEY_ID"
,
encryption_key_id
,
default_encryption_key
),
HA_TOPTION_END
};
...
...
@@ -11882,11 +11889,8 @@ ha_innobase::check_table_options(
}
}
if
(
options
->
encryption_key_id
!=
0
)
{
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
/* ignore this to allow alter table without changing page_encryption_key ...*/
}
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_ON
||
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
...
...
@@ -11959,8 +11963,7 @@ ha_innobase::create(
/* Cache table options */
ha_table_option_struct
*
options
=
form
->
s
->
option_struct
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
ulint
key_id
=
(
options
->
encryption_key_id
==
0
)
?
srv_default_encryption_key
:
options
->
encryption_key_id
;
ulint
key_id
=
options
->
encryption_key_id
;
DBUG_ENTER
(
"ha_innobase::create"
);
...
...
@@ -20338,13 +20341,6 @@ static MYSQL_SYSVAR_UINT(encryption_rotation_iops, srv_n_fil_crypt_iops,
innodb_encryption_rotation_iops_update
,
srv_n_fil_crypt_iops
,
0
,
UINT_MAX32
,
0
);
static
MYSQL_SYSVAR_UINT
(
default_encryption_key
,
srv_default_encryption_key
,
PLUGIN_VAR_RQCMDARG
,
"Default encryption key id used for table encryption."
,
NULL
,
NULL
,
FIL_DEFAULT_ENCRYPTION_KEY
,
1
,
UINT_MAX32
,
0
);
static
MYSQL_SYSVAR_BOOL
(
scrub_log
,
srv_scrub_log
,
PLUGIN_VAR_OPCMDARG
|
PLUGIN_VAR_READONLY
,
"Enable background redo log (ib_logfile0, ib_logfile1...) scrubbing"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment