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
b3009059
Commit
b3009059
authored
Oct 29, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup
parent
14be8143
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
60 additions
and
98 deletions
+60
-98
storage/innobase/buf/buf0dblwr.cc
storage/innobase/buf/buf0dblwr.cc
+1
-1
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+0
-43
storage/innobase/fsp/fsp0fsp.cc
storage/innobase/fsp/fsp0fsp.cc
+16
-0
storage/innobase/include/buf0buf.h
storage/innobase/include/buf0buf.h
+5
-15
storage/innobase/include/fil0fil.h
storage/innobase/include/fil0fil.h
+0
-39
storage/innobase/include/fsp0fsp.h
storage/innobase/include/fsp0fsp.h
+38
-0
No files found.
storage/innobase/buf/buf0dblwr.cc
View file @
b3009059
...
...
@@ -858,7 +858,7 @@ buf_dblwr_check_block(
but just happens to have wrongly set FIL_PAGE_TYPE,
such pages should never be modified to without also
adjusting the page type during page allocation or
buf_flush_init_for_writing() or fil_
page
_reset_type(). */
buf_flush_init_for_writing() or fil_
block
_reset_type(). */
break
;
case
FIL_PAGE_TYPE_FSP_HDR
:
case
FIL_PAGE_IBUF_BITMAP
:
...
...
storage/innobase/fil/fil0fil.cc
View file @
b3009059
...
...
@@ -5564,27 +5564,6 @@ fil_page_set_type(
mach_write_to_2
(
page
+
FIL_PAGE_TYPE
,
type
);
}
/** Reset the page type.
Data files created before MySQL 5.1 may contain garbage in FIL_PAGE_TYPE.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] page_id page number
@param[in,out] page page with invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
void
fil_page_reset_type
(
const
page_id_t
page_id
,
byte
*
page
,
ulint
type
,
mtr_t
*
mtr
)
{
ib
::
info
()
<<
"Resetting invalid page "
<<
page_id
<<
" type "
<<
fil_page_get_type
(
page
)
<<
" to "
<<
type
<<
"."
;
mlog_write_ulint
(
page
+
FIL_PAGE_TYPE
,
type
,
MLOG_2BYTES
,
mtr
);
}
/****************************************************************//**
Closes the tablespace memory cache. */
void
...
...
@@ -6311,25 +6290,3 @@ fil_space_set_punch_hole(
{
node
->
space
->
punch_hole
=
val
;
}
/** Check (and if needed, reset) the page type.
Data files created before MySQL 5.1 may contain
garbage in the FIL_PAGE_TYPE field.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] page_id page number
@param[in,out] page page with possibly invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
void
fil_block_check_type
(
const
buf_block_t
&
block
,
ulint
type
,
mtr_t
*
mtr
)
{
ulint
page_type
=
fil_page_get_type
(
block
.
frame
);
if
(
page_type
!=
type
)
{
fil_page_reset_type
(
block
.
page
.
id
,
block
.
frame
,
type
,
mtr
);
}
}
storage/innobase/fsp/fsp0fsp.cc
View file @
b3009059
...
...
@@ -1062,6 +1062,22 @@ fsp_get_pages_to_extend_ibd(
return
(
size_increase
);
}
/** Reset the page type.
Data files created before MySQL 5.1.48 may contain garbage in FIL_PAGE_TYPE.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] block block with invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
ATTRIBUTE_COLD
void
fil_block_reset_type
(
const
buf_block_t
&
block
,
ulint
type
,
mtr_t
*
mtr
)
{
ib
::
info
()
<<
"Resetting invalid page "
<<
block
.
page
.
id
<<
" type "
<<
fil_page_get_type
(
block
.
frame
)
<<
" to "
<<
type
<<
"."
;
mlog_write_ulint
(
block
.
frame
+
FIL_PAGE_TYPE
,
type
,
MLOG_2BYTES
,
mtr
);
}
/** Put new extents to the free list if there are free extents above the free
limit. If an extent happens to contain an extent descriptor page, the extent
is put to the FSP_FREE_FRAG list with the page marked as used.
...
...
storage/innobase/include/buf0buf.h
View file @
b3009059
...
...
@@ -223,8 +223,7 @@ class page_id_t {
@param[in] space tablespace id
@param[in] page_no page number */
page_id_t
(
ulint
space
,
ulint
page_no
)
:
m_space
(
static_cast
<
uint32_t
>
(
space
)),
m_page_no
(
static_cast
<
uint32_t
>
(
page_no
))
:
m_space
(
uint32_t
(
space
)),
m_page_no
(
uint32
(
page_no
))
{
ut_ad
(
space
<=
0xFFFFFFFFU
);
ut_ad
(
page_no
<=
0xFFFFFFFFU
);
...
...
@@ -238,30 +237,21 @@ class page_id_t {
/** Retrieve the tablespace id.
@return tablespace id */
inline
uint32_t
space
()
const
{
return
(
m_space
);
}
uint32_t
space
()
const
{
return
m_space
;
}
/** Retrieve the page number.
@return page number */
inline
uint32_t
page_no
()
const
{
return
(
m_page_no
);
}
uint32_t
page_no
()
const
{
return
m_page_no
;
}
/** Retrieve the fold value.
@return fold value */
inline
ulint
fold
()
const
{
return
(
m_space
<<
20
)
+
m_space
+
m_page_no
;
}
ulint
fold
()
const
{
return
(
m_space
<<
20
)
+
m_space
+
m_page_no
;
}
/** Reset the page number only.
@param[in] page_no page number */
inline
void
set_page_no
(
ulint
page_no
)
{
m_page_no
=
static_cast
<
uint32_t
>
(
page_no
);
m_page_no
=
uint32_t
(
page_no
);
ut_ad
(
page_no
<=
0xFFFFFFFFU
);
}
...
...
storage/innobase/include/fil0fil.h
View file @
b3009059
...
...
@@ -1315,45 +1315,6 @@ fil_page_set_type(
/*==============*/
byte
*
page
,
/*!< in/out: file page */
ulint
type
);
/*!< in: type */
/** Reset the page type.
Data files created before MySQL 5.1 may contain garbage in FIL_PAGE_TYPE.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] page_id page number
@param[in,out] page page with invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
void
fil_page_reset_type
(
const
page_id_t
page_id
,
byte
*
page
,
ulint
type
,
mtr_t
*
mtr
);
/** Get the file page type.
@param[in] page file page
@return page type */
inline
uint16_t
fil_page_get_type
(
const
byte
*
page
)
{
return
(
mach_read_from_2
(
page
+
FIL_PAGE_TYPE
));
}
/** Check (and if needed, reset) the page type.
Data files created before MySQL 5.1 may contain
garbage in the FIL_PAGE_TYPE field.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] page_id page number
@param[in,out] page page with possibly invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
void
fil_block_check_type
(
const
buf_block_t
&
block
,
ulint
type
,
mtr_t
*
mtr
);
#ifdef UNIV_DEBUG
/** Increase redo skipped of a tablespace.
...
...
storage/innobase/include/fsp0fsp.h
View file @
b3009059
...
...
@@ -640,6 +640,44 @@ fseg_free_step_not_header_func(
fseg_free_step_not_header_func(header, mtr)
#endif
/* BTR_CUR_HASH_ADAPT */
/** Reset the page type.
Data files created before MySQL 5.1.48 may contain garbage in FIL_PAGE_TYPE.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] block block with invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
ATTRIBUTE_COLD
void
fil_block_reset_type
(
const
buf_block_t
&
block
,
ulint
type
,
mtr_t
*
mtr
);
/** Get the file page type.
@param[in] page file page
@return page type */
inline
uint16_t
fil_page_get_type
(
const
byte
*
page
)
{
return
mach_read_from_2
(
page
+
FIL_PAGE_TYPE
);
}
/** Check (and if needed, reset) the page type.
Data files created before MySQL 5.1.48 may contain
garbage in the FIL_PAGE_TYPE field.
In MySQL 3.23.53, only undo log pages and index pages were tagged.
Any other pages were written with uninitialized bytes in FIL_PAGE_TYPE.
@param[in] page_id page number
@param[in,out] page page with possibly invalid FIL_PAGE_TYPE
@param[in] type expected page type
@param[in,out] mtr mini-transaction */
inline
void
fil_block_check_type
(
const
buf_block_t
&
block
,
ulint
type
,
mtr_t
*
mtr
)
{
if
(
UNIV_UNLIKELY
(
type
!=
fil_page_get_type
(
block
.
frame
)))
{
fil_block_reset_type
(
block
,
type
,
mtr
);
}
}
/** Checks if a page address is an extent descriptor page address.
@param[in] page_id page id
@param[in] page_size page size
...
...
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