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
a1bd9532
Commit
a1bd9532
authored
Nov 04, 2010
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge
parents
e55c4836
e3c8798e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
35 deletions
+43
-35
storage/maria/ma_blockrec.c
storage/maria/ma_blockrec.c
+42
-34
storage/maria/maria_def.h
storage/maria/maria_def.h
+1
-1
No files found.
storage/maria/ma_blockrec.c
View file @
a1bd9532
...
...
@@ -1993,19 +1993,6 @@ static my_bool write_tail(MARIA_HA *info,
/* Keep BLOCKUSED_USE_ORG_BITMAP */
block
->
used
|=
BLOCKUSED_USED
|
BLOCKUSED_TAIL
;
/* Increase data file size, if extended */
position
=
(
my_off_t
)
block
->
page
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<=
position
)
{
/*
We are modifying a state member before writing the UNDO; this is a WAL
violation. But for data_file_length this is ok, as long as we change
data_file_length after writing any log record (FILE_ID/REDO/UNDO) (see
collect_tables()).
*/
_ma_set_share_data_file_length
(
share
,
position
+
block_size
);
}
if
(
block_is_read
)
{
/* Current page link is last element in pinned_pages */
...
...
@@ -2021,17 +2008,33 @@ static my_bool write_tail(MARIA_HA *info,
page_link
->
unlock
=
PAGECACHE_LOCK_READ_UNLOCK
;
res
=
0
;
}
else
if
(
!
(
res
=
pagecache_write
(
share
->
pagecache
,
&
info
->
dfile
,
block
->
page
,
0
,
row_pos
.
buff
,
share
->
page_type
,
PAGECACHE_LOCK_READ
,
PAGECACHE_PIN
,
PAGECACHE_WRITE_DELAY
,
&
page_link
.
link
,
LSN_IMPOSSIBLE
)))
else
{
page_link
.
unlock
=
PAGECACHE_LOCK_READ_UNLOCK
;
page_link
.
changed
=
1
;
push_dynamic
(
&
info
->
pinned_pages
,
(
void
*
)
&
page_link
);
if
(
!
(
res
=
pagecache_write
(
share
->
pagecache
,
&
info
->
dfile
,
block
->
page
,
0
,
row_pos
.
buff
,
share
->
page_type
,
PAGECACHE_LOCK_READ
,
PAGECACHE_PIN
,
PAGECACHE_WRITE_DELAY
,
&
page_link
.
link
,
LSN_IMPOSSIBLE
)))
{
page_link
.
unlock
=
PAGECACHE_LOCK_READ_UNLOCK
;
page_link
.
changed
=
1
;
push_dynamic
(
&
info
->
pinned_pages
,
(
void
*
)
&
page_link
);
}
/* Increase data file size, if extended */
position
=
(
my_off_t
)
block
->
page
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<=
position
)
{
/*
We are modifying a state member before writing the UNDO; this is a WAL
violation. But for data_file_length this is ok, as long as we change
data_file_length after writing any log record (FILE_ID/REDO/UNDO) (see
collect_tables()).
*/
_ma_set_share_data_file_length
(
share
,
position
+
block_size
);
}
}
DBUG_RETURN
(
res
);
}
...
...
@@ -2068,7 +2071,7 @@ static my_bool write_full_pages(MARIA_HA *info,
uint
data_size
=
FULL_PAGE_SIZE
(
block_size
);
uchar
*
buff
=
info
->
keyread_buff
;
uint
page_count
,
sub_blocks
;
my_off_t
position
;
my_off_t
position
,
max_position
;
DBUG_ENTER
(
"write_full_pages"
);
DBUG_PRINT
(
"enter"
,
(
"length: %lu page: %lu page_count: %lu"
,
(
ulong
)
length
,
(
ulong
)
block
->
page
,
...
...
@@ -2080,9 +2083,7 @@ static my_bool write_full_pages(MARIA_HA *info,
page_count
=
block
->
page_count
;
sub_blocks
=
block
->
sub_blocks
;
position
=
(
my_off_t
)
(
page
+
page_count
)
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<
position
)
_ma_set_share_data_file_length
(
share
,
position
);
max_position
=
(
my_off_t
)
(
page
+
page_count
)
*
block_size
;
/* Increase data file size, if extended */
...
...
@@ -2105,8 +2106,7 @@ static my_bool write_full_pages(MARIA_HA *info,
(
ulong
)
block
->
page
,
(
ulong
)
block
->
page_count
));
position
=
(
page
+
page_count
+
1
)
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<
position
)
_ma_set_share_data_file_length
(
share
,
position
);
set_if_bigger
(
max_position
,
position
);
}
lsn_store
(
buff
,
lsn
);
buff
[
PAGE_TYPE_OFFSET
]
=
(
uchar
)
BLOB_PAGE
;
...
...
@@ -2134,6 +2134,8 @@ static my_bool write_full_pages(MARIA_HA *info,
page
++
;
DBUG_ASSERT
(
block
->
used
&
BLOCKUSED_USED
);
}
if
(
share
->
state
.
state
.
data_file_length
<
max_position
)
_ma_set_share_data_file_length
(
share
,
max_position
);
DBUG_RETURN
(
0
);
}
...
...
@@ -3121,11 +3123,6 @@ static my_bool write_block_record(MARIA_HA *info,
}
#endif
/* Increase data file size, if extended */
position
=
(
my_off_t
)
head_block
->
page
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<=
position
)
_ma_set_share_data_file_length
(
share
,
position
+
block_size
);
if
(
head_block_is_read
)
{
MARIA_PINNED_PAGE
*
page_link
;
...
...
@@ -3154,6 +3151,11 @@ static my_bool write_block_record(MARIA_HA *info,
page_link
.
unlock
=
PAGECACHE_LOCK_READ_UNLOCK
;
page_link
.
changed
=
1
;
push_dynamic
(
&
info
->
pinned_pages
,
(
void
*
)
&
page_link
);
/* Increase data file size, if extended */
position
=
(
my_off_t
)
head_block
->
page
*
block_size
;
if
(
share
->
state
.
state
.
data_file_length
<=
position
)
_ma_set_share_data_file_length
(
share
,
position
+
block_size
);
}
if
(
share
->
now_transactional
&&
(
tmp_data_used
||
blob_full_pages_exists
))
...
...
@@ -5162,6 +5164,7 @@ my_bool _ma_scan_init_block_record(MARIA_HA *info)
info
->
scan
.
number_of_rows
=
0
;
info
->
scan
.
bitmap_pos
=
info
->
scan
.
bitmap_end
;
info
->
scan
.
bitmap_page
=
(
pgcache_page_no_t
)
0
-
share
->
bitmap
.
pages_covered
;
info
->
scan
.
max_page
=
share
->
state
.
state
.
data_file_length
/
share
->
block_size
;
/*
We need to flush what's in memory (bitmap.map) to page cache otherwise, as
we are going to read bitmaps from page cache in table scan (see
...
...
@@ -5363,6 +5366,11 @@ int _ma_scan_block_record(MARIA_HA *info, uchar *record,
page
=
(
info
->
scan
.
bitmap_page
+
1
+
(
data
-
info
->
scan
.
bitmap_buff
)
/
6
*
16
+
bit_pos
-
1
);
info
->
scan
.
row_base_page
=
ma_recordpos
(
page
,
0
);
if
(
page
>=
info
->
scan
.
max_page
)
{
DBUG_PRINT
(
"info"
,
(
"Found end of file"
));
DBUG_RETURN
((
my_errno
=
HA_ERR_END_OF_FILE
));
}
if
(
!
(
pagecache_read
(
share
->
pagecache
,
&
info
->
dfile
,
page
,
0
,
info
->
scan
.
page_buff
,
...
...
storage/maria/maria_def.h
View file @
a1bd9532
...
...
@@ -476,7 +476,7 @@ typedef struct st_maria_block_scan
{
uchar
*
bitmap_buff
,
*
bitmap_pos
,
*
bitmap_end
,
*
page_buff
;
uchar
*
dir
,
*
dir_end
;
pgcache_page_no_t
bitmap_page
;
pgcache_page_no_t
bitmap_page
,
max_page
;
ulonglong
bits
;
uint
number_of_rows
,
bit_pos
;
MARIA_RECORD_POS
row_base_page
;
...
...
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