summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sql_sequence/alter_notembedded.test
blob: 5bd54a7c721e6677ac23d9a1b5bd322d1fe91df4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--source include/have_sequence.inc
--source include/have_innodb.inc
--source include/not_embedded.inc

--echo #
--echo # GRANT
--echo #

create database s_db;
create sequence s_db.s1;
grant select on s_db.s1 to normal_1@'%' identified by 'pass';

--disable_ps2_protocol
connect(m_normal_1, localhost, normal_1, pass, s_db);
select * from s1;
--error ER_TABLEACCESS_DENIED_ERROR
select nextval(s1);
show create sequence s1;
--error ER_TABLEACCESS_DENIED_ERROR
alter sequence s1 restart 50;
connection default;
grant insert on s_db.s1 to normal_1@'%';
connection m_normal_1;
select nextval(s1);
--error ER_TABLEACCESS_DENIED_ERROR
alter sequence s1 restart 50;
connection default;
grant alter on s_db.s1 to normal_1@'%';
connection m_normal_1;
alter sequence s1 restart 50;
select nextval(s1);
--error ER_TABLEACCESS_DENIED_ERROR
drop sequence s1;
--enable_ps2_protocol

connection default;
disconnect m_normal_1;
drop database s_db;
drop user normal_1@'%';