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
c8cba4af
Commit
c8cba4af
authored
Sep 12, 2017
by
Eugene Kosov
Committed by
Sergey Vojtovich
Sep 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unneeded allocation
parent
46cf2218
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
15 deletions
+6
-15
sql/ha_partition.cc
sql/ha_partition.cc
+3
-8
sql/ha_partition.h
sql/ha_partition.h
+3
-7
No files found.
sql/ha_partition.cc
View file @
c8cba4af
...
...
@@ -166,12 +166,8 @@ bool Partition_share::init(uint num_parts)
auto_inc_initialized
=
false
;
partition_name_hash_initialized
=
false
;
next_auto_inc_val
=
0
;
partitions_share_refs
=
new
Parts_share_refs
;
if
(
!
partitions_share_refs
)
DBUG_RETURN
(
true
);
if
(
partitions_share_refs
->
init
(
num_parts
))
if
(
partitions_share_refs
.
init
(
num_parts
))
{
delete
partitions_share_refs
;
DBUG_RETURN
(
true
);
}
DBUG_RETURN
(
false
);
...
...
@@ -3305,9 +3301,8 @@ bool ha_partition::set_ha_share_ref(Handler_share **ha_share_arg)
DBUG_RETURN
(
true
);
if
(
!
(
part_share
=
get_share
()))
DBUG_RETURN
(
true
);
DBUG_ASSERT
(
part_share
->
partitions_share_refs
);
DBUG_ASSERT
(
part_share
->
partitions_share_refs
->
num_parts
>=
m_tot_parts
);
ha_shares
=
part_share
->
partitions_share_refs
->
ha_shares
;
DBUG_ASSERT
(
part_share
->
partitions_share_refs
.
num_parts
>=
m_tot_parts
);
ha_shares
=
part_share
->
partitions_share_refs
.
ha_shares
;
for
(
i
=
0
;
i
<
m_tot_parts
;
i
++
)
{
if
(
m_file
[
i
]
->
set_ha_share_ref
(
&
ha_shares
[
i
]))
...
...
sql/ha_partition.h
View file @
c8cba4af
...
...
@@ -48,10 +48,8 @@ class Parts_share_refs
{
uint
i
;
for
(
i
=
0
;
i
<
num_parts
;
i
++
)
if
(
ha_shares
[
i
])
delete
ha_shares
[
i
];
if
(
ha_shares
)
delete
[]
ha_shares
;
delete
ha_shares
[
i
];
delete
[]
ha_shares
;
}
bool
init
(
uint
arg_num_parts
)
{
...
...
@@ -86,7 +84,7 @@ class Partition_share : public Handler_share
bool
partition_name_hash_initialized
;
HASH
partition_name_hash
;
/** Storage for each partitions Handler_share */
Parts_share_refs
*
partitions_share_refs
;
Parts_share_refs
partitions_share_refs
;
Partition_share
()
{}
~
Partition_share
()
{
...
...
@@ -94,8 +92,6 @@ class Partition_share : public Handler_share
mysql_mutex_destroy
(
&
auto_inc_mutex
);
if
(
partition_name_hash_initialized
)
my_hash_free
(
&
partition_name_hash
);
if
(
partitions_share_refs
)
delete
partitions_share_refs
;
DBUG_VOID_RETURN
;
}
bool
init
(
uint
num_parts
);
...
...
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