1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0

into sanja.is.com.ua:/home/bell/mysql/bk/work-5.0


sql/item.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
This commit is contained in:
unknown
2004-09-17 19:16:54 +03:00
7 changed files with 80 additions and 43 deletions

View File

@ -922,13 +922,16 @@ create table mysqltest.v3 (b int);
grant create view on mysqltest.v3 to mysqltest_1@localhost;
drop table mysqltest.v3;
create view mysqltest.v3 as select b from mysqltest.t2;
grant create view, update on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
create view mysqltest.v3 as select b from mysqltest.t2;
grant create view, update, insert on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
create view mysqltest.v3 as select b from mysqltest.t2;
ERROR 42000: create view command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 'v3'
create table mysqltest.v3 (b int);
grant create view, update on mysqltest.v3 to mysqltest_1@localhost;
drop table mysqltest.v3;
create view mysqltest.v3 as select b from mysqltest.t2;
grant select(b) on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
drop table mysqltest.v3;
create view mysqltest.v3 as select b from mysqltest.t2;
ERROR 42000: create view command denied to user 'mysqltest_1'@'localhost' for table 'v3'
create view v4 as select b+1 from mysqltest.t2;
@ -1311,3 +1314,19 @@ a a a
3 3 3
drop view v1;
drop table t1;
create table t1 (s1 char);
create view v1 as select s1 collate latin1_german1_ci as s1 from t1;
insert into v1 values ('a');
select * from v1;
s1
a
update v1 set s1='b';
select * from v1;
s1
b
update v1,t1 set v1.s1='c' where t1.s1=v1.s1;
select * from v1;
s1
c
drop view v1;
drop table t1;

View File

@ -804,29 +804,37 @@ create view mysqltest.v1 as select * from mysqltest.t1;
-- error 1143
create view v3 as select a from mysqltest.t2;
# give CRETEA VIEW privileges but without any privileges for result colemn
# give CRETEA VIEW privileges (without any privileges for result colemn)
connection root;
create table mysqltest.v3 (b int);
grant create view on mysqltest.v3 to mysqltest_1@localhost;
drop table mysqltest.v3;
connection user1;
-- error 1143
create view mysqltest.v3 as select b from mysqltest.t2;
# give UPDATE privileges -> create works
# give UPDATE privileges
connection root;
create table mysqltest.v3 (b int);
grant create view, update on mysqltest.v3 to mysqltest_1@localhost;
drop table mysqltest.v3;
drop view mysqltest.v3;
connection user1;
create view mysqltest.v3 as select b from mysqltest.t2;
# give UPDATE and INSERT privilege (to get more privileges then anderlying
# table)
connection root;
grant create view, update, insert on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
connection user1;
-- error 1143
create view mysqltest.v3 as select b from mysqltest.t2;
# If give other privileges for VIEW then underlaying table have =>
# creation prohibited
connection root;
create table mysqltest.v3 (b int);
grant select(b) on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
drop table mysqltest.v3;
connection user1;
-- error 1142
create view mysqltest.v3 as select b from mysqltest.t2;
@ -1271,3 +1279,17 @@ 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;
#
# Collation with view update
#
create table t1 (s1 char);
create view v1 as select s1 collate latin1_german1_ci as s1 from t1;
insert into v1 values ('a');
select * from v1;
update v1 set s1='b';
select * from v1;
update v1,t1 set v1.s1='c' where t1.s1=v1.s1;
select * from v1;
drop view v1;
drop table t1;