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
c0aff004
Commit
c0aff004
authored
Mar 27, 2008
by
davi@endora.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/Users/davi/mysql/mysql-5.1-bug33201
into mysql.com:/Users/davi/mysql/mysql-5.0-bugteam
parents
88204b52
323e9a4c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
0 deletions
+51
-0
mysql-test/r/grant.result
mysql-test/r/grant.result
+22
-0
mysql-test/t/grant.test
mysql-test/t/grant.test
+22
-0
sql/sql_acl.cc
sql/sql_acl.cc
+7
-0
No files found.
mysql-test/r/grant.result
View file @
c0aff004
...
...
@@ -1129,4 +1129,26 @@ DROP USER mysqltest_1@localhost;
DROP DATABASE db27878;
use test;
DROP TABLE t1;
drop table if exists test;
Warnings:
Note 1051 Unknown table 'test'
drop function if exists test_function;
Warnings:
Note 1305 FUNCTION test_function does not exist
drop view if exists v1;
Warnings:
Note 1051 Unknown table 'test.v1'
create table test (col1 varchar(30));
create function test_function() returns varchar(30)
begin
declare tmp varchar(30);
select col1 from test limit 1 into tmp;
return '1';
end|
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg';
revoke all privileges on v1 from 'greg';
drop view v1;
drop table test;
drop function test_function;
End of 5.0 tests
mysql-test/t/grant.test
View file @
c0aff004
...
...
@@ -1153,4 +1153,26 @@ DROP DATABASE db27878;
use
test
;
DROP
TABLE
t1
;
#
# Bug #33201 Crash occurs when granting update privilege on one column of a view
#
drop
table
if
exists
test
;
drop
function
if
exists
test_function
;
drop
view
if
exists
v1
;
create
table
test
(
col1
varchar
(
30
));
delimiter
|
;
create
function
test_function
()
returns
varchar
(
30
)
begin
declare
tmp
varchar
(
30
);
select
col1
from
test
limit
1
into
tmp
;
return
'1'
;
end
|
delimiter
;
|
create
view
v1
as
select
test
.*
from
test
where
test
.
col1
=
test_function
();
grant
update
(
col1
)
on
v1
to
'greg'
;
revoke
all
privileges
on
v1
from
'greg'
;
drop
view
v1
;
drop
table
test
;
drop
function
test_function
;
--
echo
End
of
5.0
tests
sql/sql_acl.cc
View file @
c0aff004
...
...
@@ -2880,6 +2880,12 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
}
#endif
/*
The lock api is depending on the thd->lex variable which needs to be
re-initialized.
*/
Query_tables_list
backup
;
thd
->
lex
->
reset_n_backup_query_tables_list
(
&
backup
);
if
(
simple_open_n_lock_tables
(
thd
,
tables
))
{
// Should never happen
close_thread_tables
(
thd
);
/* purecov: deadcode */
...
...
@@ -3018,6 +3024,7 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
send_ok
(
thd
);
/* Tables are automatically closed */
thd
->
lex
->
restore_backup_query_tables_list
(
&
backup
);
DBUG_RETURN
(
result
);
}
...
...
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