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
56ec3e77
Commit
56ec3e77
authored
Apr 26, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed mistypings in comments and spaces
parent
421ad14c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
27 deletions
+26
-27
storage/maria/ma_blockrec.c
storage/maria/ma_blockrec.c
+24
-25
storage/maria/ma_loghandler.c
storage/maria/ma_loghandler.c
+2
-2
No files found.
storage/maria/ma_blockrec.c
View file @
56ec3e77
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
/*
/*
Storage of records in block
Storage of records in block
Some clarif
ac
tions about the abbrev used:
Some clarif
ica
tions about the abbrev used:
NULL fields -> Fields that may have contain a NULL value.
NULL fields -> Fields that may have contain a NULL value.
Not null fields -> Fields that may not contain a NULL value.
Not null fields -> Fields that may not contain a NULL value.
...
@@ -57,20 +57,20 @@
...
@@ -57,20 +57,20 @@
NO 1 byte Number of row/tail entries on page
NO 1 byte Number of row/tail entries on page
empty space 2 bytes Empty space on page
empty space 2 bytes Empty space on page
The
upmos
t bit in PAGE_TYPE is set to 1 if the data on the page
The
most significan
t bit in PAGE_TYPE is set to 1 if the data on the page
can be compacted to get more space. (PAGE_CAN_BE_COMPACTED)
can be compacted to get more space. (PAGE_CAN_BE_COMPACTED)
Row data
Row data
Row directory of NO entries, that consist of the following for each row
Row directory of NO entries, that consist of the following for each row
(in reverse order; i
e
, first record is stored last):
(in reverse order; i
.e.
, first record is stored last):
Position 2 bytes Position of row on page
Position 2 bytes Position of row on page
Length 2 bytes Length of entry
Length 2 bytes Length of entry
For Position and Length, the 1
upmost bit of the position and the 1
For Position and Length, the 1
most significant bit of the position and
upmost bit of the length could be used for some states of the row (in
the 1 most significant bit of the length could be used for some states of
other words, we should try to keep these reserved)
the row (in
other words, we should try to keep these reserved)
eof flag 1 byte Reserved for full page read testing. (Ie, did the
eof flag 1 byte Reserved for full page read testing. (Ie, did the
previous write get the whole block on disk.
previous write get the whole block on disk.
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
efficiently. On update and delete we would add TRANSID (if it was an old
efficiently. On update and delete we would add TRANSID (if it was an old
committed row) and VER_PTR to
committed row) and VER_PTR to
the row. On row page compaction we can easily detect rows where
the row. On row page compaction we can easily detect rows where
TRANSID was committed before the
the
longest running transaction
TRANSID was committed before the longest running transaction
started and we can then delete TRANSID and VER_PTR from the row to
started and we can then delete TRANSID and VER_PTR from the row to
gain more space.
gain more space.
...
@@ -279,12 +279,12 @@ typedef struct st_maria_extent_cursor
...
@@ -279,12 +279,12 @@ typedef struct st_maria_extent_cursor
my_off_t
page
;
my_off_t
page
;
/* How many pages in the page region */
/* How many pages in the page region */
uint
page_count
;
uint
page_count
;
/* Total number of extents (i
e
, entries in the 'extent' slot) */
/* Total number of extents (i
.e.
, entries in the 'extent' slot) */
uint
extent_count
;
uint
extent_count
;
/* <> 0 if current extent is a tail page; Set while using cursor */
/* <> 0 if current extent is a tail page; Set while using cursor */
uint
tail
;
uint
tail
;
/*
/*
<> 1 if we are working on the first extent (i
e
, the one that is store in
<> 1 if we are working on the first extent (i
.e.
, the one that is store in
the row header, not an extent that is stored as part of the row data).
the row header, not an extent that is stored as part of the row data).
*/
*/
my_bool
first_extent
;
my_bool
first_extent
;
...
@@ -809,7 +809,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
...
@@ -809,7 +809,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
uint
length
=
(
next_free_pos
-
start_of_found_block
);
uint
length
=
(
next_free_pos
-
start_of_found_block
);
/*
/*
There was empty space before this and prev block
There was empty space before this and prev block
Check if we have to move prevous block up to page start
Check if we have to move prev
i
ous block up to page start
*/
*/
if
(
page_pos
!=
start_of_found_block
)
if
(
page_pos
!=
start_of_found_block
)
{
{
...
@@ -817,7 +817,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
...
@@ -817,7 +817,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
memmove
(
buff
+
page_pos
,
buff
+
start_of_found_block
,
length
);
memmove
(
buff
+
page_pos
,
buff
+
start_of_found_block
,
length
);
}
}
page_pos
+=
length
;
page_pos
+=
length
;
/* next continous block starts here */
/* next contin
u
ous block starts here */
start_of_found_block
=
offset
;
start_of_found_block
=
offset
;
diff
=
offset
-
page_pos
;
diff
=
offset
-
page_pos
;
}
}
...
@@ -858,7 +858,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
...
@@ -858,7 +858,7 @@ static void compact_page(byte *buff, uint block_size, uint rownr,
memmove
(
buff
+
page_pos
-
length
,
buff
+
next_free_pos
,
length
);
memmove
(
buff
+
page_pos
-
length
,
buff
+
next_free_pos
,
length
);
}
}
page_pos
-=
length
;
page_pos
-=
length
;
/* next continous block starts here */
/* next contin
u
ous block starts here */
end_of_found_block
=
row_end
;
end_of_found_block
=
row_end
;
diff
=
page_pos
-
row_end
;
diff
=
page_pos
-
row_end
;
}
}
...
@@ -952,7 +952,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
...
@@ -952,7 +952,7 @@ static my_bool get_head_or_tail_page(MARIA_HA *info,
res
->
data
=
(
buff
+
PAGE_HEADER_SIZE
);
res
->
data
=
(
buff
+
PAGE_HEADER_SIZE
);
res
->
dir
=
res
->
data
+
res
->
length
;
res
->
dir
=
res
->
data
+
res
->
length
;
res
->
offset
=
0
;
res
->
offset
=
0
;
/* Store po
is
tion to the first row */
/* Store po
si
tion to the first row */
int2store
(
res
->
dir
,
PAGE_HEADER_SIZE
);
int2store
(
res
->
dir
,
PAGE_HEADER_SIZE
);
DBUG_ASSERT
(
length
<=
res
->
length
);
DBUG_ASSERT
(
length
<=
res
->
length
);
}
}
...
@@ -1487,7 +1487,7 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
...
@@ -1487,7 +1487,7 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
for
(
end_block
=
block
+
block
->
sub_blocks
;
block
<
end_block
;
block
++
)
for
(
end_block
=
block
+
block
->
sub_blocks
;
block
<
end_block
;
block
++
)
{
{
/*
/*
Set only a bit, to not cause bitmap code to belive a block is full
Set only a bit, to not cause bitmap code to beli
e
ve a block is full
when there is still a lot of entries in it
when there is still a lot of entries in it
*/
*/
block
->
used
|=
BLOCKUSED_USED
;
block
->
used
|=
BLOCKUSED_USED
;
...
@@ -1535,7 +1535,7 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
...
@@ -1535,7 +1535,7 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
end_block
=
head_block
+
head_block
->
sub_blocks
;
end_block
=
head_block
+
head_block
->
sub_blocks
;
/*
/*
Loop until we have find a block bigger than we need or
Loop until we have find a block bigger than we need or
we find the
the
empty page block.
we find the empty page block.
*/
*/
while
(
data_length
>=
(
length
=
(
cur_block
->
page_count
*
while
(
data_length
>=
(
length
=
(
cur_block
->
page_count
*
FULL_PAGE_SIZE
(
block_size
)))
&&
FULL_PAGE_SIZE
(
block_size
)))
&&
...
@@ -1585,7 +1585,6 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
...
@@ -1585,7 +1585,6 @@ static my_bool write_block_record(MARIA_HA *info, const byte *record,
TODO:
TODO:
If there is enough space on the following tail block, use
If there is enough space on the following tail block, use
this instead of creating a new tail block.
this instead of creating a new tail block.
*/
*/
DBUG_ASSERT
(
cur_block
[
1
].
page_count
==
0
);
DBUG_ASSERT
(
cur_block
[
1
].
page_count
==
0
);
if
(
cur_block
->
page_count
==
1
)
if
(
cur_block
->
page_count
==
1
)
...
...
storage/maria/ma_loghandler.c
View file @
56ec3e77
...
@@ -424,7 +424,7 @@ static File open_logfile_by_number_no_cache(uint32 file_no)
...
@@ -424,7 +424,7 @@ static File open_logfile_by_number_no_cache(uint32 file_no)
char
path
[
FN_REFLEN
];
char
path
[
FN_REFLEN
];
DBUG_ENTER
(
"open_logfile_by_number_no_cache"
);
DBUG_ENTER
(
"open_logfile_by_number_no_cache"
);
/* T
odo
: add O_DIRECT to open flags (when buffer is aligned) */
/* T
ODO
: add O_DIRECT to open flags (when buffer is aligned) */
if
((
file
=
my_open
(
translog_filename_by_fileno
(
file_no
,
path
),
if
((
file
=
my_open
(
translog_filename_by_fileno
(
file_no
,
path
),
O_CREAT
|
O_BINARY
|
O_RDWR
,
O_CREAT
|
O_BINARY
|
O_RDWR
,
MYF
(
MY_WME
)))
<
0
)
MYF
(
MY_WME
)))
<
0
)
...
@@ -3180,7 +3180,7 @@ static byte *translog_get_LSN_from_diff(LSN base_lsn, byte *src, byte *dst)
...
@@ -3180,7 +3180,7 @@ static byte *translog_get_LSN_from_diff(LSN base_lsn, byte *src, byte *dst)
(
ulong
)
LSN_OFFSET
(
base_lsn
),
(
ulong
)
LSN_OFFSET
(
base_lsn
),
(
ulong
)
src
,
(
ulong
)
dst
));
(
ulong
)
src
,
(
ulong
)
dst
));
first_byte
=
*
((
uint8
*
)
src
);
first_byte
=
*
((
uint8
*
)
src
);
code
=
first_byte
>>
6
;
/* Length in 2 upmos
t bits */
code
=
first_byte
>>
6
;
/* Length is in 2 most significan
t bits */
first_byte
&=
0x3F
;
first_byte
&=
0x3F
;
src
++
;
/* Skip length + encode */
src
++
;
/* Skip length + encode */
file_no
=
LSN_FILE_NO
(
base_lsn
);
/* Assume relative */
file_no
=
LSN_FILE_NO
(
base_lsn
);
/* Assume relative */
...
...
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