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
ababd6a9
Commit
ababd6a9
authored
Nov 27, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: destroy Vers_min_max_stats [#346]
parent
941e8b7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
sql/partition_info.cc
sql/partition_info.cc
+4
-2
sql/table.cc
sql/table.cc
+14
-0
sql/table.h
sql/table.h
+1
-6
No files found.
sql/partition_info.cc
View file @
ababd6a9
...
@@ -962,8 +962,9 @@ bool partition_info::vers_setup_expression(THD * thd, uint32 alter_add)
...
@@ -962,8 +962,9 @@ bool partition_info::vers_setup_expression(THD * thd, uint32 alter_add)
DBUG_ASSERT
(
partitions
.
elements
>
alter_add
+
1
);
DBUG_ASSERT
(
partitions
.
elements
>
alter_add
+
1
);
Vers_min_max_stats
**
old_array
=
table
->
s
->
stat_trx
;
Vers_min_max_stats
**
old_array
=
table
->
s
->
stat_trx
;
table
->
s
->
stat_trx
=
static_cast
<
Vers_min_max_stats
**>
(
table
->
s
->
stat_trx
=
static_cast
<
Vers_min_max_stats
**>
(
alloc_root
(
&
table
->
s
->
mem_root
,
sizeof
(
void
*
)
*
partitions
.
elements
*
num_columns
));
alloc_root
(
&
table
->
s
->
mem_root
,
sizeof
(
void
*
)
*
(
partitions
.
elements
*
num_columns
+
1
)
));
memcpy
(
table
->
s
->
stat_trx
,
old_array
,
sizeof
(
void
*
)
*
(
partitions
.
elements
-
alter_add
)
*
num_columns
);
memcpy
(
table
->
s
->
stat_trx
,
old_array
,
sizeof
(
void
*
)
*
(
partitions
.
elements
-
alter_add
)
*
num_columns
);
table
->
s
->
stat_trx
[
partitions
.
elements
*
num_columns
]
=
NULL
;
}
}
else
else
{
{
...
@@ -1185,7 +1186,8 @@ bool partition_info::vers_setup_stats(THD * thd, bool is_create_table_ind)
...
@@ -1185,7 +1186,8 @@ bool partition_info::vers_setup_stats(THD * thd, bool is_create_table_ind)
{
{
DBUG_ASSERT
(
partitions
.
elements
>
1
);
DBUG_ASSERT
(
partitions
.
elements
>
1
);
table
->
s
->
stat_trx
=
static_cast
<
Vers_min_max_stats
**>
(
table
->
s
->
stat_trx
=
static_cast
<
Vers_min_max_stats
**>
(
alloc_root
(
&
table
->
s
->
mem_root
,
sizeof
(
void
*
)
*
partitions
.
elements
*
num_columns
));
alloc_root
(
&
table
->
s
->
mem_root
,
sizeof
(
void
*
)
*
(
partitions
.
elements
*
num_columns
+
1
)));
table
->
s
->
stat_trx
[
partitions
.
elements
*
num_columns
]
=
NULL
;
dont_stat
=
false
;
dont_stat
=
false
;
}
}
...
...
sql/table.cc
View file @
ababd6a9
...
@@ -8478,6 +8478,20 @@ LEX_CSTRING *fk_option_name(enum_fk_option opt)
...
@@ -8478,6 +8478,20 @@ LEX_CSTRING *fk_option_name(enum_fk_option opt)
return
names
+
opt
;
return
names
+
opt
;
}
}
void
TABLE_SHARE
::
vers_destroy
()
{
mysql_mutex_destroy
(
&
LOCK_rotation
);
mysql_cond_destroy
(
&
COND_rotation
);
mysql_rwlock_destroy
(
&
LOCK_stat_serial
);
if
(
stat_trx
)
{
for
(
Vers_min_max_stats
**
p
=
stat_trx
;
*
p
;
++
p
)
{
delete
*
p
;
}
}
}
TR_table
::
TR_table
(
THD
*
_thd
,
bool
rw
)
:
TR_table
::
TR_table
(
THD
*
_thd
,
bool
rw
)
:
thd
(
_thd
),
open_tables_backup
(
NULL
)
thd
(
_thd
),
open_tables_backup
(
NULL
)
{
{
...
...
sql/table.h
View file @
ababd6a9
...
@@ -769,12 +769,7 @@ struct TABLE_SHARE
...
@@ -769,12 +769,7 @@ struct TABLE_SHARE
mysql_rwlock_init
(
key_rwlock_LOCK_stat_serial
,
&
LOCK_stat_serial
);
mysql_rwlock_init
(
key_rwlock_LOCK_stat_serial
,
&
LOCK_stat_serial
);
}
}
void
vers_destroy
()
void
vers_destroy
();
{
mysql_mutex_destroy
(
&
LOCK_rotation
);
mysql_cond_destroy
(
&
COND_rotation
);
mysql_rwlock_destroy
(
&
LOCK_stat_serial
);
}
Field
*
vers_start_field
()
Field
*
vers_start_field
()
{
{
...
...
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