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
5c760d95
Commit
5c760d95
authored
Dec 21, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Parser: default SYSTEM_TIME ALL for DELETE HISTORY
parent
36888cc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
19 deletions
+28
-19
mysql-test/suite/versioning/r/truncate.result
mysql-test/suite/versioning/r/truncate.result
+8
-8
mysql-test/suite/versioning/t/truncate.test
mysql-test/suite/versioning/t/truncate.test
+8
-8
sql/sql_yacc.yy
sql/sql_yacc.yy
+12
-3
No files found.
mysql-test/suite/versioning/r/truncate.result
View file @
5c760d95
...
...
@@ -7,7 +7,7 @@ update t set a=2;
set @test = 'correct';
create trigger trg_before before delete on t for each row set @test = 'incorrect';
create trigger trg_after after delete on t for each row set @test = 'incorrect';
delete history from t
before system_time now(6)
;
delete history from t;
select @test from t;
@test
correct
...
...
@@ -29,7 +29,7 @@ a
11
22
2
prepare stmt from 'delete history from t
before system_time timestamp now(6)
';
prepare stmt from 'delete history from t';
execute stmt;
drop prepare stmt;
select * from t for system_time all;
...
...
@@ -52,20 +52,20 @@ engine myisam
partition by system_time (
partition p0 history,
partition pn current);
delete history from t
before system_time current_timestamp
;
delete history from t;
ERROR 42000: The used command is not allowed with this MariaDB version
create or replace table t (i int) with system versioning;
delete history from t
before system_time now()
;
delete history from t;
create or replace view v as select * from t;
delete history from v
before system_time now()
;
delete history from v;
ERROR HY000: DELETE HISTORY from VIEW is prohibited
create or replace table t (i int);
delete history from t
before system_time now()
;
delete history from t;
ERROR HY000: Table `t` is not system-versioned
create or replace view v as select * from t;
delete history from v
before system_time now()
;
delete history from v;
ERROR HY000: DELETE HISTORY from VIEW is prohibited
prepare stmt from 'delete history from t
before system_time now()
';
prepare stmt from 'delete history from t';
ERROR HY000: Table `t` is not system-versioned
drop table t;
drop view v;
mysql-test/suite/versioning/t/truncate.test
View file @
5c760d95
...
...
@@ -11,7 +11,7 @@ update t set a=2;
set
@
test
=
'correct'
;
create
trigger
trg_before
before
delete
on
t
for
each
row
set
@
test
=
'incorrect'
;
create
trigger
trg_after
after
delete
on
t
for
each
row
set
@
test
=
'incorrect'
;
delete
history
from
t
before
system_time
now
(
6
)
;
delete
history
from
t
;
select
@
test
from
t
;
drop
table
t
;
...
...
@@ -25,7 +25,7 @@ update t set a=22 where a=2;
select
*
from
t
for
system_time
all
;
delete
history
from
t
before
system_time
timestamp
@
ts1
;
select
*
from
t
for
system_time
all
;
prepare
stmt
from
'delete history from t
before system_time timestamp now(6)
'
;
prepare
stmt
from
'delete history from t'
;
execute
stmt
;
drop
prepare
stmt
;
select
*
from
t
for
system_time
all
;
delete
from
t
;
...
...
@@ -51,22 +51,22 @@ partition by system_time (
partition
pn
current
);
--
error
ER_NOT_ALLOWED_COMMAND
delete
history
from
t
before
system_time
current_timestamp
;
delete
history
from
t
;
create
or
replace
table
t
(
i
int
)
with
system
versioning
;
delete
history
from
t
before
system_time
now
()
;
delete
history
from
t
;
create
or
replace
view
v
as
select
*
from
t
;
--
error
ER_VERS_TRUNCATE_VIEW
delete
history
from
v
before
system_time
now
()
;
delete
history
from
v
;
create
or
replace
table
t
(
i
int
);
--
error
ER_VERS_NOT_VERSIONED
delete
history
from
t
before
system_time
now
()
;
delete
history
from
t
;
create
or
replace
view
v
as
select
*
from
t
;
--
error
ER_VERS_TRUNCATE_VIEW
delete
history
from
v
before
system_time
now
()
;
delete
history
from
v
;
--
error
ER_VERS_NOT_VERSIONED
prepare
stmt
from
'delete history from t
before system_time now()
'
;
prepare
stmt
from
'delete history from t'
;
drop
table
t
;
drop
view
v
;
sql/sql_yacc.yy
View file @
5c760d95
...
...
@@ -13406,12 +13406,21 @@ delete:
delete_part2
;
opt_delete_system_time:
/* empty */
{
Lex->vers_conditions.init(SYSTEM_TIME_ALL);
}
| BEFORE_SYM SYSTEM_TIME_SYM opt_trans_or_timestamp simple_expr
{
Lex->vers_conditions.init(SYSTEM_TIME_BEFORE, $3, $4);
}
;
delete_part2:
opt_delete_options single_multi {}
| HISTORY_SYM delete_single_table
BEFORE_SYM SYSTEM_TIME_SYM opt_trans_or_timestamp simple_expr
| HISTORY_SYM delete_single_table opt_delete_system_time
{
Lex->vers_conditions.init(SYSTEM_TIME_BEFORE, $5, $6);
Lex->last_table()->vers_conditions= Lex->vers_conditions;
}
;
...
...
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