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
da64c1ea
Commit
da64c1ea
authored
Sep 02, 2005
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postmerge changes
parent
dd7ab170
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
81 deletions
+74
-81
mysql-test/t/lowercase_view.test
mysql-test/t/lowercase_view.test
+34
-34
mysql-test/t/view.test
mysql-test/t/view.test
+36
-36
sql/item.cc
sql/item.cc
+1
-4
sql/sql_base.cc
sql/sql_base.cc
+2
-4
sql/sql_insert.cc
sql/sql_insert.cc
+1
-3
No files found.
mysql-test/t/lowercase_view.test
View file @
da64c1ea
...
@@ -23,29 +23,29 @@ create table t2aA (col1 int);
...
@@ -23,29 +23,29 @@ create table t2aA (col1 int);
create
view
v1Aa
as
select
*
from
t1aA
;
create
view
v1Aa
as
select
*
from
t1aA
;
create
view
v2aA
as
select
*
from
v1aA
;
create
view
v2aA
as
select
*
from
v1aA
;
create
view
v3Aa
as
select
v2Aa
.
col1
from
v2aA
,
t2Aa
where
v2Aa
.
col1
=
t2aA
.
col1
;
create
view
v3Aa
as
select
v2Aa
.
col1
from
v2aA
,
t2Aa
where
v2Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v2aA
set
col1
=
(
select
max
(
col1
)
from
v1Aa
);
update
v2aA
set
col1
=
(
select
max
(
col1
)
from
v1Aa
);
--
error
14
2
3
--
error
14
4
3
update
v2Aa
set
col1
=
(
select
max
(
col1
)
from
t1Aa
);
update
v2Aa
set
col1
=
(
select
max
(
col1
)
from
t1Aa
);
--
error
1093
--
error
1093
update
v2aA
set
col1
=
(
select
max
(
col1
)
from
v2Aa
);
update
v2aA
set
col1
=
(
select
max
(
col1
)
from
v2Aa
);
--
error
14
2
3
--
error
14
4
3
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v2aA
.
col1
=
t2aA
.
col1
;
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v2aA
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t1aA
,
t2Aa
set
t1Aa
.
col1
=
(
select
max
(
col1
)
from
v1Aa
)
where
t1aA
.
col1
=
t2aA
.
col1
;
update
t1aA
,
t2Aa
set
t1Aa
.
col1
=
(
select
max
(
col1
)
from
v1Aa
)
where
t1aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
v2Aa
set
v2aA
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v2Aa
set
v2aA
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
t1Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
v1Aa
)
where
t1Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
t1Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
v1Aa
)
where
t1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
v1aA
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v1aA
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
t1aA
)
where
v2aA
.
col1
=
t2aA
.
col1
;
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
t1aA
)
where
v2aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
update
t1Aa
,
t2Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
t1aA
.
col1
=
t2aA
.
col1
;
update
t1Aa
,
t2Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
t1aA
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
v1aA
.
col1
=
t2aA
.
col1
;
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
v1aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
update
t2Aa
,
v2Aa
set
v2aA
.
col1
=
(
select
max
(
col1
)
from
t1aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v2Aa
set
v2aA
.
col1
=
(
select
max
(
col1
)
from
t1aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
...
@@ -55,71 +55,71 @@ update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 =
...
@@ -55,71 +55,71 @@ update t2Aa,t1Aa set t1aA.col1 = (select max(col1) from t1Aa) where t1aA.col1 =
update
t2Aa
,
v1Aa
set
v1aA
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v1Aa
set
v1aA
.
col1
=
(
select
max
(
col1
)
from
t1Aa
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
update
v2aA
,
t2Aa
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t1aA
,
t2Aa
set
t1Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
t1aA
.
col1
=
t2aA
.
col1
;
update
t1aA
,
t2Aa
set
t1Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
t1aA
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v2Aa
)
where
v1aA
.
col1
=
t2aA
.
col1
;
update
v1aA
,
t2Aa
set
v1Aa
.
col1
=
(
select
max
(
col1
)
from
v2Aa
)
where
v1aA
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
v2aA
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v2aA
set
v2Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
v2Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
t1Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
t1Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
t1Aa
set
t1aA
.
col1
=
(
select
max
(
col1
)
from
v2aA
)
where
t1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2Aa
,
v1Aa
set
v1aA
.
col1
=
(
select
max
(
col1
)
from
v2Aa
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
update
t2Aa
,
v1Aa
set
v1aA
.
col1
=
(
select
max
(
col1
)
from
v2Aa
)
where
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
);
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v1aA
);
--
error
14
2
3
--
error
14
4
3
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
t1aA
);
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
t1aA
);
--
error
14
2
3
--
error
14
4
3
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
);
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v2aA
);
--
error
1093
--
error
1093
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v3aA
);
update
v3aA
set
v3Aa
.
col1
=
(
select
max
(
col1
)
from
v3aA
);
--
error
14
2
3
--
error
14
4
3
delete
from
v2Aa
where
col1
=
(
select
max
(
col1
)
from
v1Aa
);
delete
from
v2Aa
where
col1
=
(
select
max
(
col1
)
from
v1Aa
);
--
error
14
2
3
--
error
14
4
3
delete
from
v2aA
where
col1
=
(
select
max
(
col1
)
from
t1Aa
);
delete
from
v2aA
where
col1
=
(
select
max
(
col1
)
from
t1Aa
);
--
error
1093
--
error
1093
delete
from
v2Aa
where
col1
=
(
select
max
(
col1
)
from
v2aA
);
delete
from
v2Aa
where
col1
=
(
select
max
(
col1
)
from
v2aA
);
--
error
14
2
3
--
error
14
4
3
delete
v2Aa
from
v2aA
,
t2Aa
where
(
select
max
(
col1
)
from
v1aA
)
>
0
and
v2Aa
.
col1
=
t2aA
.
col1
;
delete
v2Aa
from
v2aA
,
t2Aa
where
(
select
max
(
col1
)
from
v1aA
)
>
0
and
v2Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
t1aA
from
t1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
v1Aa
)
>
0
and
t1aA
.
col1
=
t2aA
.
col1
;
delete
t1aA
from
t1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
v1Aa
)
>
0
and
t1aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
delete
v1aA
from
v1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
v1aA
)
>
0
and
v1Aa
.
col1
=
t2aA
.
col1
;
delete
v1aA
from
v1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
v1aA
)
>
0
and
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v2aA
from
v2Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1Aa
)
>
0
and
v2aA
.
col1
=
t2aA
.
col1
;
delete
v2aA
from
v2Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1Aa
)
>
0
and
v2aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
delete
t1aA
from
t1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1aA
)
>
0
and
t1Aa
.
col1
=
t2aA
.
col1
;
delete
t1aA
from
t1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1aA
)
>
0
and
t1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v1aA
from
v1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1aA
)
>
0
and
v1aA
.
col1
=
t2aA
.
col1
;
delete
v1aA
from
v1Aa
,
t2Aa
where
(
select
max
(
col1
)
from
t1aA
)
>
0
and
v1aA
.
col1
=
t2aA
.
col1
;
--
error
1093
--
error
1093
delete
v2Aa
from
v2aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2Aa
)
>
0
and
v2aA
.
col1
=
t2aA
.
col1
;
delete
v2Aa
from
v2aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2Aa
)
>
0
and
v2aA
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
t1Aa
from
t1aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2Aa
)
>
0
and
t1Aa
.
col1
=
t2aA
.
col1
;
delete
t1Aa
from
t1aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2Aa
)
>
0
and
t1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v1Aa
from
v1aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2aA
)
>
0
and
v1Aa
.
col1
=
t2aA
.
col1
;
delete
v1Aa
from
v1aA
,
t2Aa
where
(
select
max
(
col1
)
from
v2aA
)
>
0
and
v1Aa
.
col1
=
t2aA
.
col1
;
--
error
14
2
3
--
error
14
4
3
insert
into
v2Aa
values
((
select
max
(
col1
)
from
v1aA
));
insert
into
v2Aa
values
((
select
max
(
col1
)
from
v1aA
));
--
error
14
2
3
--
error
14
4
3
insert
into
t1aA
values
((
select
max
(
col1
)
from
v1Aa
));
insert
into
t1aA
values
((
select
max
(
col1
)
from
v1Aa
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2aA
values
((
select
max
(
col1
)
from
v1aA
));
insert
into
v2aA
values
((
select
max
(
col1
)
from
v1aA
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2Aa
values
((
select
max
(
col1
)
from
t1Aa
));
insert
into
v2Aa
values
((
select
max
(
col1
)
from
t1Aa
));
--
error
1093
--
error
1093
insert
into
t1aA
values
((
select
max
(
col1
)
from
t1Aa
));
insert
into
t1aA
values
((
select
max
(
col1
)
from
t1Aa
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2aA
values
((
select
max
(
col1
)
from
t1aA
));
insert
into
v2aA
values
((
select
max
(
col1
)
from
t1aA
));
--
error
1093
--
error
1093
insert
into
v2Aa
values
((
select
max
(
col1
)
from
v2aA
));
insert
into
v2Aa
values
((
select
max
(
col1
)
from
v2aA
));
--
error
14
2
3
--
error
14
4
3
insert
into
t1Aa
values
((
select
max
(
col1
)
from
v2Aa
));
insert
into
t1Aa
values
((
select
max
(
col1
)
from
v2Aa
));
--
error
1093
--
error
1093
insert
into
v2aA
values
((
select
max
(
col1
)
from
v2Aa
));
insert
into
v2aA
values
((
select
max
(
col1
)
from
v2Aa
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3Aa
(
col1
)
values
((
select
max
(
col1
)
from
v1Aa
));
insert
into
v3Aa
(
col1
)
values
((
select
max
(
col1
)
from
v1Aa
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3aA
(
col1
)
values
((
select
max
(
col1
)
from
t1aA
));
insert
into
v3aA
(
col1
)
values
((
select
max
(
col1
)
from
t1aA
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3Aa
(
col1
)
values
((
select
max
(
col1
)
from
v2aA
));
insert
into
v3Aa
(
col1
)
values
((
select
max
(
col1
)
from
v2aA
));
drop
view
v3aA
,
v2Aa
,
v1aA
;
drop
view
v3aA
,
v2Aa
,
v1aA
;
drop
table
t1Aa
,
t2Aa
;
drop
table
t1Aa
,
t2Aa
;
...
...
mysql-test/t/view.test
View file @
da64c1ea
...
@@ -827,29 +827,29 @@ create table t2 (col1 int);
...
@@ -827,29 +827,29 @@ create table t2 (col1 int);
create
view
v1
as
select
*
from
t1
;
create
view
v1
as
select
*
from
t1
;
create
view
v2
as
select
*
from
v1
;
create
view
v2
as
select
*
from
v1
;
create
view
v3
as
select
v2
.
col1
from
v2
,
t2
where
v2
.
col1
=
t2
.
col1
;
create
view
v3
as
select
v2
.
col1
from
v2
,
t2
where
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v2
set
col1
=
(
select
max
(
col1
)
from
v1
);
update
v2
set
col1
=
(
select
max
(
col1
)
from
v1
);
--
error
14
2
3
--
error
14
4
3
update
v2
set
col1
=
(
select
max
(
col1
)
from
t1
);
update
v2
set
col1
=
(
select
max
(
col1
)
from
t1
);
--
error
1093
--
error
1093
update
v2
set
col1
=
(
select
max
(
col1
)
from
v2
);
update
v2
set
col1
=
(
select
max
(
col1
)
from
v2
);
--
error
14
2
3
--
error
14
4
3
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v2
.
col1
=
t2
.
col1
;
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
t1
.
col1
=
t2
.
col1
;
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
t1
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v1
.
col1
=
t2
.
col1
;
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v2
.
col1
=
t2
.
col1
;
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
t1
set
t1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
t1
.
col1
=
t2
.
col1
;
update
t2
,
t1
set
t1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v1
.
col1
=
t2
.
col1
;
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
v1
)
where
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v2
.
col1
=
t2
.
col1
;
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v2
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
t1
.
col1
=
t2
.
col1
;
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v1
.
col1
=
t2
.
col1
;
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v1
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v2
.
col1
=
t2
.
col1
;
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v2
.
col1
=
t2
.
col1
;
...
@@ -859,74 +859,74 @@ update t2,t1 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
...
@@ -859,74 +859,74 @@ update t2,t1 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v1
.
col1
=
t2
.
col1
;
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
t1
)
where
v1
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v2
.
col1
=
t2
.
col1
;
update
v2
,
t2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
t1
.
col1
=
t2
.
col1
;
update
t1
,
t2
set
t1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v1
.
col1
=
t2
.
col1
;
update
v1
,
t2
set
v1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v2
.
col1
=
t2
.
col1
;
update
t2
,
v2
set
v2
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
t1
set
t1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
t1
.
col1
=
t2
.
col1
;
update
t2
,
t1
set
t1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v1
.
col1
=
t2
.
col1
;
update
t2
,
v1
set
v1
.
col1
=
(
select
max
(
col1
)
from
v2
)
where
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v1
);
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v1
);
--
error
14
2
3
--
error
14
4
3
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
t1
);
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
t1
);
--
error
14
2
3
--
error
14
4
3
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v2
);
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v2
);
--
error
1093
--
error
1093
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v3
);
update
v3
set
v3
.
col1
=
(
select
max
(
col1
)
from
v3
);
--
error
14
2
3
--
error
14
4
3
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
v1
);
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
v1
);
--
error
14
2
3
--
error
14
4
3
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
t1
);
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
t1
);
--
error
1093
--
error
1093
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
v2
);
delete
from
v2
where
col1
=
(
select
max
(
col1
)
from
v2
);
--
error
14
2
3
--
error
14
4
3
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
v2
.
col1
=
t2
.
col1
;
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
t1
.
col1
=
t2
.
col1
;
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
t1
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
v1
.
col1
=
t2
.
col1
;
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
v1
)
>
0
and
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
v2
.
col1
=
t2
.
col1
;
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
v2
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
t1
.
col1
=
t2
.
col1
;
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
v1
.
col1
=
t2
.
col1
;
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
t1
)
>
0
and
v1
.
col1
=
t2
.
col1
;
--
error
1093
--
error
1093
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
v2
.
col1
=
t2
.
col1
;
delete
v2
from
v2
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
v2
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
t1
.
col1
=
t2
.
col1
;
delete
t1
from
t1
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
t1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
v1
.
col1
=
t2
.
col1
;
delete
v1
from
v1
,
t2
where
(
select
max
(
col1
)
from
v2
)
>
0
and
v1
.
col1
=
t2
.
col1
;
--
error
14
2
3
--
error
14
4
3
insert
into
v2
values
((
select
max
(
col1
)
from
v1
));
insert
into
v2
values
((
select
max
(
col1
)
from
v1
));
--
error
14
2
3
--
error
14
4
3
insert
into
t1
values
((
select
max
(
col1
)
from
v1
));
insert
into
t1
values
((
select
max
(
col1
)
from
v1
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2
values
((
select
max
(
col1
)
from
v1
));
insert
into
v2
values
((
select
max
(
col1
)
from
v1
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2
values
((
select
max
(
col1
)
from
t1
));
insert
into
v2
values
((
select
max
(
col1
)
from
t1
));
--
error
1093
--
error
1093
insert
into
t1
values
((
select
max
(
col1
)
from
t1
));
insert
into
t1
values
((
select
max
(
col1
)
from
t1
));
--
error
14
2
3
--
error
14
4
3
insert
into
v2
values
((
select
max
(
col1
)
from
t1
));
insert
into
v2
values
((
select
max
(
col1
)
from
t1
));
--
error
1093
--
error
1093
insert
into
v2
values
((
select
max
(
col1
)
from
v2
));
insert
into
v2
values
((
select
max
(
col1
)
from
v2
));
--
error
14
2
3
--
error
14
4
3
insert
into
t1
values
((
select
max
(
col1
)
from
v2
));
insert
into
t1
values
((
select
max
(
col1
)
from
v2
));
--
error
1093
--
error
1093
insert
into
v2
values
((
select
max
(
col1
)
from
v2
));
insert
into
v2
values
((
select
max
(
col1
)
from
v2
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
v1
));
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
v1
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
t1
));
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
t1
));
--
error
14
2
3
--
error
14
4
3
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
v2
));
insert
into
v3
(
col1
)
values
((
select
max
(
col1
)
from
v2
));
#check with TZ tables in list
#check with TZ tables in list
--
error
14
2
3
--
error
14
4
3
insert
into
v3
(
col1
)
values
((
select
CONVERT_TZ
(
'20050101000000'
,
'UTC'
,
'MET'
)
from
v2
));
insert
into
v3
(
col1
)
values
((
select
CONVERT_TZ
(
'20050101000000'
,
'UTC'
,
'MET'
)
from
v2
));
insert
into
v3
(
col1
)
values
((
select
CONVERT_TZ
(
'20050101000000'
,
'UTC'
,
'MET'
)
from
t2
));
insert
into
v3
(
col1
)
values
((
select
CONVERT_TZ
(
'20050101000000'
,
'UTC'
,
'MET'
)
from
t2
));
--
error
1048
--
error
1048
...
@@ -1769,7 +1769,7 @@ create view v1 as select f59, f60 from t1 where f59 in
...
@@ -1769,7 +1769,7 @@ create view v1 as select f59, f60 from t1 where f59 in
(
select
f59
from
t1
);
(
select
f59
from
t1
);
--
error
1288
--
error
1288
update
v1
set
f60
=
2345
;
update
v1
set
f60
=
2345
;
--
error
14
2
3
--
error
14
4
3
update
t1
set
f60
=
(
select
max
(
f60
)
from
v1
);
update
t1
set
f60
=
(
select
max
(
f60
)
from
v1
);
drop
view
v1
;
drop
view
v1
;
drop
table
t1
;
drop
table
t1
;
...
...
sql/item.cc
View file @
da64c1ea
...
@@ -4980,10 +4980,7 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions)
...
@@ -4980,10 +4980,7 @@ int Item_default_value::save_in_field(Field *field_arg, bool no_conversions)
{
{
if
(
context
->
error_processor
==
&
view_error_processor
)
if
(
context
->
error_processor
==
&
view_error_processor
)
{
{
TABLE_LIST
*
view
=
(
cached_table
->
belong_to_view
?
TABLE_LIST
*
view
=
cached_table
->
top_table
();
cached_table
->
belong_to_view
:
cached_table
);
// TODO: make correct error message
push_warning_printf
(
field_arg
->
table
->
in_use
,
push_warning_printf
(
field_arg
->
table
->
in_use
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_NO_DEFAULT_FOR_VIEW_FIELD
,
ER_NO_DEFAULT_FOR_VIEW_FIELD
,
...
...
sql/sql_base.cc
View file @
da64c1ea
...
@@ -1864,7 +1864,7 @@ err:
...
@@ -1864,7 +1864,7 @@ err:
if
(
thd
->
net
.
last_errno
==
ER_NO_SUCH_TABLE
&&
if
(
thd
->
net
.
last_errno
==
ER_NO_SUCH_TABLE
&&
table_desc
&&
table_desc
->
belong_to_view
)
table_desc
&&
table_desc
->
belong_to_view
)
{
{
TABLE_LIST
*
view
=
table_desc
->
belong_to_view
;
TABLE_LIST
*
view
=
table_desc
->
belong_to_view
;
thd
->
clear_error
();
thd
->
clear_error
();
my_error
(
ER_VIEW_INVALID
,
MYF
(
0
),
view
->
view_db
.
str
,
view
->
view_name
.
str
);
my_error
(
ER_VIEW_INVALID
,
MYF
(
0
),
view
->
view_db
.
str
,
view
->
view_name
.
str
);
}
}
...
@@ -4624,9 +4624,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
...
@@ -4624,9 +4624,7 @@ int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
/* process CHECK OPTION */
/* process CHECK OPTION */
if
(
it_is_update
)
if
(
it_is_update
)
{
{
TABLE_LIST
*
view
=
table
->
belong_to_view
;
TABLE_LIST
*
view
=
table
->
top_table
();
if
(
!
view
)
view
=
table
;
if
(
view
->
effective_with_check
)
if
(
view
->
effective_with_check
)
{
{
if
(
view
->
prepare_check_option
(
thd
))
if
(
view
->
prepare_check_option
(
thd
))
...
...
sql/sql_insert.cc
View file @
da64c1ea
...
@@ -1195,9 +1195,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
...
@@ -1195,9 +1195,7 @@ int check_that_all_fields_are_given_values(THD *thd, TABLE *entry,
bool
view
=
FALSE
;
bool
view
=
FALSE
;
if
(
table_list
)
if
(
table_list
)
{
{
table_list
=
(
table_list
->
belong_to_view
?
table_list
=
table_list
->
top_table
();
table_list
->
belong_to_view
:
table_list
);
view
=
test
(
table_list
->
view
);
view
=
test
(
table_list
->
view
);
}
}
if
(
view
)
if
(
view
)
...
...
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