Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


Quelle  deny_metadata.result   Sprache: Lisp

 

#
# DENY metadata behavior
#
#
# Direct DENY should affect SHOW COLUMNS
#
CREATE TABLE t1 (id INT);
CREATE TABLE t2 (c1 INT);
CREATE USER u@localhost;
CREATE ROLE r;
GRANT SELECT ON test.t1 TO r;
GRANT SELECT ON test.t2 TO r;
DENY SELECT ON test.t1 TO r;
GRANT r TO u@localhost;
connect  con1, localhost, u,,;
SET ROLE r;
SHOW COLUMNS FROM test.t1;
ERROR 42000: SELECT command denied to user 'u'@'localhost' for table `test`.`t1`
SHOW COLUMNS FROM test.t2;
Field Type Null Key Default Extra
c1 int(11) YES  NULL 
disconnect con1;
connection default;
DROP ROLE r;
DROP USER u@localhost;
DROP TABLE t1;
#
# Column-level GRANT+DENY should block SHOW COLUMNS
#
CREATE TABLE t1 (a INT, b INT);
CREATE USER u@localhost;
GRANT SELECT (a) ON test.t1 TO u@localhost;
DENY SELECT (a) ON test.t1 TO u@localhost;
connect  con2, localhost, u,,;
SHOW COLUMNS FROM test.t1;
ERROR 42000: SELECT command denied to user 'u'@'localhost' for table `test`.`t1`
disconnect con2;
connection default;
DROP USER u@localhost;
DROP TABLE t1;
#
# Mixed column GRANT+DENY should allow SHOW COLUMNS
#
CREATE TABLE t1 (a INT, b INT);
CREATE USER u@localhost;
GRANT SELECT (a) ON test.t1 TO u@localhost;
DENY SELECT (b) ON test.t1 TO u@localhost;
connect  con2, localhost, u,,;
SHOW COLUMNS FROM test.t1;
Field Type Null Key Default Extra
a int(11) YES  NULL 
disconnect con2;
connection default;
DROP USER u@localhost;
DROP TABLE t1;
#
# Higher level DENY should block SHOW COLUMNS
#
CREATE TABLE t1 (a INT);
CREATE USER u@localhost;
CREATE ROLE r;
GRANT SELECT ON test.t1 TO r;
GRANT r TO u@localhost;
#
# Database-level DENY
#
DENY SELECT ON test.* TO r;
connect  con3, localhost, u,,;
SET ROLE r;
SHOW COLUMNS FROM test.t1;
ERROR 42000: SELECT command denied to user 'u'@'localhost' for table `test`.`t1`
disconnect con3;
connection default;
REVOKE DENY SELECT ON test.* FROM r;
DROP ROLE r;
DROP USER u@localhost;
DROP TABLE t1;
DROP TABLE t2;

Messung
CHZG
979710097

¤ Dauer der Verarbeitung: 0.16 Sekunden  ¤

*© Formatika GbR, Deutschland







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

Open Source Software


Gedichte
Musik
Bilder

Jenseits des Üblichen

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1,188,022
#Domains=861,070