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
806adaf5
Commit
806adaf5
authored
Oct 04, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pack PAGE_INSTANT to the LSB end of the PAGE_DIRECTION_B
parent
553d8175
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
storage/innobase/include/page0page.h
storage/innobase/include/page0page.h
+2
-2
storage/innobase/include/page0page.ic
storage/innobase/include/page0page.ic
+6
-6
No files found.
storage/innobase/include/page0page.h
View file @
806adaf5
...
...
@@ -82,8 +82,8 @@ ADD COLUMN.
Instant ADD COLUMN will change FIL_PAGE_TYPE to FIL_PAGE_TYPE_INSTANT
and initialize the PAGE_INSTANT field to the original number of
fields in the clustered index (dict_index_t::n_core_fields). The most
significant
8 bits are in the first byte, and the least significant 2
bits are stored in the most significant
2
bits of PAGE_DIRECTION_B.
significant
bits are in the first byte, and the least significant 5
bits are stored in the most significant
5
bits of PAGE_DIRECTION_B.
These FIL_PAGE_TYPE_INSTANT and PAGE_INSTANT may be assigned even if
instant ADD COLUMN was not committed. Changes to these page header fields
...
...
storage/innobase/include/page0page.ic
View file @
806adaf5
...
...
@@ -1082,7 +1082,7 @@ byte
page_ptr_get_direction(const byte* ptr)
{
ut_ad(page_offset(ptr) == PAGE_HEADER + PAGE_DIRECTION_B);
return *ptr & ((1U <<
6
) - 1);
return *ptr & ((1U <<
3
) - 1);
}
/** Set the PAGE_DIRECTION field.
...
...
@@ -1095,7 +1095,7 @@ page_ptr_set_direction(byte* ptr, byte dir)
ut_ad(page_offset(ptr) == PAGE_HEADER + PAGE_DIRECTION_B);
ut_ad(dir >= PAGE_LEFT);
ut_ad(dir <= PAGE_NO_DIRECTION);
*ptr = (*ptr & ~((1U <<
6
) - 1)) | dir;
*ptr = (*ptr & ~((1U <<
3
) - 1)) | dir;
}
/** Read the PAGE_INSTANT field.
...
...
@@ -1110,7 +1110,7 @@ page_get_instant(const page_t* page)
switch (fil_page_get_type(page)) {
case FIL_PAGE_TYPE_INSTANT:
ut_ad(page_get_direction(page) <= PAGE_NO_DIRECTION);
ut_ad(i >>
6
);
ut_ad(i >>
3
);
break;
case FIL_PAGE_INDEX:
ut_ad(i <= PAGE_NO_DIRECTION || !page_is_comp(page));
...
...
@@ -1123,7 +1123,7 @@ page_get_instant(const page_t* page)
break;
}
#endif /* UNIV_DEBUG */
return(i >>
6
);
return(i >>
3
);
}
/** Assign the PAGE_INSTANT field.
...
...
@@ -1136,10 +1136,10 @@ page_set_instant(page_t* page, unsigned n, mtr_t* mtr)
{
ut_ad(fil_page_get_type(page) == FIL_PAGE_TYPE_INSTANT);
ut_ad(n > 0);
ut_ad(n <
1U << 10
);
ut_ad(n <
REC_MAX_N_FIELDS
);
uint16_t i = page_header_get_field(page, PAGE_INSTANT);
ut_ad(i <= PAGE_NO_DIRECTION);
i |= n <<
6
;
i |= n <<
3
;
mlog_write_ulint(PAGE_HEADER + PAGE_INSTANT + page, i,
MLOG_2BYTES, mtr);
}
...
...
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