Merge adventure.(none):/home/thek/Development/cpp/bug33201/my50-bug33201
into adventure.(none):/home/thek/Development/cpp/bug33201/my51-bug33201
This commit is contained in:
commit
9fc16fbfc0
@ -1283,4 +1283,26 @@ CALL mysqltest1.test();
|
|||||||
DROP DATABASE mysqltest1;
|
DROP DATABASE mysqltest1;
|
||||||
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
RENAME TABLE mysql.procs_gone TO mysql.procs_priv;
|
||||||
FLUSH PRIVILEGES;
|
FLUSH PRIVILEGES;
|
||||||
End of 5.1 tests
|
|
||||||
|
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;
|
||||||
|
@ -1266,6 +1266,28 @@ DROP DATABASE db27878;
|
|||||||
use test;
|
use test;
|
||||||
DROP TABLE t1;
|
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
|
--echo End of 5.0 tests
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -3041,6 +3041,12 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
|||||||
}
|
}
|
||||||
#endif
|
#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))
|
if (simple_open_n_lock_tables(thd,tables))
|
||||||
{ // Should never happen
|
{ // Should never happen
|
||||||
close_thread_tables(thd); /* purecov: deadcode */
|
close_thread_tables(thd); /* purecov: deadcode */
|
||||||
@ -3173,6 +3179,7 @@ bool mysql_table_grant(THD *thd, TABLE_LIST *table_list,
|
|||||||
send_ok(thd);
|
send_ok(thd);
|
||||||
|
|
||||||
/* Tables are automatically closed */
|
/* Tables are automatically closed */
|
||||||
|
thd->lex->restore_backup_query_tables_list(&backup);
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user