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
faad7e0c
Commit
faad7e0c
authored
Jan 07, 2015
by
Jan Lindström
Committed by
Sergei Golubchik
Feb 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test case for combination Google encryption and page compressed tables.
parent
21430e43
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
145 additions
and
6 deletions
+145
-6
mysql-test/suite/innodb/t/innodb_encryption-page-compression.opt
...est/suite/innodb/t/innodb_encryption-page-compression.opt
+7
-0
mysql-test/suite/innodb/t/innodb_encryption-page-compression.test
...st/suite/innodb/t/innodb_encryption-page-compression.test
+120
-0
storage/innobase/buf/buf0dblwr.cc
storage/innobase/buf/buf0dblwr.cc
+3
-0
storage/innobase/fil/fil0pagecompress.cc
storage/innobase/fil/fil0pagecompress.cc
+8
-2
storage/xtradb/fil/fil0crypt.cc
storage/xtradb/fil/fil0crypt.cc
+1
-2
storage/xtradb/fil/fil0pagecompress.cc
storage/xtradb/fil/fil0pagecompress.cc
+6
-2
No files found.
mysql-test/suite/innodb/t/innodb_encryption-page-compression.opt
0 → 100644
View file @
faad7e0c
--aria-encrypt-tables=ON
--encryption-algorithm=aes_ctr
--encrypt-tmp-disk-tables=ON
--innodb-encrypt-tables=ON
--innodb-encryption-rotate-key-age=15
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
mysql-test/suite/innodb/t/innodb_encryption-page-compression.test
0 → 100644
View file @
faad7e0c
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_example_key_management_plugin
.
inc
# embedded does not support restart
--
source
include
/
not_embedded
.
inc
--
disable_query_log
let
$innodb_compression_algorithm_orig
=
`SELECT @@innodb_compression_algorithm`
;
let
$innodb_file_format_orig
=
`SELECT @@innodb_file_format`
;
let
$innodb_file_per_table_orig
=
`SELECT @@innodb_file_per_table`
;
--
enable_query_log
SET
GLOBAL
innodb_file_format
=
`Barracuda`
;
SET
GLOBAL
innodb_file_per_table
=
ON
;
# zlib
set
global
innodb_compression_algorithm
=
1
;
create
table
innodb_normal
(
c1
bigint
not
null
,
b
char
(
200
))
engine
=
innodb
page_compressed
=
1
;
create
table
innodb_compact
(
c1
bigint
not
null
,
b
char
(
200
))
engine
=
innodb
row_format
=
compact
page_compressed
=
1
;
create
table
innodb_dynamic
(
c1
bigint
not
null
,
b
char
(
200
))
engine
=
innodb
row_format
=
dynamic
page_compressed
=
1
;
show
warnings
;
show
create
table
innodb_normal
;
show
create
table
innodb_compact
;
show
create
table
innodb_dynamic
;
delimiter
//;
create
procedure
innodb_insert_proc
(
repeat_count
int
)
begin
declare
current_num
int
;
set
current_num
=
0
;
while
current_num
<
repeat_count
do
insert
into
innodb_normal
values
(
current_num
,
substring
(
MD5
(
RAND
()),
-
64
));
set
current_num
=
current_num
+
1
;
end
while
;
end
//
delimiter
;
//
commit
;
set
autocommit
=
0
;
call
innodb_insert_proc
(
5000
);
commit
;
set
autocommit
=
1
;
insert
into
innodb_compact
select
*
from
innodb_normal
;
insert
into
innodb_dynamic
select
*
from
innodb_normal
;
update
innodb_normal
set
c1
=
c1
+
1
;
update
innodb_compact
set
c1
=
c1
+
1
;
update
innodb_dynamic
set
c1
=
c1
+
1
;
select
count
(
*
)
from
innodb_normal
;
select
count
(
*
)
from
innodb_compact
where
c1
<
1500000
;
select
count
(
*
)
from
innodb_dynamic
where
c1
<
1500000
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encrypted'
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decrypted'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encryption_error'
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_compressed'
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decompressed'
;
--
source
include
/
restart_mysqld
.
inc
SET
GLOBAL
innodb_file_format
=
`Barracuda`
;
SET
GLOBAL
innodb_file_per_table
=
ON
;
# zlib
set
global
innodb_compression_algorithm
=
1
;
update
innodb_normal
set
c1
=
c1
+
1
;
update
innodb_compact
set
c1
=
c1
+
1
;
update
innodb_dynamic
set
c1
=
c1
+
1
;
select
count
(
*
)
from
innodb_normal
;
select
count
(
*
)
from
innodb_compact
where
c1
<
1500000
;
select
count
(
*
)
from
innodb_dynamic
where
c1
<
1500000
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encrypted'
;
SELECT
variable_value
>=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decrypted'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encryption_error'
;
SELECT
variable_value
>
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_compressed'
;
SELECT
variable_value
>
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decompressed'
;
alter
table
innodb_normal
engine
=
innodb
page_compressed
=
DEFAULT
;
show
create
table
innodb_normal
;
alter
table
innodb_compact
engine
=
innodb
page_compressed
=
DEFAULT
;
show
create
table
innodb_compact
;
alter
table
innodb_dynamic
engine
=
innodb
page_compressed
=
DEFAULT
;
show
create
table
innodb_dynamic
;
--
source
include
/
restart_mysqld
.
inc
SET
GLOBAL
innodb_file_format
=
`Barracuda`
;
SET
GLOBAL
innodb_file_per_table
=
ON
;
show
create
table
innodb_normal
;
show
create
table
innodb_compact
;
show
create
table
innodb_dynamic
;
update
innodb_normal
set
c1
=
c1
+
1
;
update
innodb_compact
set
c1
=
c1
+
1
;
update
innodb_dynamic
set
c1
=
c1
+
1
;
select
count
(
*
)
from
innodb_normal
;
select
count
(
*
)
from
innodb_compact
where
c1
<
1500000
;
select
count
(
*
)
from
innodb_dynamic
where
c1
<
1500000
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encrypted'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decrypted'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_encryption_error'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_compressed'
;
SELECT
variable_value
=
0
FROM
information_schema
.
global_status
WHERE
LOWER
(
variable_name
)
=
'innodb_num_pages_page_decompressed'
;
drop
procedure
innodb_insert_proc
;
drop
table
innodb_normal
;
drop
table
innodb_compact
;
drop
table
innodb_dynamic
;
# reset system
--
disable_query_log
EVAL
SET
GLOBAL
innodb_compression_algorithm
=
$innodb_compression_algorithm_orig
;
EVAL
SET
GLOBAL
innodb_file_per_table
=
$innodb_file_per_table_orig
;
EVAL
SET
GLOBAL
innodb_file_format
=
$innodb_file_format_orig
;
--
enable_query_log
storage/innobase/buf/buf0dblwr.cc
View file @
faad7e0c
...
...
@@ -843,6 +843,9 @@ buf_dblwr_write_block_to_datafile(
ut_a
(
buf_block_get_state
(
block
)
==
BUF_BLOCK_FILE_PAGE
);
buf_dblwr_check_page_lsn
(
block
->
frame
);
fprintf
(
stderr
,
"JAN: space %lu page_type %lu
\n
"
,
buf_block_get_space
(
block
),
mach_read_from_2
((
byte
*
)
frame
+
FIL_PAGE_TYPE
));
fil_io
(
flags
,
sync
,
buf_block_get_space
(
block
),
0
,
buf_block_get_page_no
(
block
),
0
,
UNIV_PAGE_SIZE
,
frame
,
(
void
*
)
block
,
(
ulint
*
)
&
bpage
->
write_size
,
bpage
->
newest_modification
);
...
...
storage/innobase/fil/fil0pagecompress.cc
View file @
faad7e0c
...
...
@@ -281,14 +281,20 @@ fil_compress_page(
/* read original page type */
orig_page_type
=
mach_read_from_2
(
buf
+
FIL_PAGE_TYPE
);
ut_ad
(
orig_page_type
!=
0
);
/* Let's not compress file space header or
extent descriptor */
if
((
orig_page_type
==
FIL_PAGE_TYPE_FSP_HDR
)
||
(
orig_page_type
==
FIL_PAGE_TYPE_XDES
)
)
{
if
(
orig_page_type
==
FIL_PAGE_TYPE_FSP_HDR
||
orig_page_type
==
FIL_PAGE_TYPE_XDES
||
orig_page_type
==
FIL_PAGE_PAGE_COMPRESSED
||
orig_page_type
==
FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
)
{
*
out_len
=
len
;
return
(
buf
);
}
fprintf
(
stderr
,
"JAN: orig_page_type %lu
\n
"
,
orig_page_type
);
level
=
compression_level
;
ut_ad
(
fil_space_is_page_compressed
(
space_id
));
...
...
storage/xtradb/fil/fil0crypt.cc
View file @
faad7e0c
...
...
@@ -670,10 +670,9 @@ fil_space_encrypt(ulint space, ulint offset, lsn_t lsn,
ibool
page_compressed
=
(
mach_read_from_2
(
src_frame
+
FIL_PAGE_TYPE
)
==
FIL_PAGE_PAGE_COMPRESSED
);
ibool
page_encrypted
=
fil_space_is_page_encrypted
(
space
);
ulint
compression_alg
=
mach_read_from_8
(
src_frame
+
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
);
ulint
orig_page_type
=
mach_read_from_2
(
src_frame
+
FIL_PAGE_TYPE
);
if
(
orig_page_type
==
FIL_PAGE_TYPE_FSP_HDR
||
orig_page_type
==
FIL_PAGE_TYPE_XDES
||
orig_page_type
==
FIL_PAGE_PAGE_ENCRYPTED
...
...
storage/xtradb/fil/fil0pagecompress.cc
View file @
faad7e0c
...
...
@@ -283,12 +283,16 @@ fil_compress_page(
/* Let's not compress file space header or
extent descriptor */
if
((
orig_page_type
==
FIL_PAGE_TYPE_FSP_HDR
)
||
(
orig_page_type
==
FIL_PAGE_TYPE_XDES
)
)
{
if
(
orig_page_type
==
FIL_PAGE_TYPE_FSP_HDR
||
orig_page_type
==
FIL_PAGE_TYPE_XDES
||
orig_page_type
==
FIL_PAGE_PAGE_COMPRESSED
||
orig_page_type
==
FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED
)
{
*
out_len
=
len
;
return
(
buf
);
}
fprintf
(
stderr
,
"JAN: orig_page_type %lu
\n
"
,
orig_page_type
);
level
=
compression_level
;
ut_ad
(
fil_space_is_page_compressed
(
space_id
));
...
...
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