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
ebd03ae4
Commit
ebd03ae4
authored
Sep 06, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not use Item_ref for view fields if it is UPDATE of INSERT (BUG#5263)
parent
bb62c802
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
mysql-test/r/view.result
mysql-test/r/view.result
+9
-0
mysql-test/t/view.test
mysql-test/t/view.test
+11
-0
sql/sql_insert.cc
sql/sql_insert.cc
+5
-1
No files found.
mysql-test/r/view.result
View file @
ebd03ae4
...
...
@@ -1261,3 +1261,12 @@ create table t1 (a int);
create view v1 as select a from t1 procedure analyse();
ERROR HY000: View's SELECT contains a 'PROCEDURE' clause
drop table t1;
create table t1 (s1 int, primary key (s1));
create view v1 as select * from t1;
insert into v1 values (1) on duplicate key update s1 = 7;
insert into v1 values (1) on duplicate key update s1 = 7;
select * from t1;
s1
7
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
ebd03ae4
...
...
@@ -1219,3 +1219,14 @@ create table t1 (a int);
--
error
1349
create
view
v1
as
select
a
from
t1
procedure
analyse
();
drop
table
t1
;
#
# INSERT into VIEW with ON DUPLICATE
#
create
table
t1
(
s1
int
,
primary
key
(
s1
));
create
view
v1
as
select
*
from
t1
;
insert
into
v1
values
(
1
)
on
duplicate
key
update
s1
=
7
;
insert
into
v1
values
(
1
)
on
duplicate
key
update
s1
=
7
;
select
*
from
t1
;
drop
view
v1
;
drop
table
t1
;
sql/sql_insert.cc
View file @
ebd03ae4
...
...
@@ -582,6 +582,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
bool
insert_into_view
=
(
table_list
->
view
!=
0
);
/* TODO: use this condition for 'WITH CHECK OPTION' */
Item
*
unused_conds
=
0
;
int
res
;
DBUG_ENTER
(
"mysql_prepare_insert"
);
if
(
mysql_prepare_insert_check_table
(
thd
,
table_list
,
fields
,
&
unused_conds
))
...
...
@@ -591,7 +592,10 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
!
insert_into_view
)
||
setup_fields
(
thd
,
0
,
table_list
,
*
values
,
0
,
0
,
0
)
||
(
duplic
==
DUP_UPDATE
&&
(
setup_fields
(
thd
,
0
,
table_list
,
update_fields
,
0
,
0
,
0
)
||
((
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
1
,
(
res
=
setup_fields
(
thd
,
0
,
table_list
,
update_fields
,
0
,
0
,
0
)),
thd
->
lex
->
select_lex
.
no_wrap_view_item
=
0
,
res
)
||
setup_fields
(
thd
,
0
,
table_list
,
update_values
,
0
,
0
,
0
))))
DBUG_RETURN
(
-
1
);
...
...
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