diff options
author | unknown <thek@adventure.(none)> | 2008-02-01 14:10:46 +0100 |
---|---|---|
committer | unknown <thek@adventure.(none)> | 2008-02-01 14:10:46 +0100 |
commit | f7d8fb1cdde7a9655b984827547a7f4f85560834 (patch) | |
tree | be4662964632101146be7c8762f70e9afe54e8db /mysql-test | |
parent | a89ba0c68031aa3a962ef4244e027dd9481a65c1 (diff) | |
download | mariadb-git-f7d8fb1cdde7a9655b984827547a7f4f85560834.tar.gz |
Bug#33201 Crash occurs when granting update privilege on one column of a view
When issuing a column level grant on a table which require pre-locking the
server crashed.
The reason behind the crash was that data structures used by the lock api
wasn't properly reinitialized in the case of a column level grant.
mysql-test/r/grant.result:
* Added test case
mysql-test/t/grant.test:
* Added test case
sql/sql_acl.cc:
* The lock api is dending on the thd->lex object and this variable needs to
be re-initialized when opened with a new set of tables than specified in the
original statement.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/grant.result | 22 | ||||
-rw-r--r-- | mysql-test/t/grant.test | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index e27ef64af43..98a21b14585 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -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 diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index ed95d90c8f8..43548094a33 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -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 |