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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b013f0d3
Commit
b013f0d3
authored
Oct 30, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: page0zip.c: Add some Valgrind instrumentation.
parent
7d5f2f84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
page/page0zip.c
page/page0zip.c
+40
-0
No files found.
page/page0zip.c
View file @
b013f0d3
...
@@ -679,6 +679,10 @@ page_zip_compress_node_ptrs(
...
@@ -679,6 +679,10 @@ page_zip_compress_node_ptrs(
/* Only leaf nodes may contain externally stored columns. */
/* Only leaf nodes may contain externally stored columns. */
ut_ad
(
!
rec_offs_any_extern
(
offsets
));
ut_ad
(
!
rec_offs_any_extern
(
offsets
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
/* Compress the extra bytes. */
/* Compress the extra bytes. */
c_stream
->
avail_in
=
rec
-
REC_N_NEW_EXTRA_BYTES
c_stream
->
avail_in
=
rec
-
REC_N_NEW_EXTRA_BYTES
-
c_stream
->
next_in
;
-
c_stream
->
next_in
;
...
@@ -737,6 +741,7 @@ page_zip_compress_sec(
...
@@ -737,6 +741,7 @@ page_zip_compress_sec(
-
c_stream
->
next_in
;
-
c_stream
->
next_in
;
if
(
UNIV_LIKELY
(
c_stream
->
avail_in
))
{
if
(
UNIV_LIKELY
(
c_stream
->
avail_in
))
{
UNIV_MEM_VALID
(
c_stream
->
next_in
,
c_stream
->
avail_in
);
err
=
deflate
(
c_stream
,
Z_NO_FLUSH
);
err
=
deflate
(
c_stream
,
Z_NO_FLUSH
);
if
(
UNIV_UNLIKELY
(
err
!=
Z_OK
))
{
if
(
UNIV_UNLIKELY
(
err
!=
Z_OK
))
{
break
;
break
;
...
@@ -777,6 +782,10 @@ page_zip_compress_clust_ext(
...
@@ -777,6 +782,10 @@ page_zip_compress_clust_ext(
int
err
;
int
err
;
ulint
i
;
ulint
i
;
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
for
(
i
=
0
;
i
<
rec_offs_n_fields
(
offsets
);
i
++
)
{
for
(
i
=
0
;
i
<
rec_offs_n_fields
(
offsets
);
i
++
)
{
ulint
len
;
ulint
len
;
const
byte
*
src
;
const
byte
*
src
;
...
@@ -912,6 +921,9 @@ page_zip_compress_clust(
...
@@ -912,6 +921,9 @@ page_zip_compress_clust(
ULINT_UNDEFINED
,
&
heap
);
ULINT_UNDEFINED
,
&
heap
);
ut_ad
(
rec_offs_n_fields
(
offsets
)
ut_ad
(
rec_offs_n_fields
(
offsets
)
==
dict_index_get_n_fields
(
index
));
==
dict_index_get_n_fields
(
index
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
/* Compress the extra bytes. */
/* Compress the extra bytes. */
c_stream
->
avail_in
=
rec
-
REC_N_NEW_EXTRA_BYTES
c_stream
->
avail_in
=
rec
-
REC_N_NEW_EXTRA_BYTES
...
@@ -956,6 +968,9 @@ page_zip_compress_clust(
...
@@ -956,6 +968,9 @@ page_zip_compress_clust(
==
rec_get_nth_field
(
rec
,
offsets
,
==
rec_get_nth_field
(
rec
,
offsets
,
trx_id_col
+
1
,
&
len
));
trx_id_col
+
1
,
&
len
));
ut_ad
(
len
==
DATA_ROLL_PTR_LEN
);
ut_ad
(
len
==
DATA_ROLL_PTR_LEN
);
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
/* Compress any preceding bytes. */
/* Compress any preceding bytes. */
c_stream
->
avail_in
=
src
-
c_stream
->
next_in
;
c_stream
->
avail_in
=
src
-
c_stream
->
next_in
;
...
@@ -1136,6 +1151,7 @@ page_zip_compress(
...
@@ -1136,6 +1151,7 @@ page_zip_compress(
trx_id_col
=
ULINT_UNDEFINED
;
trx_id_col
=
ULINT_UNDEFINED
;
}
}
UNIV_MEM_VALID
(
c_stream
.
next_in
,
c_stream
.
avail_in
);
err
=
deflate
(
&
c_stream
,
Z_FULL_FLUSH
);
err
=
deflate
(
&
c_stream
,
Z_FULL_FLUSH
);
if
(
err
!=
Z_OK
)
{
if
(
err
!=
Z_OK
)
{
goto
zlib_error
;
goto
zlib_error
;
...
@@ -1186,6 +1202,7 @@ page_zip_compress(
...
@@ -1186,6 +1202,7 @@ page_zip_compress(
-
(
c_stream
.
next_in
-
page
);
-
(
c_stream
.
next_in
-
page
);
ut_a
(
c_stream
.
avail_in
<=
UNIV_PAGE_SIZE
-
PAGE_ZIP_START
-
PAGE_DIR
);
ut_a
(
c_stream
.
avail_in
<=
UNIV_PAGE_SIZE
-
PAGE_ZIP_START
-
PAGE_DIR
);
UNIV_MEM_VALID
(
c_stream
.
next_in
,
c_stream
.
avail_in
);
err
=
deflate
(
&
c_stream
,
Z_FINISH
);
err
=
deflate
(
&
c_stream
,
Z_FINISH
);
if
(
UNIV_UNLIKELY
(
err
!=
Z_STREAM_END
))
{
if
(
UNIV_UNLIKELY
(
err
!=
Z_STREAM_END
))
{
...
@@ -2730,6 +2747,9 @@ page_zip_write_rec_ext(
...
@@ -2730,6 +2747,9 @@ page_zip_write_rec_ext(
ulint
n_ext
=
rec_offs_n_extern
(
offsets
);
ulint
n_ext
=
rec_offs_n_extern
(
offsets
);
ut_ad
(
rec_offs_validate
(
rec
,
index
,
offsets
));
ut_ad
(
rec_offs_validate
(
rec
,
index
,
offsets
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
externs
-=
(
DATA_TRX_ID_LEN
+
DATA_ROLL_PTR_LEN
)
externs
-=
(
DATA_TRX_ID_LEN
+
DATA_ROLL_PTR_LEN
)
*
(
page_dir_get_n_heap
(
page
)
-
PAGE_HEAP_NO_USER_LOW
);
*
(
page_dir_get_n_heap
(
page
)
-
PAGE_HEAP_NO_USER_LOW
);
...
@@ -2862,6 +2882,10 @@ page_zip_write_rec(
...
@@ -2862,6 +2882,10 @@ page_zip_write_rec(
ut_ad
(
page_zip_header_cmp
(
page_zip
,
page
));
ut_ad
(
page_zip_header_cmp
(
page_zip
,
page
));
ut_ad
(
page_simple_validate_new
((
page_t
*
)
page
));
ut_ad
(
page_simple_validate_new
((
page_t
*
)
page
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
slot
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
slot
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
ut_a
(
slot
);
ut_a
(
slot
);
/* Copy the delete mark. */
/* Copy the delete mark. */
...
@@ -3111,6 +3135,10 @@ page_zip_write_blob_ptr(
...
@@ -3111,6 +3135,10 @@ page_zip_write_blob_ptr(
ut_ad
(
page_is_leaf
(
page
));
ut_ad
(
page_is_leaf
(
page
));
ut_ad
(
dict_index_is_clust
(
index
));
ut_ad
(
dict_index_is_clust
(
index
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
blob_no
=
page_zip_get_n_prev_extern
(
page_zip
,
rec
,
index
)
blob_no
=
page_zip_get_n_prev_extern
(
page_zip
,
rec
,
index
)
+
rec_get_n_extern_new
(
rec
,
index
,
n
);
+
rec_get_n_extern_new
(
rec
,
index
,
n
);
ut_a
(
blob_no
<
page_zip
->
n_blobs
);
ut_a
(
blob_no
<
page_zip
->
n_blobs
);
...
@@ -3346,6 +3374,10 @@ page_zip_write_trx_id_and_roll_ptr(
...
@@ -3346,6 +3374,10 @@ page_zip_write_trx_id_and_roll_ptr(
#endif
#endif
mach_write_to_7
(
field
+
DATA_TRX_ID_LEN
,
roll_ptr
);
mach_write_to_7
(
field
+
DATA_TRX_ID_LEN
,
roll_ptr
);
memcpy
(
storage
,
field
,
DATA_TRX_ID_LEN
+
DATA_ROLL_PTR_LEN
);
memcpy
(
storage
,
field
,
DATA_TRX_ID_LEN
+
DATA_ROLL_PTR_LEN
);
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
}
}
#ifdef UNIV_ZIP_DEBUG
#ifdef UNIV_ZIP_DEBUG
...
@@ -3380,6 +3412,10 @@ page_zip_clear_rec(
...
@@ -3380,6 +3412,10 @@ page_zip_clear_rec(
heap_no
=
rec_get_heap_no_new
(
rec
);
heap_no
=
rec_get_heap_no_new
(
rec
);
ut_ad
(
heap_no
>=
PAGE_HEAP_NO_USER_LOW
);
ut_ad
(
heap_no
>=
PAGE_HEAP_NO_USER_LOW
);
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
if
(
if
(
#ifdef UNIV_ZIP_DEBUG
#ifdef UNIV_ZIP_DEBUG
!
page_zip_clear_rec_disable
&&
!
page_zip_clear_rec_disable
&&
...
@@ -3595,6 +3631,10 @@ page_zip_dir_delete(
...
@@ -3595,6 +3631,10 @@ page_zip_dir_delete(
ut_ad
(
rec_offs_validate
(
rec
,
index
,
offsets
));
ut_ad
(
rec_offs_validate
(
rec
,
index
,
offsets
));
ut_ad
(
rec_offs_comp
(
offsets
));
ut_ad
(
rec_offs_comp
(
offsets
));
UNIV_MEM_VALID
(
rec
,
rec_offs_data_size
(
offsets
));
UNIV_MEM_VALID
(
rec
-
rec_offs_extra_size
(
offsets
),
rec_offs_extra_size
(
offsets
));
slot_rec
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
slot_rec
=
page_zip_dir_find
(
page_zip
,
page_offset
(
rec
));
ut_a
(
slot_rec
);
ut_a
(
slot_rec
);
...
...
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