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
c86773f4
Commit
c86773f4
authored
Feb 06, 2019
by
Aleksey Midenkov
Committed by
Alexander Barkov
May 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments
[Closes tempesta-tech/mariadb#572]
parent
6473641b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
14 deletions
+47
-14
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+19
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+14
-0
sql/partition_info.h
sql/partition_info.h
+12
-2
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-6
sql/sql_yacc_ora.yy
sql/sql_yacc_ora.yy
+1
-6
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
c86773f4
...
...
@@ -522,6 +522,25 @@ set timestamp=1523466002.799571;
insert into t1 values (11),(12);
set timestamp=1523466004.169435;
delete from t1 where pk in (11, 12);
#
# MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments
#
create or replace table t1 (pk int) with system versioning
partition by system_time interval 7 second (
partition ver_p1 history,
partition ver_pn current);
alter table t1
partition by system_time interval column_get(column_create(7,7), 7 as int) second (
partition ver_p1 history,
partition ver_pn current);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`pk` int(11) DEFAULT NULL
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
PARTITION BY SYSTEM_TIME INTERVAL 7 SECOND
(PARTITION `ver_p1` HISTORY ENGINE = DEFAULT_ENGINE,
PARTITION `ver_pn` CURRENT ENGINE = DEFAULT_ENGINE)
# Test cleanup
drop database test;
create database test;
mysql-test/suite/versioning/t/partition.test
View file @
c86773f4
...
...
@@ -475,6 +475,20 @@ insert into t1 values (11),(12);
set
timestamp
=
1523466004.169435
;
delete
from
t1
where
pk
in
(
11
,
12
);
--
echo
#
--
echo
# MDEV-18136 Server crashes in Item_func_dyncol_create::prepare_arguments
--
echo
#
create
or
replace
table
t1
(
pk
int
)
with
system
versioning
partition
by
system_time
interval
7
second
(
partition
ver_p1
history
,
partition
ver_pn
current
);
alter
table
t1
partition
by
system_time
interval
column_get
(
column_create
(
7
,
7
),
7
as
int
)
second
(
partition
ver_p1
history
,
partition
ver_pn
current
);
--
replace_result
$default_engine
DEFAULT_ENGINE
show
create
table
t1
;
--
echo
# Test cleanup
drop
database
test
;
create
database
test
;
sql/partition_info.h
View file @
c86773f4
...
...
@@ -395,16 +395,26 @@ class partition_info : public Sql_alloc
bool
field_in_partition_expr
(
Field
*
field
)
const
;
bool
vers_init_info
(
THD
*
thd
);
bool
vers_set_interval
(
Item
*
item
,
interval_type
int_type
,
my_time_t
start
)
bool
vers_set_interval
(
THD
*
thd
,
Item
*
item
,
interval_type
int_type
,
my_time_t
start
)
{
DBUG_ASSERT
(
part_type
==
VERSIONING_PARTITION
);
vers_info
->
interval
.
type
=
int_type
;
vers_info
->
interval
.
start
=
start
;
return
get_interval_value
(
item
,
int_type
,
&
vers_info
->
interval
.
step
)
||
if
(
item
->
fix_fields_if_needed_for_scalar
(
thd
,
&
item
))
return
true
;
bool
error
=
get_interval_value
(
item
,
int_type
,
&
vers_info
->
interval
.
step
)
||
vers_info
->
interval
.
step
.
neg
||
vers_info
->
interval
.
step
.
second_part
||
!
(
vers_info
->
interval
.
step
.
year
||
vers_info
->
interval
.
step
.
month
||
vers_info
->
interval
.
step
.
day
||
vers_info
->
interval
.
step
.
hour
||
vers_info
->
interval
.
step
.
minute
||
vers_info
->
interval
.
step
.
second
);
if
(
error
)
{
my_error
(
ER_PART_WRONG_VALUE
,
MYF
(
0
),
thd
->
lex
->
create_last_non_select_table
->
table_name
.
str
,
"INTERVAL"
);
}
return
error
;
}
bool
vers_set_limit
(
ulonglong
limit
)
{
...
...
sql/sql_yacc.yy
View file @
c86773f4
...
...
@@ -6064,13 +6064,8 @@ opt_versioning_rotation:
| INTERVAL_SYM expr interval opt_versioning_interval_start
{
partition_info *part_info= Lex->part_info;
if (unlikely(part_info->vers_set_interval($2, $3, $4)))
{
my_error(ER_PART_WRONG_VALUE, MYF(0),
Lex->create_last_non_select_table->table_name.str,
"INTERVAL");
if (unlikely(part_info->vers_set_interval(thd, $2, $3, $4)))
MYSQL_YYABORT;
}
}
| LIMIT ulonglong_num
{
...
...
sql/sql_yacc_ora.yy
View file @
c86773f4
...
...
@@ -5910,13 +5910,8 @@ opt_versioning_rotation:
| INTERVAL_SYM expr interval opt_versioning_interval_start
{
partition_info *part_info= Lex->part_info;
if (unlikely(part_info->vers_set_interval($2, $3, $4)))
{
my_error(ER_PART_WRONG_VALUE, MYF(0),
Lex->create_last_non_select_table->table_name.str,
"INTERVAL");
if (unlikely(part_info->vers_set_interval(thd, $2, $3, $4)))
MYSQL_YYABORT;
}
}
| LIMIT ulonglong_num
{
...
...
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