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
93e8ee4a
Commit
93e8ee4a
authored
Jan 12, 2018
by
Aleksey Midenkov
Committed by
Sergei Golubchik
Jan 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14923 Assertion upon INSERT into locked versioned partitioned table
parent
fbed4ca4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
24 deletions
+41
-24
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+8
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+9
-0
sql/partition_info.cc
sql/partition_info.cc
+22
-17
sql/partition_info.h
sql/partition_info.h
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+1
-6
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
93e8ee4a
...
...
@@ -407,6 +407,14 @@ Warning 4112 Versioned table `test`.`t1`: partition `p2` is full, add more HISTO
delete from t1 where x = 2;
Warnings:
Warning 4112 Versioned table `test`.`t1`: partition `p2` is full, add more HISTORY partitions
# MDEV-14923 Assertion upon INSERT into locked versioned partitioned table
create or replace table t1 (x int) with system versioning
partition by system_time (partition p1 history, partition pn current);
lock table t1 write;
alter table t1 add partition (partition p1 history);
ERROR HY000: Duplicate partition name p1
insert into t1 values (1);
unlock tables;
# Test cleanup
drop database test;
create database test;
mysql-test/suite/versioning/t/partition.test
View file @
93e8ee4a
...
...
@@ -351,6 +351,15 @@ alter table t1 partition by system_time limit 1 (
delete
from
t1
where
x
=
1
;
delete
from
t1
where
x
=
2
;
--
echo
# MDEV-14923 Assertion upon INSERT into locked versioned partitioned table
create
or
replace
table
t1
(
x
int
)
with
system
versioning
partition
by
system_time
(
partition
p1
history
,
partition
pn
current
);
lock
table
t1
write
;
--
error
ER_SAME_NAME_PARTITION
alter
table
t1
add
partition
(
partition
p1
history
);
insert
into
t1
values
(
1
);
unlock
tables
;
--
echo
# Test cleanup
drop
database
test
;
create
database
test
;
sql/partition_info.cc
View file @
93e8ee4a
...
...
@@ -1940,7 +1940,7 @@ static void warn_if_dir_in_part_elem(THD *thd, partition_element *part_elem)
bool
partition_info
::
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
handler
*
file
,
HA_CREATE_INFO
*
info
,
bool
add_or_reorg_part
)
partition_info
*
add_or_reorg_part
)
{
handlerton
*
table_engine
=
default_engine_type
;
uint
i
,
tot_partitions
;
...
...
@@ -2174,6 +2174,24 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
goto
end
;
}
if
(
hist_parts
>
1
)
{
if
(
unlikely
(
vers_info
->
limit
==
0
&&
vers_info
->
interval
==
0
))
{
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
WARN_VERS_PARAMETERS
,
ER_THD
(
thd
,
WARN_VERS_PARAMETERS
),
"no rotation condition for multiple HISTORY partitions."
);
}
}
if
(
unlikely
(
now_parts
>
1
))
{
my_error
(
ER_VERS_WRONG_PARTS
,
MYF
(
0
),
info
->
alias
);
goto
end
;
}
DBUG_ASSERT
(
table_engine
!=
partition_hton
&&
default_engine_type
==
table_engine
);
if
(
eng_type
)
...
...
@@ -2188,6 +2206,9 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
if
(
add_or_reorg_part
)
{
if
(
unlikely
(
part_type
==
VERSIONING_PARTITION
&&
vers_setup_expression
(
thd
,
add_or_reorg_part
->
partitions
.
elements
)))
goto
end
;
if
(
unlikely
(((
part_type
==
RANGE_PARTITION
||
part_type
==
VERSIONING_PARTITION
)
&&
check_range_constants
(
thd
))
||
(
part_type
==
LIST_PARTITION
&&
...
...
@@ -2195,22 +2216,6 @@ bool partition_info::check_partition_info(THD *thd, handlerton **eng_type,
goto
end
;
}
if
(
hist_parts
>
1
)
{
if
(
vers_info
->
limit
==
0
&&
vers_info
->
interval
==
0
)
{
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
WARN_VERS_PARAMETERS
,
ER_THD
(
thd
,
WARN_VERS_PARAMETERS
),
"no rotation condition for multiple HISTORY partitions."
);
}
}
if
(
now_parts
>
1
)
{
my_error
(
ER_VERS_WRONG_PARTS
,
MYF
(
0
),
info
->
alias
);
goto
end
;
}
result
=
FALSE
;
end:
DBUG_RETURN
(
result
);
...
...
sql/partition_info.h
View file @
93e8ee4a
...
...
@@ -348,7 +348,7 @@ class partition_info : public Sql_alloc
bool
check_list_constants
(
THD
*
thd
);
bool
check_partition_info
(
THD
*
thd
,
handlerton
**
eng_type
,
handler
*
file
,
HA_CREATE_INFO
*
info
,
bool
check_partition_function
);
partition_info
*
add_or_reorg_part
=
NULL
);
void
print_no_partition_found
(
TABLE
*
table
,
myf
errflag
);
void
print_debug
(
const
char
*
str
,
uint
*
);
Item
*
get_column_item
(
Item
*
item
,
Field
*
field
);
...
...
sql/sql_partition.cc
View file @
93e8ee4a
...
...
@@ -5436,13 +5436,8 @@ the generated partition syntax in a correct manner.
tab_part_info
->
use_default_num_subpartitions
=
FALSE
;
}
if
(
alter_info
->
flags
&
Alter_info
::
ALTER_ADD_PARTITION
&&
tab_part_info
->
part_type
==
VERSIONING_PARTITION
&&
tab_part_info
->
vers_setup_expression
(
thd
,
alt_part_info
->
partitions
.
elements
))
goto
err
;
if
(
tab_part_info
->
check_partition_info
(
thd
,
(
handlerton
**
)
NULL
,
table
->
file
,
0
,
TRUE
))
table
->
file
,
0
,
alt_part_info
))
{
goto
err
;
}
...
...
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