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
bcadf50b
Commit
bcadf50b
authored
Sep 11, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
parents
974a13d0
3c239d0b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
9 deletions
+65
-9
mysql-test/r/view.result
mysql-test/r/view.result
+23
-0
mysql-test/t/view.test
mysql-test/t/view.test
+13
-0
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql
+12
-0
sql/table.cc
sql/table.cc
+17
-9
No files found.
mysql-test/r/view.result
View file @
bcadf50b
...
...
@@ -1288,3 +1288,26 @@ handler v1 open as xx;
ERROR HY000: 'test.v1' is not BASE TABLE
drop view v1;
drop table t1;
create table t1(a int);
insert into t1 values (0), (1), (2), (3);
create table t2 (a int);
insert into t2 select a from t1 where a > 1;
create view v1 as select a from t1 where a > 1;
select * from t1 left join (t2 as t, v1) on v1.a=t1.a;
a a a
0 NULL NULL
1 NULL NULL
2 2 2
2 3 2
3 2 3
3 3 3
select * from t1 left join (t2 as t, t2) on t2.a=t1.a;
a a a
0 NULL NULL
1 NULL NULL
2 2 2
2 3 2
3 2 3
3 3 3
drop view v1;
drop table t1;
mysql-test/t/view.test
View file @
bcadf50b
...
...
@@ -1258,3 +1258,16 @@ create view v1 as select * from t1;
handler
v1
open
as
xx
;
drop
view
v1
;
drop
table
t1
;
#
# view with WHERE in nested join
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
0
),
(
1
),
(
2
),
(
3
);
create
table
t2
(
a
int
);
insert
into
t2
select
a
from
t1
where
a
>
1
;
create
view
v1
as
select
a
from
t1
where
a
>
1
;
select
*
from
t1
left
join
(
t2
as
t
,
v1
)
on
v1
.
a
=
t1
.
a
;
select
*
from
t1
left
join
(
t2
as
t
,
t2
)
on
t2
.
a
=
t1
.
a
;
drop
view
v1
;
drop
table
t1
;
scripts/mysql_fix_privilege_tables.sql
View file @
bcadf50b
...
...
@@ -144,6 +144,13 @@ alter table user comment='Users and global privileges';
alter
table
func
comment
=
'User defined functions'
;
alter
table
tables_priv
comment
=
'Table privileges'
;
alter
table
columns_priv
comment
=
'Column privileges'
;
#
#
Detect
whether
we
had
Create_view_priv
#
SET
@
hadCreateViewPriv
:
=
0
;
SELECT
@
hadCreateViewPriv
:
=
1
FROM
user
WHERE
Create_view_priv
LIKE
'%'
;
#
#
Create
VIEWs
privileges
(
v5
.
0
)
#
...
...
@@ -158,6 +165,11 @@ ALTER TABLE db ADD Show_view_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Creat
ALTER
TABLE
host
ADD
Show_view_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Create_view_priv
;
ALTER
TABLE
user
ADD
Show_view_priv
enum
(
'N'
,
'Y'
)
DEFAULT
'N'
NOT
NULL
AFTER
Create_view_priv
;
#
#
Assign
create
/
show
view
privileges
to
people
who
have
create
provileges
#
UPDATE
user
SET
Create_view_priv
=
Create_priv
,
Show_view_priv
=
Create_priv
where
user
<>
""
AND
@
hadCreateViewPriv
=
0
;
#
#
Create
some
possible
missing
tables
#
...
...
sql/table.cc
View file @
bcadf50b
...
...
@@ -1583,6 +1583,7 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
if
(
where
)
{
Item_arena
*
arena
=
thd
->
current_arena
,
backup
;
TABLE_LIST
*
tbl
=
this
;
if
(
arena
->
is_conventional
())
arena
=
0
;
// For easier test
...
...
@@ -1591,7 +1592,11 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
if
(
arena
)
thd
->
set_n_backup_item_arena
(
arena
,
&
backup
);
if
(
outer_join
)
/* Go up to join tree and try to find left join */
for
(;
tbl
;
tbl
=
tbl
->
embedding
)
{
if
(
tbl
->
outer_join
)
{
/*
Store WHERE condition to ON expression for outer join, because we
...
...
@@ -1599,9 +1604,11 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
expression will not be moved to WHERE condition (i.e. will be clean
correctly for PS/SP)
*/
on_expr
=
and_conds
(
on_expr
,
where
);
tbl
->
on_expr
=
and_conds
(
tbl
->
on_expr
,
where
);
break
;
}
else
}
if
(
tbl
==
0
)
{
/*
It is conds of JOIN, but it will be stored in st_select_lex::prep_where
...
...
@@ -1609,6 +1616,7 @@ bool st_table_list::setup_ancestor(THD *thd, Item **conds)
*/
*
conds
=
and_conds
(
*
conds
,
where
);
}
if
(
arena
)
thd
->
restore_backup_item_arena
(
arena
,
&
backup
);
}
...
...
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