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
81bf7d33
Commit
81bf7d33
authored
Dec 04, 2019
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bb-10.3-release' into 10.3
parents
8a46b706
bf2f3916
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
3 deletions
+46
-3
mysql-test/suite/versioning/r/delete.result
mysql-test/suite/versioning/r/delete.result
+14
-0
mysql-test/suite/versioning/r/update.result
mysql-test/suite/versioning/r/update.result
+4
-0
mysql-test/suite/versioning/t/delete.test
mysql-test/suite/versioning/t/delete.test
+15
-0
mysql-test/suite/versioning/t/update.test
mysql-test/suite/versioning/t/update.test
+5
-0
sql/sql_delete.cc
sql/sql_delete.cc
+1
-1
sql/sql_derived.cc
sql/sql_derived.cc
+2
-1
sql/sql_update.cc
sql/sql_update.cc
+1
-1
sql/table.h
sql/table.h
+4
-0
No files found.
mysql-test/suite/versioning/r/delete.result
View file @
81bf7d33
...
...
@@ -116,3 +116,17 @@ x
2
1
drop table t1;
#
# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
#
create or replace table t1 (a int) with system versioning;
replace into t1 values (1), (2);
create or replace trigger tr before delete on t1 for each row delete from xx;
create or replace procedure pr() delete from t1;
call pr;
ERROR 42S02: Table 'test.xx' doesn't exist
call pr;
ERROR 42S02: Table 'test.xx' doesn't exist
drop procedure pr;
drop trigger tr;
drop table t1;
mysql-test/suite/versioning/r/update.result
View file @
81bf7d33
...
...
@@ -295,5 +295,9 @@ primary key (pk)
create or replace view v1 as select * from t1;
insert into t1 values (1, null, 'd') , (2, null, 'i') ;
update v1 set a= null where b = '';
create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning;
insert into t1 values (1,1),(2,2);
create or replace view v1 as select * from t1;
update v1 set id= 2 where k = 0;
drop view v1;
drop table t1;
mysql-test/suite/versioning/t/delete.test
View file @
81bf7d33
...
...
@@ -79,4 +79,19 @@ delete from t1;
select
x
from
t1
for
system_time
all
;
drop
table
t1
;
--
echo
#
--
echo
# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
--
echo
#
create
or
replace
table
t1
(
a
int
)
with
system
versioning
;
replace
into
t1
values
(
1
),
(
2
);
create
or
replace
trigger
tr
before
delete
on
t1
for
each
row
delete
from
xx
;
create
or
replace
procedure
pr
()
delete
from
t1
;
--
error
ER_NO_SUCH_TABLE
call
pr
;
--
error
ER_NO_SUCH_TABLE
call
pr
;
drop
procedure
pr
;
drop
trigger
tr
;
drop
table
t1
;
--
source
suite
/
versioning
/
common_finish
.
inc
mysql-test/suite/versioning/t/update.test
View file @
81bf7d33
...
...
@@ -214,6 +214,11 @@ create or replace view v1 as select * from t1;
insert
into
t1
values
(
1
,
null
,
'd'
)
,
(
2
,
null
,
'i'
)
;
update
v1
set
a
=
null
where
b
=
''
;
create
or
replace
table
t1
(
id
int
,
k
int
,
primary
key
(
id
))
engine
=
innodb
with
system
versioning
;
insert
into
t1
values
(
1
,
1
),(
2
,
2
);
create
or
replace
view
v1
as
select
*
from
t1
;
update
v1
set
id
=
2
where
k
=
0
;
# cleanup
drop
view
v1
;
drop
table
t1
;
...
...
sql/sql_delete.cc
View file @
81bf7d33
...
...
@@ -919,7 +919,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list,
DBUG_ASSERT
(
table_list
->
table
);
// conds could be cached from previous SP call
DBUG_ASSERT
(
!
table_list
->
vers_conditions
.
is_set
()
||
DBUG_ASSERT
(
!
table_list
->
vers_conditions
.
need_setup
()
||
!*
conds
||
thd
->
stmt_arena
->
is_stmt_execute
());
if
(
select_lex
->
vers_setup_conds
(
thd
,
table_list
))
DBUG_RETURN
(
TRUE
);
...
...
sql/sql_derived.cc
View file @
81bf7d33
...
...
@@ -707,8 +707,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
case
SQLCOM_DELETE_MULTI
:
case
SQLCOM_UPDATE
:
case
SQLCOM_UPDATE_MULTI
:
if
((
res
=
unit
->
prepare
(
derived
,
derived
->
derived_result
,
0
)))
if
((
res
=
unit
->
first_select
()
->
vers_setup_conds
(
thd
,
derived
->
merge_underlying_list
)))
goto
exit
;
derived
->
where
=
and_items
(
thd
,
derived
->
where
,
derived
->
merge_underlying_list
->
where
);
default:
break
;
}
...
...
sql/sql_update.cc
View file @
81bf7d33
...
...
@@ -1266,7 +1266,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
DBUG_ASSERT
(
table_list
->
table
);
// conds could be cached from previous SP call
DBUG_ASSERT
(
!
table_list
->
vers_conditions
.
is_set
()
||
DBUG_ASSERT
(
!
table_list
->
vers_conditions
.
need_setup
()
||
!*
conds
||
thd
->
stmt_arena
->
is_stmt_execute
());
if
(
select_lex
->
vers_setup_conds
(
thd
,
table_list
))
DBUG_RETURN
(
TRUE
);
...
...
sql/table.h
View file @
81bf7d33
...
...
@@ -1912,6 +1912,10 @@ struct vers_select_conds_t
{
return
orig_type
!=
SYSTEM_TIME_UNSPECIFIED
;
}
bool
need_setup
()
const
{
return
type
!=
SYSTEM_TIME_UNSPECIFIED
&&
type
!=
SYSTEM_TIME_ALL
;
}
bool
resolve_units
(
THD
*
thd
);
bool
eq
(
const
vers_select_conds_t
&
conds
)
const
;
};
...
...
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