365
365
drop table t1, t2;
366
366
drop database TESTDB;
367
367
flush privileges;
368
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
368
369
SET GLOBAL log_bin_trust_function_creators = 1;
369
grant all privileges on test.* to `a@`@localhost;
370
grant execute on * to `a@`@localhost;
371
create table t2 (s1 int);
372
insert into t2 values (1);
373
drop function if exists f2;
374
create function f2 () returns int
375
begin declare v int; select s1 from t2 into v; return v; end//
370
GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
371
GRANT EXECUTE ON * TO `a@`@localhost;
372
CREATE TABLE t2 (s1 INT);
373
INSERT INTO t2 VALUES (1);
374
DROP FUNCTION IF EXISTS f2;
375
CREATE FUNCTION f2 () RETURNS INT
376
BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
381
382
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
382
drop user `a@`@localhost;
383
SET GLOBAL log_bin_trust_function_creators = 0;
383
DROP USER `a@`@localhost;
384
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
384
385
drop database if exists mysqltest_1;
385
386
drop database if exists mysqltest_2;
386
387
drop user mysqltest_u1@localhost;
437
438
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
438
439
SELECT * FROM t1 JOIN t2 USING (b);
439
440
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
440
442
DROP TABLE db1.t1, db1.t2;
441
443
DROP USER mysqltest1@localhost;
442
444
DROP DATABASE db1;