Commit 42e5bfac authored by Olivier Bertrand's avatar Olivier Bertrand

- Commit merged changes

modified:
  mysql-test/suite/connect/r/ini.result
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/ini.test
  mysql-test/suite/connect/t/vec.test
  storage/connect/ha_connect.cc
parents af08a68f f284c9b7
# #
# Checking FILE privileges
#
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
SELECT user();
user()
user@localhost
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI;
Warnings:
Warning 1105 No file name. Table will use t1.INI
INSERT INTO t1 VALUES ('sec1','val1');
SELECT * FROM t1;
sec val
sec1 val1
UPDATE t1 SET val='val11';
SELECT * FROM t1;
sec val
sec1 val11
DELETE FROM t1;
SELECT * FROM t1;
sec val
INSERT INTO t1 VALUES('sec2','val2');
TRUNCATE TABLE t1;
SELECT * FROM t1;
sec val
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
sec val
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
SELECT user();
user()
root@localhost
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES ('sec1','val1');
SELECT user();
user()
user@localhost
INSERT INTO t1 VALUES ('sec2','val2');
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 val='val11';
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 ('sec3','val3');
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
UPDATE v1 SET val='val11';
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;
#
# Checking FILE privileges: done
#
#
# Testing errors # Testing errors
# #
CREATE TABLE t1 CREATE TABLE t1
......
#
# 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=VEC MAX_ROWS=100;
Warnings:
Warning 1105 No file name. Table will use t1.VEC
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=VEC MAX_ROWS=100 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=VEC MAX_ROWS=100 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
#
CREATE TABLE dir1 ( CREATE TABLE dir1 (
spath VARCHAR(256) NOT NULL flag=1, spath VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256) NOT NULL, fname VARCHAR(256) NOT NULL,
......
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--echo #
--echo # Checking FILE privileges
--echo #
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
--connect(user,localhost,user,,)
--connection user
SELECT user();
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI;
INSERT INTO t1 VALUES ('sec1','val1');
SELECT * FROM t1;
UPDATE t1 SET val='val11';
SELECT * FROM t1;
DELETE FROM t1;
SELECT * FROM t1;
INSERT INTO t1 VALUES('sec2','val2');
TRUNCATE TABLE t1;
SELECT * FROM t1;
CREATE VIEW v1 AS SELECT * FROM t1;
SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
# Making sure DROP erased the data file
--error 1
--remove_file $MYSQLD_DATADIR/test/t1.INI
--error ER_ACCESS_DENIED_ERROR
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
--connection default
SELECT user();
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES ('sec1','val1');
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
INSERT INTO t1 VALUES ('sec2','val2');
--error ER_ACCESS_DENIED_ERROR
SELECT * FROM t1;
--error ER_ACCESS_DENIED_ERROR
UPDATE t1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR
DELETE FROM t1;
--error ER_ACCESS_DENIED_ERROR
TRUNCATE TABLE t1;
--error ER_ACCESS_DENIED_ERROR
ALTER TABLE t1 READONLY=1;
--error ER_ACCESS_DENIED_ERROR
DROP TABLE t1;
--error ER_ACCESS_DENIED_ERROR
CREATE VIEW v1 AS SELECT * FROM t1;
--echo # Testing a VIEW created with FILE privileges but accessed with no FILE
--connection default
SELECT user();
CREATE VIEW v1 AS SELECT * FROM t1;
--connection user
SELECT user();
--error ER_ACCESS_DENIED_ERROR
SELECT * FROM v1;
--error ER_ACCESS_DENIED_ERROR
INSERT INTO v1 VALUES ('sec3','val3');
--error ER_ACCESS_DENIED_ERROR
UPDATE v1 SET val='val11';
--error ER_ACCESS_DENIED_ERROR
DELETE FROM v1;
--disconnect user
--connection default
DROP VIEW v1;
DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.EXT
DROP USER user@localhost;
--echo #
--echo # Checking FILE privileges: done
--echo #
--copy_file $MYSQL_TEST_DIR/suite/connect/std_data/contact.ini $MYSQLD_DATADIR/test/contact.ini --copy_file $MYSQL_TEST_DIR/suite/connect/std_data/contact.ini $MYSQLD_DATADIR/test/contact.ini
--echo # --echo #
......
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
let $TABLE_OPTIONS=TABLE_TYPE=VEC MAX_ROWS=100;
let $FILE_EXT=VEC;
--source grant.inc
CREATE TABLE dir1 ( CREATE TABLE dir1 (
spath VARCHAR(256) NOT NULL flag=1, spath VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256) NOT NULL, fname VARCHAR(256) NOT NULL,
......
...@@ -3997,7 +3997,7 @@ int ha_connect::create(const char *name, TABLE *table_arg, ...@@ -3997,7 +3997,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,
#endif // !LIBXML2_SUPPORT #endif // !LIBXML2_SUPPORT
if (!xsup) if (!xsup)
push_warning(table->in_use, push_warning(table_arg->in_use,
MYSQL_ERROR::WARN_LEVEL_WARN, 0, g->Message); MYSQL_ERROR::WARN_LEVEL_WARN, 0, g->Message);
} // endif type } // endif type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment