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
dab6c837
Commit
dab6c837
authored
Apr 09, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow srv_encrypt_tables and ENCRYPTED=YES to be used together
parent
bc9f118e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
40 deletions
+19
-40
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+10
-20
storage/xtradb/handler/ha_innodb.cc
storage/xtradb/handler/ha_innodb.cc
+9
-20
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
dab6c837
...
@@ -11290,22 +11290,12 @@ ha_innobase::check_table_options(
...
@@ -11290,22 +11290,12 @@ ha_innobase::check_table_options(
atomic_writes_t
awrites
=
(
atomic_writes_t
)
options
->
atomic_writes
;
atomic_writes_t
awrites
=
(
atomic_writes_t
)
options
->
atomic_writes
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
)
{
if
(
encrypt
!=
FIL_SPACE_ENCRYPTION_DEFAULT
&&
!
use_tablespace
)
{
if
(
srv_encrypt_tables
)
{
push_warning
(
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
HA_WRONG_CREATE_OPTION
,
HA_WRONG_CREATE_OPTION
,
"InnoDB: ENCRYPTION not available if innodb_encrypt_tables=ON"
);
"InnoDB: ENCRYPTED requires innodb_file_per_table"
);
return
"INNODB_ENCRYPT_TABLES"
;
return
"ENCRYPTED"
;
}
if
(
!
use_tablespace
)
{
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
HA_WRONG_CREATE_OPTION
,
"InnoDB: ENCRYPTION requires"
" innodb_file_per_table."
);
return
"PAGE_ENCRYPTION"
;
}
}
}
/* Check page compression requirements */
/* Check page compression requirements */
...
@@ -11380,8 +11370,8 @@ ha_innobase::check_table_options(
...
@@ -11380,8 +11370,8 @@ ha_innobase::check_table_options(
}
}
}
}
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_ON
||
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
||
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
(
encrypt
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
push_warning_printf
(
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
...
@@ -11708,7 +11698,7 @@ ha_innobase::create(
...
@@ -11708,7 +11698,7 @@ ha_innobase::create(
/* If user has requested that table should be encrypted or table
/* If user has requested that table should be encrypted or table
should remain as unencrypted store crypt data */
should remain as unencrypted store crypt data */
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
||
encrypt
==
FIL_SPACE_ENCRYPTION_OFF
)
{
if
(
encrypt
!=
FIL_SPACE_ENCRYPTION_DEFAULT
)
{
ulint
maxsize
;
ulint
maxsize
;
ulint
zip_size
=
fil_space_get_zip_size
(
innobase_table
->
space
);
ulint
zip_size
=
fil_space_get_zip_size
(
innobase_table
->
space
);
fil_space_crypt_t
*
old_crypt_data
=
fil_space_get_crypt_data
(
innobase_table
->
space
);
fil_space_crypt_t
*
old_crypt_data
=
fil_space_get_crypt_data
(
innobase_table
->
space
);
...
...
storage/xtradb/handler/ha_innodb.cc
View file @
dab6c837
...
@@ -11796,23 +11796,12 @@ ha_innobase::check_table_options(
...
@@ -11796,23 +11796,12 @@ ha_innobase::check_table_options(
atomic_writes_t
awrites
=
(
atomic_writes_t
)
options
->
atomic_writes
;
atomic_writes_t
awrites
=
(
atomic_writes_t
)
options
->
atomic_writes
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
fil_encryption_t
encrypt
=
(
fil_encryption_t
)
options
->
encryption
;
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
)
{
if
(
encrypt
!=
FIL_SPACE_ENCRYPTION_DEFAULT
&&
!
use_tablespace
)
{
if
(
srv_encrypt_tables
)
{
push_warning
(
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
HA_WRONG_CREATE_OPTION
,
HA_WRONG_CREATE_OPTION
,
"InnoDB: ENCRYPTION not available if innodb_encrypt_tables=ON"
);
"InnoDB: ENCRYPTED requires innodb_file_per_table"
);
return
"INNODB_ENCRYPT_TABLES"
;
return
"ENCRYPTED"
;
}
if
(
!
use_tablespace
)
{
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
HA_WRONG_CREATE_OPTION
,
"InnoDB: ENCRYPTION requires"
" innodb_file_per_table."
);
return
"PAGE_ENCRYPTION"
;
}
}
}
/* Check page compression requirements */
/* Check page compression requirements */
...
@@ -11887,8 +11876,8 @@ ha_innobase::check_table_options(
...
@@ -11887,8 +11876,8 @@ ha_innobase::check_table_options(
}
}
}
}
if
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_ON
||
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
||
(
options
->
encryption
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
(
encrypt
==
FIL_SPACE_ENCRYPTION_DEFAULT
&&
srv_encrypt_tables
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
if
(
!
encryption_key_id_exists
(
options
->
encryption_key_id
))
{
push_warning_printf
(
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
...
@@ -12222,7 +12211,7 @@ ha_innobase::create(
...
@@ -12222,7 +12211,7 @@ ha_innobase::create(
/* If user has requested that table should be encrypted or table
/* If user has requested that table should be encrypted or table
should remain as unencrypted store crypt data */
should remain as unencrypted store crypt data */
if
(
encrypt
==
FIL_SPACE_ENCRYPTION_ON
||
encrypt
==
FIL_SPACE_ENCRYPTION_OFF
)
{
if
(
encrypt
!=
FIL_SPACE_ENCRYPTION_DEFAULT
)
{
ulint
maxsize
;
ulint
maxsize
;
ulint
zip_size
=
fil_space_get_zip_size
(
innobase_table
->
space
);
ulint
zip_size
=
fil_space_get_zip_size
(
innobase_table
->
space
);
fil_space_crypt_t
*
old_crypt_data
=
fil_space_get_crypt_data
(
innobase_table
->
space
);
fil_space_crypt_t
*
old_crypt_data
=
fil_space_get_crypt_data
(
innobase_table
->
space
);
...
...
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