Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
99490870
Commit
99490870
authored
Sep 09, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up last bug fixes
Fix bug in SHOW GRANTS when there is a column privilege but no table privilege
parent
434cea19
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
206 additions
and
201 deletions
+206
-201
include/mysql.h
include/mysql.h
+2
-0
libmysqld/libmysqld.c
libmysqld/libmysqld.c
+0
-2
mysql-test/r/grant.result
mysql-test/r/grant.result
+27
-27
mysql-test/r/mix_innodb_myisam_binlog.result
mysql-test/r/mix_innodb_myisam_binlog.result
+81
-81
mysql-test/t/grant.test
mysql-test/t/grant.test
+16
-16
mysql-test/t/mix_innodb_myisam_binlog.test
mysql-test/t/mix_innodb_myisam_binlog.test
+70
-67
sql/sql_acl.cc
sql/sql_acl.cc
+4
-2
sql/sql_parse.cc
sql/sql_parse.cc
+6
-6
No files found.
include/mysql.h
View file @
99490870
...
@@ -424,6 +424,8 @@ int simple_command(MYSQL *mysql,enum enum_server_command command,
...
@@ -424,6 +424,8 @@ int simple_command(MYSQL *mysql,enum enum_server_command command,
unsigned
long
net_safe_read
(
MYSQL
*
mysql
);
unsigned
long
net_safe_read
(
MYSQL
*
mysql
);
void
mysql_once_init
(
void
);
void
mysql_once_init
(
void
);
extern
my_bool
server_inited
;
#ifdef __NETWARE__
#ifdef __NETWARE__
#pragma pack(pop)
/* restore alignment */
#pragma pack(pop)
/* restore alignment */
#endif
#endif
...
...
libmysqld/libmysqld.c
View file @
99490870
...
@@ -74,8 +74,6 @@ static int send_file_to_server(MYSQL *mysql,const char *filename);
...
@@ -74,8 +74,6 @@ static int send_file_to_server(MYSQL *mysql,const char *filename);
static
ulong
mysql_sub_escape_string
(
CHARSET_INFO
*
charset_info
,
char
*
to
,
static
ulong
mysql_sub_escape_string
(
CHARSET_INFO
*
charset_info
,
char
*
to
,
const
char
*
from
,
ulong
length
);
const
char
*
from
,
ulong
length
);
extern
char
server_inited
;
#define init_sigpipe_variables
#define init_sigpipe_variables
#define set_sigpipe(mysql)
#define set_sigpipe(mysql)
#define reset_sigpipe(mysql)
#define reset_sigpipe(mysql)
...
...
mysql-test/r/grant.result
View file @
99490870
...
@@ -91,39 +91,39 @@ show grants for mysqltest_1@localhost;
...
@@ -91,39 +91,39 @@ show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
REVOKE insert,insert (a) on t1 from mysqltest_1@localhost;
REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost;
GRANT references on t1 to mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, REFERENCES, REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost'
GRANT select,references on t1 to mysqltest_1@localhost;
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1";
table_priv column_priv
table_priv column_priv
Select,References References
Select,References References
grant all on test.* to
user1
@localhost with grant option;
grant all on test.* to
mysqltest_3
@localhost with grant option;
revoke all on test.* from
user1
@localhost;
revoke all on test.* from
mysqltest_3
@localhost;
show grants for
user1
@localhost;
show grants for
mysqltest_3
@localhost;
Grants for
user1
@localhost
Grants for
mysqltest_3
@localhost
GRANT USAGE ON *.* TO '
user1
'@'localhost'
GRANT USAGE ON *.* TO '
mysqltest_3
'@'localhost'
GRANT USAGE ON `test`.* TO '
user1
'@'localhost' WITH GRANT OPTION
GRANT USAGE ON `test`.* TO '
mysqltest_3
'@'localhost' WITH GRANT OPTION
revoke grant option on test.* from
user1
@localhost;
revoke grant option on test.* from
mysqltest_3
@localhost;
show grants for
user1
@localhost;
show grants for
mysqltest_3
@localhost;
Grants for
user1
@localhost
Grants for
mysqltest_3
@localhost
GRANT USAGE ON *.* TO '
user1
'@'localhost'
GRANT USAGE ON *.* TO '
mysqltest_3
'@'localhost'
grant all on test.t1 to
user
2@localhost with grant option;
grant all on test.t1 to
mysqltest_
2@localhost with grant option;
revoke all on test.t1 from
user
2@localhost;
revoke all on test.t1 from
mysqltest_
2@localhost;
show grants for
user
2@localhost;
show grants for
mysqltest_
2@localhost;
Grants for
user
2@localhost
Grants for
mysqltest_
2@localhost
GRANT USAGE ON *.* TO '
user
2'@'localhost'
GRANT USAGE ON *.* TO '
mysqltest_
2'@'localhost'
GRANT USAGE ON `test`.`t1` TO '
user
2'@'localhost' WITH GRANT OPTION
GRANT USAGE ON `test`.`t1` TO '
mysqltest_
2'@'localhost' WITH GRANT OPTION
revoke grant option on test.t1 from
user
2@localhost;
revoke grant option on test.t1 from
mysqltest_
2@localhost;
show grants for
user
2@localhost;
show grants for
mysqltest_
2@localhost;
Grants for
user
2@localhost
Grants for
mysqltest_
2@localhost
GRANT USAGE ON *.* TO '
user
2'@'localhost'
GRANT USAGE ON *.* TO '
mysqltest_
2'@'localhost'
delete from mysql.user where user='mysqltest_1';
delete from mysql.user where user='mysqltest_1'
or user="mysqltest_2" or user="mysqltest_3"
;
delete from mysql.db where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1'
or user="mysqltest_2" or user="mysqltest_3"
;
delete from mysql.tables_priv where user='mysqltest_1';
delete from mysql.tables_priv where user='mysqltest_1'
or user="mysqltest_2" or user="mysqltest_3"
;
delete from mysql.columns_priv where user='mysqltest_1';
delete from mysql.columns_priv where user='mysqltest_1'
or user="mysqltest_2" or user="mysqltest_3"
;
flush privileges;
flush privileges;
drop table t1;
drop table t1;
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
GRANT FILE on mysqltest.* to mysqltest_1@localhost;
...
...
mysql-test/r/mix_innodb_myisam_binlog.result
View file @
99490870
drop table if exists t
i, tm
;
drop table if exists t
1, t2
;
create table t
i
(a int) type=innodb;
create table t
1
(a int) type=innodb;
create table t
m
(a int) type=myisam;
create table t
2
(a int) type=myisam;
reset master;
reset master;
begin;
begin;
insert into t
i
values(1);
insert into t
1
values(1);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
commit;
commit;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(1)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(1)
master-bin.001 178 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 178 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 244 Query 1 244 use test; COMMIT
master-bin.001 244 Query 1 244 use test; COMMIT
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(2);
insert into t
1
values(2);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback;
rollback;
Warning: Some non-transactional changed tables couldn't be rolled back
Warning: Some non-transactional changed tables couldn't be rolled back
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(2)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(2)
master-bin.001 178 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 178 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 244 Query 1 244 use test; ROLLBACK
master-bin.001 244 Query 1 244 use test; ROLLBACK
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(3);
insert into t
1
values(3);
savepoint my_savepoint;
savepoint my_savepoint;
insert into t
i
values(4);
insert into t
1
values(4);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback to savepoint my_savepoint;
rollback to savepoint my_savepoint;
Warning: Some non-transactional changed tables couldn't be rolled back
Warning: Some non-transactional changed tables couldn't be rolled back
commit;
commit;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(3)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(3)
master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
master-bin.001 235 Query 1 79 use test; insert into t
i
values(4)
master-bin.001 235 Query 1 79 use test; insert into t
1
values(4)
master-bin.001 294 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 294 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
master-bin.001 429 Query 1 429 use test; COMMIT
master-bin.001 429 Query 1 429 use test; COMMIT
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(5);
insert into t
1
values(5);
savepoint my_savepoint;
savepoint my_savepoint;
insert into t
i
values(6);
insert into t
1
values(6);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback to savepoint my_savepoint;
rollback to savepoint my_savepoint;
Warning: Some non-transactional changed tables couldn't be rolled back
Warning: Some non-transactional changed tables couldn't be rolled back
insert into t
i
values(7);
insert into t
1
values(7);
commit;
commit;
select a from t
i
order by a;
select a from t
1
order by a;
a
a
5
5
7
7
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(5)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(5)
master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
master-bin.001 178 Query 1 79 use test; savepoint my_savepoint
master-bin.001 235 Query 1 79 use test; insert into t
i
values(6)
master-bin.001 235 Query 1 79 use test; insert into t
1
values(6)
master-bin.001 294 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 294 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
master-bin.001 360 Query 1 79 use test; rollback to savepoint my_savepoint
master-bin.001 429 Query 1 79 use test; insert into t
i
values(7)
master-bin.001 429 Query 1 79 use test; insert into t
1
values(7)
master-bin.001 488 Query 1 488 use test; COMMIT
master-bin.001 488 Query 1 488 use test; COMMIT
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
select get_lock("a",10);
select get_lock("a",10);
get_lock("a",10)
get_lock("a",10)
1
1
begin;
begin;
insert into t
i
values(8);
insert into t
1
values(8);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
select get_lock("a",10);
select get_lock("a",10);
get_lock("a",10)
get_lock("a",10)
1
1
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(8)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(8)
master-bin.001 178 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 178 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 244 Query 1 244 use test; ROLLBACK
master-bin.001 244 Query 1 244 use test; ROLLBACK
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
insert into t
i
values(9);
insert into t
1
values(9);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; insert into t
i
values(9)
master-bin.001 79 Query 1 79 use test; insert into t
1
values(9)
master-bin.001 138 Query 1 138 use test; insert into t
m select * from ti
master-bin.001 138 Query 1 138 use test; insert into t
2 select * from t1
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
insert into t
i
values(10);
insert into t
1
values(10);
begin;
begin;
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; insert into t
i
values(10)
master-bin.001 79 Query 1 79 use test; insert into t
1
values(10)
master-bin.001 139 Query 1 139 use test; insert into t
m select * from ti
master-bin.001 139 Query 1 139 use test; insert into t
2 select * from t1
insert into t
i
values(11);
insert into t
1
values(11);
commit;
commit;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; insert into t
i
values(10)
master-bin.001 79 Query 1 79 use test; insert into t
1
values(10)
master-bin.001 139 Query 1 139 use test; insert into t
m select * from ti
master-bin.001 139 Query 1 139 use test; insert into t
2 select * from t1
master-bin.001 205 Query 1 205 use test; BEGIN
master-bin.001 205 Query 1 205 use test; BEGIN
master-bin.001 245 Query 1 205 use test; insert into t
i
values(11)
master-bin.001 245 Query 1 205 use test; insert into t
1
values(11)
master-bin.001 305 Query 1 305 use test; COMMIT
master-bin.001 305 Query 1 305 use test; COMMIT
alter table t
m
type=INNODB;
alter table t
2
type=INNODB;
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(12);
insert into t
1
values(12);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
commit;
commit;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(12)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(12)
master-bin.001 179 Query 1 79 use test; insert into t
m select * from ti
master-bin.001 179 Query 1 79 use test; insert into t
2 select * from t1
master-bin.001 245 Query 1 245 use test; COMMIT
master-bin.001 245 Query 1 245 use test; COMMIT
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(13);
insert into t
1
values(13);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback;
rollback;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(14);
insert into t
1
values(14);
savepoint my_savepoint;
savepoint my_savepoint;
insert into t
i
values(15);
insert into t
1
values(15);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback to savepoint my_savepoint;
rollback to savepoint my_savepoint;
commit;
commit;
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(14)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(14)
master-bin.001 179 Query 1 179 use test; COMMIT
master-bin.001 179 Query 1 179 use test; COMMIT
delete from t
i
;
delete from t
1
;
delete from t
m
;
delete from t
2
;
reset master;
reset master;
begin;
begin;
insert into t
i
values(16);
insert into t
1
values(16);
savepoint my_savepoint;
savepoint my_savepoint;
insert into t
i
values(17);
insert into t
1
values(17);
insert into t
m select * from ti
;
insert into t
2 select * from t1
;
rollback to savepoint my_savepoint;
rollback to savepoint my_savepoint;
insert into t
i
values(18);
insert into t
1
values(18);
commit;
commit;
select a from t
i
order by a;
select a from t
1
order by a;
a
a
16
16
18
18
show binlog events from 79;
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
Log_name Pos Event_type Server_id Orig_log_pos Info
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 79 Query 1 79 use test; BEGIN
master-bin.001 119 Query 1 79 use test; insert into t
i
values(16)
master-bin.001 119 Query 1 79 use test; insert into t
1
values(16)
master-bin.001 179 Query 1 79 use test; insert into t
i
values(18)
master-bin.001 179 Query 1 79 use test; insert into t
1
values(18)
master-bin.001 239 Query 1 239 use test; COMMIT
master-bin.001 239 Query 1 239 use test; COMMIT
drop table t
i,tm
;
drop table t
1,t2
;
mysql-test/t/grant.test
View file @
99490870
...
@@ -62,24 +62,24 @@ show grants for mysqltest_1@localhost;
...
@@ -62,24 +62,24 @@ show grants for mysqltest_1@localhost;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
REVOKE
select
(
a
),
update
on
t1
from
mysqltest_1
@
localhost
;
REVOKE
select
(
a
),
update
on
t1
from
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
REVOKE
insert
,
insert
(
a
)
on
t1
from
mysqltest_1
@
localhost
;
REVOKE
select
,
update
,
insert
,
insert
(
a
)
on
t1
from
mysqltest_1
@
localhost
;
GRANT
references
on
t1
to
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
show
grants
for
mysqltest_1
@
localhost
;
GRANT
select
,
references
on
t1
to
mysqltest_1
@
localhost
;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
select
table_priv
,
column_priv
from
mysql
.
tables_priv
where
user
=
"mysqltest_1"
;
grant
all
on
test
.*
to
user1
@
localhost
with
grant
option
;
grant
all
on
test
.*
to
mysqltest_3
@
localhost
with
grant
option
;
revoke
all
on
test
.*
from
user1
@
localhost
;
revoke
all
on
test
.*
from
mysqltest_3
@
localhost
;
show
grants
for
user1
@
localhost
;
show
grants
for
mysqltest_3
@
localhost
;
revoke
grant
option
on
test
.*
from
user1
@
localhost
;
revoke
grant
option
on
test
.*
from
mysqltest_3
@
localhost
;
show
grants
for
user1
@
localhost
;
show
grants
for
mysqltest_3
@
localhost
;
grant
all
on
test
.
t1
to
user
2
@
localhost
with
grant
option
;
grant
all
on
test
.
t1
to
mysqltest_
2
@
localhost
with
grant
option
;
revoke
all
on
test
.
t1
from
user
2
@
localhost
;
revoke
all
on
test
.
t1
from
mysqltest_
2
@
localhost
;
show
grants
for
user
2
@
localhost
;
show
grants
for
mysqltest_
2
@
localhost
;
revoke
grant
option
on
test
.
t1
from
user
2
@
localhost
;
revoke
grant
option
on
test
.
t1
from
mysqltest_
2
@
localhost
;
show
grants
for
user
2
@
localhost
;
show
grants
for
mysqltest_
2
@
localhost
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
user
where
user
=
'mysqltest_1'
or
user
=
"mysqltest_2"
or
user
=
"mysqltest_3"
;
delete
from
mysql
.
db
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
db
where
user
=
'mysqltest_1'
or
user
=
"mysqltest_2"
or
user
=
"mysqltest_3"
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
tables_priv
where
user
=
'mysqltest_1'
or
user
=
"mysqltest_2"
or
user
=
"mysqltest_3"
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
;
delete
from
mysql
.
columns_priv
where
user
=
'mysqltest_1'
or
user
=
"mysqltest_2"
or
user
=
"mysqltest_3"
;
flush
privileges
;
flush
privileges
;
drop
table
t1
;
drop
table
t1
;
...
...
mysql-test/t/mix_innodb_myisam_binlog.test
View file @
99490870
# Check that binlog is ok when a transaction mixes updates to InnoDB and
# Check that binlog is ok when a transaction mixes updates to InnoDB and
# MyISAM. It would be nice to make this a replication test, but in 4.0 the slave
# MyISAM.
# is always with --skip-innodb in the testsuite. I (Guilhem) however did some
# It would be nice to make this a replication test, but in 4.0 the
# tests manually on a slave; tables are replicated fine and Exec_master_log_pos
# slave is always with --skip-innodb in the testsuite. I (Guilhem) however
# advances as expected.
# did some tests manually on a slave; tables are replicated fine and
# Exec_master_log_pos advances as expected.
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_innodb
.
inc
--
disable_warnings
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
connect
(
con1
,
localhost
,
root
,,);
connect
(
con1
,
localhost
,
root
,,);
connect
(
con2
,
localhost
,
root
,,);
connect
(
con2
,
localhost
,
root
,,);
connection
con1
;
connection
con1
;
create
table
t1
(
a
int
)
type
=
innodb
;
drop
table
if
exists
ti
,
tm
;
create
table
t2
(
a
int
)
type
=
myisam
;
create
table
ti
(
a
int
)
type
=
innodb
;
create
table
tm
(
a
int
)
type
=
myisam
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
1
);
insert
into
t
1
values
(
1
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
commit
;
commit
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
2
);
insert
into
t
1
values
(
2
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
# should say some changes to non-transact
i
onal tables couldn't be rolled back
# should say some changes to non-transact
1
onal tables couldn't be rolled back
--
error
1196
--
error
1196
rollback
;
rollback
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
3
);
insert
into
t
1
values
(
3
);
savepoint
my_savepoint
;
savepoint
my_savepoint
;
insert
into
t
i
values
(
4
);
insert
into
t
1
values
(
4
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
--
error
1196
--
error
1196
rollback
to
savepoint
my_savepoint
;
rollback
to
savepoint
my_savepoint
;
commit
;
commit
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
5
);
insert
into
t
1
values
(
5
);
savepoint
my_savepoint
;
savepoint
my_savepoint
;
insert
into
t
i
values
(
6
);
insert
into
t
1
values
(
6
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
--
error
1196
--
error
1196
rollback
to
savepoint
my_savepoint
;
rollback
to
savepoint
my_savepoint
;
insert
into
t
i
values
(
7
);
insert
into
t
1
values
(
7
);
commit
;
commit
;
select
a
from
t
i
order
by
a
;
# check that savepoints work :)
select
a
from
t
1
order
by
a
;
# check that savepoints work :)
show
binlog
events
from
79
;
show
binlog
events
from
79
;
# and when ROLLBACK is not explicit?
# and when ROLLBACK is not explicit?
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
select
get_lock
(
"a"
,
10
);
select
get_lock
(
"a"
,
10
);
begin
;
begin
;
insert
into
t
i
values
(
8
);
insert
into
t
1
values
(
8
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
disconnect
con1
;
disconnect
con1
;
connection
con2
;
connection
con2
;
...
@@ -89,87 +92,87 @@ connection con2;
...
@@ -89,87 +92,87 @@ connection con2;
select
get_lock
(
"a"
,
10
);
select
get_lock
(
"a"
,
10
);
show
binlog
events
from
79
;
show
binlog
events
from
79
;
# and when not in a transact
i
on?
# and when not in a transact
1
on?
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
insert
into
t
i
values
(
9
);
insert
into
t
1
values
(
9
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
# Check that when the query updat
i
ng the MyISAM table is the first in the
# Check that when the query updat
1
ng the MyISAM table is the first in the
# transact
i
on, we log it immediately.
# transact
1
on, we log it immediately.
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
insert
into
t
i
values
(
10
);
# first make ti
non-empty
insert
into
t
1
values
(
10
);
# first make t1
non-empty
begin
;
begin
;
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
insert
into
t
i
values
(
11
);
insert
into
t
1
values
(
11
);
commit
;
commit
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
# Check that things work like before this BEGIN/ROLLBACK code was added,
when tm
# Check that things work like before this BEGIN/ROLLBACK code was added,
# is INNODB
#
when t2
is INNODB
alter
table
t
m
type
=
INNODB
;
alter
table
t
2
type
=
INNODB
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
12
);
insert
into
t
1
values
(
12
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
commit
;
commit
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
13
);
insert
into
t
1
values
(
13
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
rollback
;
rollback
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
14
);
insert
into
t
1
values
(
14
);
savepoint
my_savepoint
;
savepoint
my_savepoint
;
insert
into
t
i
values
(
15
);
insert
into
t
1
values
(
15
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
rollback
to
savepoint
my_savepoint
;
rollback
to
savepoint
my_savepoint
;
commit
;
commit
;
show
binlog
events
from
79
;
show
binlog
events
from
79
;
delete
from
t
i
;
delete
from
t
1
;
delete
from
t
m
;
delete
from
t
2
;
reset
master
;
reset
master
;
begin
;
begin
;
insert
into
t
i
values
(
16
);
insert
into
t
1
values
(
16
);
savepoint
my_savepoint
;
savepoint
my_savepoint
;
insert
into
t
i
values
(
17
);
insert
into
t
1
values
(
17
);
insert
into
t
m
select
*
from
ti
;
insert
into
t
2
select
*
from
t1
;
rollback
to
savepoint
my_savepoint
;
rollback
to
savepoint
my_savepoint
;
insert
into
t
i
values
(
18
);
insert
into
t
1
values
(
18
);
commit
;
commit
;
select
a
from
t
i
order
by
a
;
# check that savepoints work :)
select
a
from
t
1
order
by
a
;
# check that savepoints work :)
show
binlog
events
from
79
;
show
binlog
events
from
79
;
drop
table
t
i
,
tm
;
drop
table
t
1
,
t2
;
sql/sql_acl.cc
View file @
99490870
...
@@ -3091,17 +3091,19 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
...
@@ -3091,17 +3091,19 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
if
((
table_access
|
grant_table
->
cols
)
!=
0
)
if
((
table_access
|
grant_table
->
cols
)
!=
0
)
{
{
String
global
(
buff
,
sizeof
(
buff
));
String
global
(
buff
,
sizeof
(
buff
));
ulong
test_access
=
(
table_access
|
grant_table
->
cols
)
&
~
GRANT_ACL
;
global
.
length
(
0
);
global
.
length
(
0
);
global
.
append
(
"GRANT "
,
6
);
global
.
append
(
"GRANT "
,
6
);
if
(
test_all_bits
(
table_access
,
(
TABLE_ACLS
&
~
GRANT_ACL
)))
if
(
test_all_bits
(
table_access
,
(
TABLE_ACLS
&
~
GRANT_ACL
)))
global
.
append
(
"ALL PRIVILEGES"
,
14
);
global
.
append
(
"ALL PRIVILEGES"
,
14
);
else
if
(
!
(
table_access
&
~
GRANT_ACL
)
)
else
if
(
!
test_access
)
global
.
append
(
"USAGE"
,
5
);
global
.
append
(
"USAGE"
,
5
);
else
else
{
{
int
found
=
0
;
int
found
=
0
;
ulong
j
,
test_access
=
(
table_access
|
grant_table
->
cols
)
&
~
GRANT_ACL
;
ulong
j
;
for
(
counter
=
0
,
j
=
SELECT_ACL
;
j
<=
TABLE_ACLS
;
counter
++
,
j
<<=
1
)
for
(
counter
=
0
,
j
=
SELECT_ACL
;
j
<=
TABLE_ACLS
;
counter
++
,
j
<<=
1
)
{
{
...
...
sql/sql_parse.cc
View file @
99490870
...
@@ -1500,7 +1500,7 @@ mysql_execute_command(void)
...
@@ -1500,7 +1500,7 @@ mysql_execute_command(void)
break
;
break
;
}
}
#if
ndef EMBEDDED_LIBRARY
#if
def HAVE_REPLICATION
case
SQLCOM_CHANGE_MASTER
:
case
SQLCOM_CHANGE_MASTER
:
{
{
if
(
check_global_access
(
thd
,
SUPER_ACL
))
if
(
check_global_access
(
thd
,
SUPER_ACL
))
...
@@ -1538,7 +1538,7 @@ mysql_execute_command(void)
...
@@ -1538,7 +1538,7 @@ mysql_execute_command(void)
res
=
load_master_data
(
thd
);
res
=
load_master_data
(
thd
);
break
;
break
;
#endif
/*
!EMBEDDED_LIBRARY
*/
#endif
/*
HAVE_REPLICATION
*/
#ifdef HAVE_INNOBASE_DB
#ifdef HAVE_INNOBASE_DB
case
SQLCOM_SHOW_INNODB_STATUS
:
case
SQLCOM_SHOW_INNODB_STATUS
:
...
@@ -1550,7 +1550,7 @@ mysql_execute_command(void)
...
@@ -1550,7 +1550,7 @@ mysql_execute_command(void)
}
}
#endif
#endif
#if
ndef EMBEDDED_LIBRARY
#if
def HAVE_REPLICATION
case
SQLCOM_LOAD_MASTER_TABLE
:
case
SQLCOM_LOAD_MASTER_TABLE
:
{
{
if
(
!
tables
->
db
)
if
(
!
tables
->
db
)
...
@@ -1577,7 +1577,7 @@ mysql_execute_command(void)
...
@@ -1577,7 +1577,7 @@ mysql_execute_command(void)
UNLOCK_ACTIVE_MI
;
UNLOCK_ACTIVE_MI
;
break
;
break
;
}
}
#endif
/*
!EMBEDDED_LIBRARY
*/
#endif
/*
HAVE_REPLICATION
*/
case
SQLCOM_CREATE_TABLE
:
case
SQLCOM_CREATE_TABLE
:
{
{
...
@@ -1683,7 +1683,7 @@ mysql_execute_command(void)
...
@@ -1683,7 +1683,7 @@ mysql_execute_command(void)
res
=
mysql_create_index
(
thd
,
tables
,
lex
->
key_list
);
res
=
mysql_create_index
(
thd
,
tables
,
lex
->
key_list
);
break
;
break
;
#if
ndef EMBEDDED_LIBRARY
#if
def HAVE_REPLICATION
case
SQLCOM_SLAVE_START
:
case
SQLCOM_SLAVE_START
:
{
{
LOCK_ACTIVE_MI
;
LOCK_ACTIVE_MI
;
...
@@ -1716,7 +1716,7 @@ mysql_execute_command(void)
...
@@ -1716,7 +1716,7 @@ mysql_execute_command(void)
UNLOCK_ACTIVE_MI
;
UNLOCK_ACTIVE_MI
;
break
;
break
;
}
}
#endif
/*
!EMBEDDED_LIBRARY
*/
#endif
/*
HAVE_REPLICATION
*/
case
SQLCOM_ALTER_TABLE
:
case
SQLCOM_ALTER_TABLE
:
#if defined(DONT_ALLOW_SHOW_COMMANDS)
#if defined(DONT_ALLOW_SHOW_COMMANDS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment