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
aafaf05a
Commit
aafaf05a
authored
Apr 21, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some InnoDB type mismatch introduced in 10.1
On 64-bit Windows, sizeof(ulint)!=sizeof(ulong).
parent
7445ff84
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
52 additions
and
48 deletions
+52
-48
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+7
-10
storage/innobase/buf/buf0dblwr.cc
storage/innobase/buf/buf0dblwr.cc
+2
-2
storage/innobase/fil/fil0crypt.cc
storage/innobase/fil/fil0crypt.cc
+12
-9
storage/innobase/fil/fil0fil.cc
storage/innobase/fil/fil0fil.cc
+2
-1
storage/innobase/fil/fil0pagecompress.cc
storage/innobase/fil/fil0pagecompress.cc
+3
-2
storage/xtradb/buf/buf0buf.cc
storage/xtradb/buf/buf0buf.cc
+7
-10
storage/xtradb/buf/buf0dblwr.cc
storage/xtradb/buf/buf0dblwr.cc
+2
-2
storage/xtradb/fil/fil0crypt.cc
storage/xtradb/fil/fil0crypt.cc
+12
-9
storage/xtradb/fil/fil0fil.cc
storage/xtradb/fil/fil0fil.cc
+2
-1
storage/xtradb/fil/fil0pagecompress.cc
storage/xtradb/fil/fil0pagecompress.cc
+3
-2
No files found.
storage/innobase/buf/buf0buf.cc
View file @
aafaf05a
...
...
@@ -6269,9 +6269,9 @@ buf_page_decrypt_after_read(
/* decompress using comp_buf to dst_frame */
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
size
,
&
bpage
->
write_size
);
dst_frame
,
ulong
(
size
)
,
&
bpage
->
write_size
);
/* Mark this slot as free */
slot
->
reserved
=
false
;
...
...
@@ -6323,13 +6323,10 @@ buf_page_decrypt_after_read(
#endif
/* decompress using comp_buf to dst_frame */
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
size
,
&
bpage
->
write_size
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
#endif
dst_frame
,
ulong
(
size
),
&
bpage
->
write_size
);
ut_d
(
fil_page_type_validate
(
dst_frame
));
}
/* Mark this slot as free */
...
...
storage/innobase/buf/buf0dblwr.cc
View file @
aafaf05a
...
...
@@ -538,7 +538,7 @@ buf_dblwr_process()
/* Decompress the page before
validating the checksum. */
fil_decompress_page
(
NULL
,
read_buf
,
UNIV_PAGE_SIZE
,
NULL
,
read_buf
,
srv_page_size
,
NULL
,
true
);
}
...
...
@@ -565,7 +565,7 @@ buf_dblwr_process()
/* Decompress the page before
validating the checksum. */
fil_decompress_page
(
NULL
,
page
,
UNIV_PAGE_SIZE
,
NULL
,
true
);
NULL
,
page
,
srv_page_size
,
NULL
,
true
);
}
if
(
!
fil_space_verify_crypt_checksum
(
page
,
zip_size
,
NULL
,
page_no
)
...
...
storage/innobase/fil/fil0crypt.cc
View file @
aafaf05a
...
...
@@ -694,7 +694,8 @@ fil_space_encrypt(
comp_mem
=
(
byte
*
)
malloc
(
UNIV_PAGE_SIZE
);
uncomp_mem
=
(
byte
*
)
malloc
(
UNIV_PAGE_SIZE
);
memcpy
(
comp_mem
,
src_frame
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
uncomp_mem
,
comp_mem
,
UNIV_PAGE_SIZE
,
NULL
);
fil_decompress_page
(
uncomp_mem
,
comp_mem
,
srv_page_size
,
NULL
);
src
=
uncomp_mem
;
}
...
...
@@ -704,7 +705,8 @@ fil_space_encrypt(
/* Need to decompress the page if it was also compressed */
if
(
page_compressed_encrypted
)
{
memcpy
(
comp_mem
,
tmp_mem
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
tmp_mem
,
comp_mem
,
UNIV_PAGE_SIZE
,
NULL
);
fil_decompress_page
(
tmp_mem
,
comp_mem
,
srv_page_size
,
NULL
);
}
bool
corrupted
=
buf_page_is_corrupted
(
true
,
tmp_mem
,
zip_size
,
space
);
...
...
@@ -1492,20 +1494,21 @@ fil_crypt_realloc_iops(
if
(
10
*
state
->
cnt_waited
>
state
->
batch
)
{
/* if we waited more than 10% re-estimate max_iops */
uint
avg_wait_time_us
=
u
l
int
avg_wait_time_us
=
state
->
sum_waited_us
/
state
->
cnt_waited
;
if
(
avg_wait_time_us
==
0
)
{
avg_wait_time_us
=
1
;
// prevent division by zero
}
DBUG_PRINT
(
"ib_crypt"
,
(
"thr_no: %u - update estimated_max_iops from %u to %u."
,
(
"thr_no: %u - update estimated_max_iops from %u to "
ULINTPF
"."
,
state
->
thread_no
,
state
->
estimated_max_iops
,
1000000
/
avg_wait_time_us
));
if
(
avg_wait_time_us
==
0
)
{
avg_wait_time_us
=
1
;
// prevent division by zero
}
state
->
estimated_max_iops
=
1000000
/
avg_wait_time_us
;
state
->
estimated_max_iops
=
uint
(
1000000
/
avg_wait_time_us
);
state
->
cnt_waited
=
0
;
state
->
sum_waited_us
=
0
;
}
else
{
...
...
storage/innobase/fil/fil0fil.cc
View file @
aafaf05a
...
...
@@ -6708,7 +6708,8 @@ fil_iterate(
/* If the original page is page_compressed, we need
to decompress page before we can update it. */
if
(
page_compressed
)
{
fil_decompress_page
(
NULL
,
dst
,
size
,
NULL
);
fil_decompress_page
(
NULL
,
dst
,
ulong
(
size
),
NULL
);
updated
=
true
;
}
...
...
storage/innobase/fil/fil0pagecompress.cc
View file @
aafaf05a
...
...
@@ -300,7 +300,8 @@ fil_compress_page(
#endif
/* HAVE_SNAPPY */
case
PAGE_ZLIB_ALGORITHM
:
err
=
compress2
(
out_buf
+
header_len
,
(
ulong
*
)
&
write_size
,
buf
,
len
,
comp_level
);
err
=
compress2
(
out_buf
+
header_len
,
(
ulong
*
)
&
write_size
,
buf
,
uLong
(
len
),
comp_level
);
if
(
err
!=
Z_OK
)
{
/* If error we leave the actual page as it was */
...
...
@@ -364,7 +365,7 @@ fil_compress_page(
uncomp_page
=
static_cast
<
byte
*>
(
ut_malloc
(
UNIV_PAGE_SIZE
));
memcpy
(
comp_page
,
out_buf
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
uncomp_page
,
comp_page
,
len
,
NULL
);
fil_decompress_page
(
uncomp_page
,
comp_page
,
ulong
(
len
)
,
NULL
);
if
(
buf_page_is_corrupted
(
false
,
uncomp_page
,
0
,
space
))
{
buf_page_print
(
uncomp_page
,
0
,
BUF_PAGE_PRINT_NO_CRASH
);
...
...
storage/xtradb/buf/buf0buf.cc
View file @
aafaf05a
...
...
@@ -6429,9 +6429,9 @@ buf_page_decrypt_after_read(
/* decompress using comp_buf to dst_frame */
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
size
,
&
bpage
->
write_size
);
dst_frame
,
ulong
(
size
)
,
&
bpage
->
write_size
);
/* Mark this slot as free */
slot
->
reserved
=
false
;
...
...
@@ -6483,13 +6483,10 @@ buf_page_decrypt_after_read(
#endif
/* decompress using comp_buf to dst_frame */
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
size
,
&
bpage
->
write_size
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
#endif
dst_frame
,
ulong
(
size
),
&
bpage
->
write_size
);
ut_d
(
fil_page_type_validate
(
dst_frame
));
}
/* Mark this slot as free */
...
...
storage/xtradb/buf/buf0dblwr.cc
View file @
aafaf05a
...
...
@@ -538,7 +538,7 @@ buf_dblwr_process()
/* Decompress the page before
validating the checksum. */
fil_decompress_page
(
NULL
,
read_buf
,
UNIV_PAGE_SIZE
,
NULL
,
read_buf
,
srv_page_size
,
NULL
,
true
);
}
...
...
@@ -565,7 +565,7 @@ buf_dblwr_process()
/* Decompress the page before
validating the checksum. */
fil_decompress_page
(
NULL
,
page
,
UNIV_PAGE_SIZE
,
NULL
,
true
);
NULL
,
page
,
srv_page_size
,
NULL
,
true
);
}
if
(
!
fil_space_verify_crypt_checksum
(
page
,
zip_size
,
NULL
,
page_no
)
...
...
storage/xtradb/fil/fil0crypt.cc
View file @
aafaf05a
...
...
@@ -694,7 +694,8 @@ fil_space_encrypt(
comp_mem
=
(
byte
*
)
malloc
(
UNIV_PAGE_SIZE
);
uncomp_mem
=
(
byte
*
)
malloc
(
UNIV_PAGE_SIZE
);
memcpy
(
comp_mem
,
src_frame
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
uncomp_mem
,
comp_mem
,
UNIV_PAGE_SIZE
,
NULL
);
fil_decompress_page
(
uncomp_mem
,
comp_mem
,
srv_page_size
,
NULL
);
src
=
uncomp_mem
;
}
...
...
@@ -704,7 +705,8 @@ fil_space_encrypt(
/* Need to decompress the page if it was also compressed */
if
(
page_compressed_encrypted
)
{
memcpy
(
comp_mem
,
tmp_mem
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
tmp_mem
,
comp_mem
,
UNIV_PAGE_SIZE
,
NULL
);
fil_decompress_page
(
tmp_mem
,
comp_mem
,
srv_page_size
,
NULL
);
}
bool
corrupted
=
buf_page_is_corrupted
(
true
,
tmp_mem
,
zip_size
,
space
);
...
...
@@ -1492,20 +1494,21 @@ fil_crypt_realloc_iops(
if
(
10
*
state
->
cnt_waited
>
state
->
batch
)
{
/* if we waited more than 10% re-estimate max_iops */
uint
avg_wait_time_us
=
u
l
int
avg_wait_time_us
=
state
->
sum_waited_us
/
state
->
cnt_waited
;
if
(
avg_wait_time_us
==
0
)
{
avg_wait_time_us
=
1
;
// prevent division by zero
}
DBUG_PRINT
(
"ib_crypt"
,
(
"thr_no: %u - update estimated_max_iops from %u to %u."
,
(
"thr_no: %u - update estimated_max_iops from %u to "
ULINTPF
"."
,
state
->
thread_no
,
state
->
estimated_max_iops
,
1000000
/
avg_wait_time_us
));
if
(
avg_wait_time_us
==
0
)
{
avg_wait_time_us
=
1
;
// prevent division by zero
}
state
->
estimated_max_iops
=
1000000
/
avg_wait_time_us
;
state
->
estimated_max_iops
=
uint
(
1000000
/
avg_wait_time_us
);
state
->
cnt_waited
=
0
;
state
->
sum_waited_us
=
0
;
}
else
{
...
...
storage/xtradb/fil/fil0fil.cc
View file @
aafaf05a
...
...
@@ -6772,7 +6772,8 @@ fil_iterate(
/* If the original page is page_compressed, we need
to decompress page before we can update it. */
if
(
page_compressed
)
{
fil_decompress_page
(
NULL
,
dst
,
size
,
NULL
);
fil_decompress_page
(
NULL
,
dst
,
ulong
(
size
),
NULL
);
updated
=
true
;
}
...
...
storage/xtradb/fil/fil0pagecompress.cc
View file @
aafaf05a
...
...
@@ -300,7 +300,8 @@ fil_compress_page(
#endif
/* HAVE_SNAPPY */
case
PAGE_ZLIB_ALGORITHM
:
err
=
compress2
(
out_buf
+
header_len
,
(
ulong
*
)
&
write_size
,
buf
,
len
,
comp_level
);
err
=
compress2
(
out_buf
+
header_len
,
(
ulong
*
)
&
write_size
,
buf
,
uLong
(
len
),
comp_level
);
if
(
err
!=
Z_OK
)
{
/* If error we leave the actual page as it was */
...
...
@@ -364,7 +365,7 @@ fil_compress_page(
uncomp_page
=
static_cast
<
byte
*>
(
ut_malloc
(
UNIV_PAGE_SIZE
));
memcpy
(
comp_page
,
out_buf
,
UNIV_PAGE_SIZE
);
fil_decompress_page
(
uncomp_page
,
comp_page
,
len
,
NULL
);
fil_decompress_page
(
uncomp_page
,
comp_page
,
ulong
(
len
)
,
NULL
);
if
(
buf_page_is_corrupted
(
false
,
uncomp_page
,
0
,
space
))
{
buf_page_print
(
uncomp_page
,
0
,
BUF_PAGE_PRINT_NO_CRASH
);
...
...
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