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
c34deb4c
Commit
c34deb4c
authored
Mar 03, 2020
by
Kentoku SHIBA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix memory calculate for spider_mon_table_cache
parent
d3a6ed05
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
storage/spider/spd_ping_table.cc
storage/spider/spd_ping_table.cc
+19
-2
No files found.
storage/spider/spd_ping_table.cc
View file @
c34deb4c
...
...
@@ -850,6 +850,7 @@ int spider_init_ping_table_mon_cache(
bool
need_lock
)
{
int
error_num
,
same
;
uint
old_elements
;
TABLE
*
table_link_mon
=
NULL
;
#if MYSQL_VERSION_ID < 50500
Open_tables_state
open_tables_backup
;
...
...
@@ -899,11 +900,23 @@ int spider_init_ping_table_mon_cache(
{
mon_key
.
sort
=
spider_calc_for_sort
(
3
,
mon_key
.
db_name
,
mon_key
.
table_name
,
mon_key
.
link_id
);
old_elements
=
spider_mon_table_cache
.
max_element
;
if
(
push_dynamic
(
&
spider_mon_table_cache
,
(
uchar
*
)
&
mon_key
))
{
error_num
=
HA_ERR_OUT_OF_MEM
;
goto
error_push_dynamic
;
}
if
(
spider_mon_table_cache
.
max_element
!=
old_elements
)
{
spider_free_mem_calc
(
spider_current_trx
,
spider_mon_table_cache_id
,
old_elements
*
spider_mon_table_cache
.
size_of_element
);
spider_alloc_calc_mem
(
spider_current_trx
,
spider_mon_table_cache
,
spider_mon_table_cache
.
max_element
*
spider_mon_table_cache
.
size_of_element
);
}
}
if
((
error_num
=
spider_sys_index_next
(
table_link_mon
)))
...
...
@@ -923,12 +936,16 @@ int spider_init_ping_table_mon_cache(
(
uchar
*
)
dynamic_element
(
&
spider_mon_table_cache
,
0
,
SPIDER_MON_KEY
*
),
spider_mon_table_cache
.
elements
,
sizeof
(
SPIDER_MON_KEY
),
(
qsort_cmp
)
spider_compare_for_sort
);
uint
old_elements
=
spider_mon_table_cache
.
max_element
;
old_elements
=
spider_mon_table_cache
.
max_element
;
freeze_size
(
&
spider_mon_table_cache
);
if
(
spider_mon_table_cache
.
max_element
<
old_elements
)
if
(
spider_mon_table_cache
.
max_element
!=
old_elements
)
{
spider_free_mem_calc
(
spider_current_trx
,
spider_mon_table_cache_id
,
old_elements
*
spider_mon_table_cache
.
size_of_element
);
spider_alloc_calc_mem
(
spider_current_trx
,
spider_mon_table_cache
,
spider_mon_table_cache
.
max_element
*
spider_mon_table_cache
.
size_of_element
);
}
...
...
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