mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Adding grant tests for TABLE_TYPE=xml
modified: mysql-test/suite/connect/r/xml.result mysql-test/suite/connect/t/bin.test mysql-test/suite/connect/t/csv.test mysql-test/suite/connect/t/dbf.test mysql-test/suite/connect/t/fix.test mysql-test/suite/connect/t/grant.inc mysql-test/suite/connect/t/xml.test
This commit is contained in:
parent
73d39bba95
commit
bc10400157
7 changed files with 91 additions and 7 deletions
|
@ -1,5 +1,84 @@
|
|||
Warnings:
|
||||
Warning 1105 No file name. Table will use t1.XML
|
||||
#
|
||||
# Beginning of grant.inc
|
||||
#
|
||||
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
|
||||
REVOKE FILE ON *.* FROM user@localhost;
|
||||
SELECT user();
|
||||
user()
|
||||
user@localhost
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row';
|
||||
Warnings:
|
||||
Warning 1105 No file name. Table will use t1.XML
|
||||
INSERT INTO t1 VALUES (10);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
10
|
||||
UPDATE t1 SET a=20;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
20
|
||||
DELETE FROM t1;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
INSERT INTO t1 VALUES(10);
|
||||
TRUNCATE TABLE t1;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT * FROM v1;
|
||||
a
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
SELECT user();
|
||||
user()
|
||||
root@localhost
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
|
||||
INSERT INTO t1 VALUES (10);
|
||||
SELECT user();
|
||||
user()
|
||||
user@localhost
|
||||
INSERT INTO t1 VALUES (10);
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
SELECT * FROM t1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
UPDATE t1 SET a=20;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
DELETE FROM t1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
TRUNCATE TABLE t1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
ALTER TABLE t1 READONLY=1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
DROP TABLE t1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
# Testing a VIEW created with FILE privileges but accessed with no FILE
|
||||
SELECT user();
|
||||
user()
|
||||
root@localhost
|
||||
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||
SELECT user();
|
||||
user()
|
||||
user@localhost
|
||||
SELECT * FROM v1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
INSERT INTO v1 VALUES (2);
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
UPDATE v1 SET a=123;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
DELETE FROM v1;
|
||||
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
DROP USER user@localhost;
|
||||
#
|
||||
# End of grant.inc
|
||||
#
|
||||
SET NAMES utf8;
|
||||
#
|
||||
# Testing tag values
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $FILE_TYPE=BIN;
|
||||
let $TABLE_OPTIONS=TABLE_TYPE=BIN;
|
||||
let $FILE_EXT=BIN;
|
||||
--source grant.inc
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $FILE_TYPE=CSV;
|
||||
let $TABLE_OPTIONS=TABLE_TYPE=CSV;
|
||||
let $FILE_EXT=CSV;
|
||||
--source grant.inc
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $FILE_TYPE=DBF;
|
||||
let $TABLE_OPTIONS=TABLE_TYPE=DBF;
|
||||
let $FILE_EXT=DBF;
|
||||
--source grant.inc
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $FILE_TYPE=FIX;
|
||||
let $TABLE_OPTIONS=TABLE_TYPE=FIX;
|
||||
let $FILE_EXT=FIX;
|
||||
--source grant.inc
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ REVOKE FILE ON *.* FROM user@localhost;
|
|||
--connect(user,localhost,user,,)
|
||||
--connection user
|
||||
SELECT user();
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=$FILE_TYPE
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS
|
||||
INSERT INTO t1 VALUES (10);
|
||||
SELECT * FROM t1;
|
||||
UPDATE t1 SET a=20;
|
||||
|
@ -25,10 +25,10 @@ DROP TABLE t1;
|
|||
--error 1
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.$FILE_EXT
|
||||
--error ER_ACCESS_DENIED_ERROR
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=$FILE_TYPE FILE_NAME='t1.EXT'
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT'
|
||||
--connection default
|
||||
SELECT user();
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=$FILE_TYPE FILE_NAME='t1.EXT'
|
||||
--eval CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT $TABLE_OPTIONS FILE_NAME='t1.EXT'
|
||||
INSERT INTO t1 VALUES (10);
|
||||
--connection user
|
||||
SELECT user();
|
||||
|
|
|
@ -16,6 +16,11 @@ DROP TABLE t1;
|
|||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
let $TABLE_OPTIONS=TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row';
|
||||
let $FILE_EXT=XML;
|
||||
--source grant.inc
|
||||
|
||||
|
||||
SET NAMES utf8;
|
||||
|
||||
--vertical_results
|
||||
|
|
Loading…
Reference in a new issue