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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4d01dd79
Commit
4d01dd79
authored
Sep 28, 2017
by
Jan Lindström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12634: Uninitialised ROW_MERGE_RESERVE_SIZE bytes written to temporary file
After review cleanup.
parent
4aeec727
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
66 deletions
+34
-66
storage/innobase/log/log0crypt.cc
storage/innobase/log/log0crypt.cc
+1
-1
storage/innobase/row/row0log.cc
storage/innobase/row/row0log.cc
+13
-16
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+3
-16
storage/xtradb/log/log0crypt.cc
storage/xtradb/log/log0crypt.cc
+1
-1
storage/xtradb/row/row0log.cc
storage/xtradb/row/row0log.cc
+13
-16
storage/xtradb/row/row0merge.cc
storage/xtradb/row/row0merge.cc
+3
-16
No files found.
storage/innobase/log/log0crypt.cc
View file @
4d01dd79
...
...
@@ -246,7 +246,7 @@ log_blocks_crypt(
ENCRYPTION_FLAG_DECRYPT
@param[in] offs offset to block
@param[in] space_id tablespace id
@return true if successful
l
, false in case of failure
@return true if successful, false in case of failure
*/
static
bool
...
...
storage/innobase/row/row0log.cc
View file @
4d01dd79
...
...
@@ -182,7 +182,6 @@ struct row_log_t {
dict_table_t
*
table
;
/*!< table that is being rebuilt,
or NULL when this is a secondary
index that is being created online */
dict_index_t
*
index
;
/*!< index to be build */
bool
same_pk
;
/*!< whether the definition of the PRIMARY KEY
has remained the same */
const
dtuple_t
*
add_cols
;
...
...
@@ -385,7 +384,7 @@ row_log_online_op(
byte_offset
,
index
->
table
->
space
))
{
log
->
error
=
DB_DECRYPTION_FAILED
;
goto
err_exit
;
goto
write_failed
;
}
srv_stats
.
n_rowlog_blocks_encrypted
.
inc
();
...
...
@@ -479,13 +478,15 @@ static MY_ATTRIBUTE((nonnull))
void
row_log_table_close_func
(
/*=====================*/
row_log_t
*
log
,
/*!< in/out: online rebuild log
*/
dict_index_t
*
index
,
/*!< in/out: online rebuilt index
*/
#ifdef UNIV_DEBUG
const
byte
*
b
,
/*!< in: end of log record */
#endif
/* UNIV_DEBUG */
ulint
size
,
/*!< in: size of log record */
ulint
avail
)
/*!< in: available size for log record */
{
row_log_t
*
log
=
index
->
online_log
;
ut_ad
(
mutex_own
(
&
log
->
mutex
));
if
(
size
>=
avail
)
{
...
...
@@ -520,7 +521,7 @@ row_log_table_close_func(
srv_sort_buf_size
,
log
->
crypt_tail
,
byte_offset
,
log
->
index
->
table
->
space
))
{
index
->
table
->
space
))
{
log
->
error
=
DB_DECRYPTION_FAILED
;
goto
err_exit
;
}
...
...
@@ -559,11 +560,11 @@ row_log_table_close_func(
}
#ifdef UNIV_DEBUG
# define row_log_table_close(
log
, b, size, avail) \
row_log_table_close_func(
log
, b, size, avail)
# define row_log_table_close(
index
, b, size, avail) \
row_log_table_close_func(
index
, b, size, avail)
#else
/* UNIV_DEBUG */
# define row_log_table_close(log, b, size, avail) \
row_log_table_close_func(
log
, size, avail)
row_log_table_close_func(
index
, size, avail)
#endif
/* UNIV_DEBUG */
/******************************************************//**
...
...
@@ -735,8 +736,7 @@ row_log_table_delete(
b
+=
ext_size
;
}
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
func_exit:
...
...
@@ -859,8 +859,7 @@ row_log_table_low_redundant(
b
+
extra_size
,
index
,
tuple
->
fields
,
tuple
->
n_fields
);
b
+=
size
;
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
mem_heap_free
(
heap
);
...
...
@@ -969,8 +968,7 @@ row_log_table_low(
memcpy
(
b
,
rec
,
rec_offs_data_size
(
offsets
));
b
+=
rec_offs_data_size
(
offsets
);
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
}
...
...
@@ -2678,7 +2676,7 @@ row_log_table_apply_ops(
/* If encryption is enabled decrypt buffer after reading it
from file system. */
if
(
log_tmp_is_encrypted
())
{
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
index
->
online_log
->
crypt_head
,
...
...
@@ -2999,7 +2997,6 @@ row_log_allocate(
log
->
head
.
total
=
0
;
log
->
path
=
path
;
log
->
crypt_tail
=
log
->
crypt_head
=
NULL
;
log
->
index
=
index
;
dict_index_set_online_status
(
index
,
ONLINE_INDEX_CREATION
);
index
->
online_log
=
log
;
...
...
@@ -3548,7 +3545,7 @@ row_log_apply_ops(
/* If encryption is enabled decrypt buffer after reading it
from file system. */
if
(
log_tmp_is_encrypted
())
{
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
index
->
online_log
->
crypt_head
,
...
...
storage/innobase/row/row0merge.cc
View file @
4d01dd79
...
...
@@ -880,8 +880,8 @@ row_merge_read(
success
=
os_file_read_no_error_handling_int_fd
(
fd
,
buf
,
ofs
,
srv_sort_buf_size
);
/*
For encrypted tables, decrypt data after reading and copy data
*/
if
(
log_tmp_is_encrypted
())
{
/*
If encryption is enabled decrypt buffer
*/
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
crypt_buf
,
ofs
,
space
))
{
return
(
FALSE
);
...
...
@@ -3915,22 +3915,13 @@ row_merge_build_indexes(
DBUG_RETURN
(
DB_OUT_OF_MEMORY
);
}
/* Get crypt data from tablespace if present. We should be protected
from concurrent DDL (e.g. drop table) by MDL-locks. */
fil_space_t
*
space
=
fil_space_acquire
(
new_table
->
space
);
if
(
!
space
)
{
DBUG_RETURN
(
DB_TABLESPACE_NOT_FOUND
);
}
/* If tablespace is encrypted, allocate additional buffer for
/* If temporal log file is encrypted allocate memory for
encryption/decryption. */
if
(
log_tmp_is_encrypted
())
{
crypt_block
=
static_cast
<
row_merge_block_t
*>
(
os_mem_alloc_large
(
&
block_size
));
if
(
crypt_block
==
NULL
)
{
fil_space_release
(
space
);
DBUG_RETURN
(
DB_OUT_OF_MEMORY
);
}
}
...
...
@@ -4310,9 +4301,5 @@ row_merge_build_indexes(
}
}
if
(
space
)
{
fil_space_release
(
space
);
}
DBUG_RETURN
(
error
);
}
storage/xtradb/log/log0crypt.cc
View file @
4d01dd79
...
...
@@ -245,7 +245,7 @@ log_blocks_crypt(
ENCRYPTION_FLAG_DECRYPT
@param[in] offs offset to block
@param[in] space_id tablespace id
@return true if successful
l
, false in case of failure
@return true if successful, false in case of failure
*/
static
bool
...
...
storage/xtradb/row/row0log.cc
View file @
4d01dd79
...
...
@@ -182,7 +182,6 @@ struct row_log_t {
dict_table_t
*
table
;
/*!< table that is being rebuilt,
or NULL when this is a secondary
index that is being created online */
dict_index_t
*
index
;
/*!< index to be build */
bool
same_pk
;
/*!< whether the definition of the PRIMARY KEY
has remained the same */
const
dtuple_t
*
add_cols
;
...
...
@@ -385,7 +384,7 @@ row_log_online_op(
byte_offset
,
index
->
table
->
space
))
{
log
->
error
=
DB_DECRYPTION_FAILED
;
goto
err_exit
;
goto
write_failed
;
}
srv_stats
.
n_rowlog_blocks_encrypted
.
inc
();
...
...
@@ -479,13 +478,15 @@ static MY_ATTRIBUTE((nonnull))
void
row_log_table_close_func
(
/*=====================*/
row_log_t
*
log
,
/*!< in/out: online rebuild log
*/
dict_index_t
*
index
,
/*!< in/out: online rebuilt index
*/
#ifdef UNIV_DEBUG
const
byte
*
b
,
/*!< in: end of log record */
#endif
/* UNIV_DEBUG */
ulint
size
,
/*!< in: size of log record */
ulint
avail
)
/*!< in: available size for log record */
{
row_log_t
*
log
=
index
->
online_log
;
ut_ad
(
mutex_own
(
&
log
->
mutex
));
if
(
size
>=
avail
)
{
...
...
@@ -520,7 +521,7 @@ row_log_table_close_func(
srv_sort_buf_size
,
log
->
crypt_tail
,
byte_offset
,
log
->
index
->
table
->
space
))
{
index
->
table
->
space
))
{
log
->
error
=
DB_DECRYPTION_FAILED
;
goto
err_exit
;
}
...
...
@@ -559,11 +560,11 @@ row_log_table_close_func(
}
#ifdef UNIV_DEBUG
# define row_log_table_close(
log
, b, size, avail) \
row_log_table_close_func(
log
, b, size, avail)
# define row_log_table_close(
index
, b, size, avail) \
row_log_table_close_func(
index
, b, size, avail)
#else
/* UNIV_DEBUG */
# define row_log_table_close(log, b, size, avail) \
row_log_table_close_func(
log
, size, avail)
row_log_table_close_func(
index
, size, avail)
#endif
/* UNIV_DEBUG */
/******************************************************//**
...
...
@@ -735,8 +736,7 @@ row_log_table_delete(
b
+=
ext_size
;
}
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
func_exit:
...
...
@@ -859,8 +859,7 @@ row_log_table_low_redundant(
b
+
extra_size
,
index
,
tuple
->
fields
,
tuple
->
n_fields
);
b
+=
size
;
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
mem_heap_free
(
heap
);
...
...
@@ -969,8 +968,7 @@ row_log_table_low(
memcpy
(
b
,
rec
,
rec_offs_data_size
(
offsets
));
b
+=
rec_offs_data_size
(
offsets
);
row_log_table_close
(
index
->
online_log
,
b
,
mrec_size
,
avail_size
);
row_log_table_close
(
index
,
b
,
mrec_size
,
avail_size
);
}
}
...
...
@@ -2675,7 +2673,7 @@ row_log_table_apply_ops(
/* If encryption is enabled decrypt buffer after reading it
from file system. */
if
(
log_tmp_is_encrypted
())
{
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
index
->
online_log
->
crypt_head
,
...
...
@@ -2996,7 +2994,6 @@ row_log_allocate(
log
->
head
.
total
=
0
;
log
->
path
=
path
;
log
->
crypt_tail
=
log
->
crypt_head
=
NULL
;
log
->
index
=
index
;
dict_index_set_online_status
(
index
,
ONLINE_INDEX_CREATION
);
index
->
online_log
=
log
;
...
...
@@ -3542,7 +3539,7 @@ row_log_apply_ops(
/* If encryption is enabled decrypt buffer after reading it
from file system. */
if
(
log_tmp_is_encrypted
())
{
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
index
->
online_log
->
crypt_head
,
...
...
storage/xtradb/row/row0merge.cc
View file @
4d01dd79
...
...
@@ -887,8 +887,8 @@ row_merge_read(
success
=
os_file_read_no_error_handling_int_fd
(
fd
,
buf
,
ofs
,
srv_sort_buf_size
);
/*
For encrypted tables, decrypt data after reading and copy data
*/
if
(
log_tmp_is_encrypted
())
{
/*
If encryption is enabled decrypt buffer
*/
if
(
success
&&
log_tmp_is_encrypted
())
{
if
(
!
log_tmp_block_decrypt
(
buf
,
srv_sort_buf_size
,
crypt_buf
,
ofs
,
space
))
{
return
(
FALSE
);
...
...
@@ -3918,22 +3918,13 @@ row_merge_build_indexes(
DBUG_RETURN
(
DB_OUT_OF_MEMORY
);
}
/* Get crypt data from tablespace if present. We should be protected
from concurrent DDL (e.g. drop table) by MDL-locks. */
fil_space_t
*
space
=
fil_space_acquire
(
new_table
->
space
);
if
(
!
space
)
{
DBUG_RETURN
(
DB_TABLESPACE_NOT_FOUND
);
}
/* If temporal log file is encrypted allocate memory for
/* If temporary log file is encrypted allocate memory for
encryption/decryption. */
if
(
log_tmp_is_encrypted
())
{
crypt_block
=
static_cast
<
row_merge_block_t
*>
(
os_mem_alloc_large
(
&
block_size
));
if
(
crypt_block
==
NULL
)
{
fil_space_release
(
space
);
DBUG_RETURN
(
DB_OUT_OF_MEMORY
);
}
}
...
...
@@ -4313,9 +4304,5 @@ row_merge_build_indexes(
}
}
if
(
space
)
{
fil_space_release
(
space
);
}
DBUG_RETURN
(
error
);
}
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