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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
917cb3df
Commit
917cb3df
authored
May 06, 2005
by
dlenev@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg9841
parents
788678d3
d60674d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
14 deletions
+42
-14
mysql-test/r/sp.result
mysql-test/r/sp.result
+8
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+19
-0
sql/sql_view.cc
sql/sql_view.cc
+15
-14
No files found.
mysql-test/r/sp.result
View file @
917cb3df
...
@@ -3057,4 +3057,12 @@ yes
...
@@ -3057,4 +3057,12 @@ yes
yes
yes
drop procedure bug7293|
drop procedure bug7293|
delete from t1|
delete from t1|
drop procedure if exists bug9841|
drop view if exists v1|
create view v1 as select * from t1, t2 where id = s|
create procedure bug9841 ()
update v1 set data = 10|
call bug9841()|
drop view v1|
drop procedure bug9841|
drop table t1,t2;
drop table t1,t2;
mysql-test/t/sp.test
View file @
917cb3df
...
@@ -3741,6 +3741,25 @@ call bug7293 ('secrete')|
...
@@ -3741,6 +3741,25 @@ call bug7293 ('secrete')|
drop
procedure
bug7293
|
drop
procedure
bug7293
|
delete
from
t1
|
delete
from
t1
|
#
# BUG#9841: Unexpected read lock when trying to update a view in a
# stored procedure
#
--
disable_warnings
drop
procedure
if
exists
bug9841
|
drop
view
if
exists
v1
|
--
enable_warnings
create
view
v1
as
select
*
from
t1
,
t2
where
id
=
s
|
create
procedure
bug9841
()
update
v1
set
data
=
10
|
call
bug9841
()
|
drop
view
v1
|
drop
procedure
bug9841
|
#
#
# BUG#NNNN: New bug synopsis
# BUG#NNNN: New bug synopsis
#
#
...
...
sql/sql_view.cc
View file @
917cb3df
...
@@ -716,6 +716,16 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
...
@@ -716,6 +716,16 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
table
->
next_global
=
view_tables
;
table
->
next_global
=
view_tables
;
}
}
/*
Let us set proper lock type for tables of the view's main select
since we may want to perform update or insert on view. This won't
work for view containing union. But this is ok since we don't
allow insert and update on such views anyway.
*/
if
(
!
lex
->
select_lex
.
next_select
())
for
(
tbl
=
lex
->
select_lex
.
get_table_list
();
tbl
;
tbl
=
tbl
->
next_local
)
tbl
->
lock_type
=
table
->
lock_type
;
/*
/*
If we are opening this view as part of implicit LOCK TABLES, then
If we are opening this view as part of implicit LOCK TABLES, then
this view serves as simple placeholder and we should not continue
this view serves as simple placeholder and we should not continue
...
@@ -756,23 +766,14 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
...
@@ -756,23 +766,14 @@ mysql_make_view(File_parser *parser, TABLE_LIST *table)
table
->
ancestor
=
view_tables
;
table
->
ancestor
=
view_tables
;
/*
/*
Process upper level tables of view. As far as we do noy suport union
Tables of the main select of the view should be marked as belonging
here we can go through local tables of view most upper SELECT
to the same select as original view (again we can use LEX::select_lex
for this purprose because we don't support MERGE algorithm for views
with unions).
*/
*/
for
(
tbl
=
view_tables
;
for
(
tbl
=
lex
->
select_lex
.
get_table_list
();
tbl
;
tbl
=
tbl
->
next_local
)
tbl
;
tbl
=
tbl
->
next_local
)
{
/* next table should include SELECT_LEX under this table SELECT_LEX */
tbl
->
select_lex
=
table
->
select_lex
;
tbl
->
select_lex
=
table
->
select_lex
;
/*
move lock type (TODO: should we issue error in case of TMPTABLE
algorithm and non-read locking)?
*/
tbl
->
lock_type
=
table
->
lock_type
;
}
/* multi table view */
/* multi table view */
if
(
view_tables
->
next_local
)
if
(
view_tables
->
next_local
)
{
{
...
...
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