mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#13310 incorrect user parsing by SP
- Strip surrounding ''s from username when a new user connects. There is no user 'a@', it should be a@ mysql-test/r/grant2.result: Update test result mysql-test/t/grant2.test: Add tests for bug 13310 sql/sql_parse.cc: Strip surrounding ''s from username when a new user connects. There is no user 'a@', it should be a@
This commit is contained in:
@ -356,3 +356,16 @@ insert into mysql.user select * from t1;
|
||||
drop table t1, t2;
|
||||
drop database TESTDB;
|
||||
flush privileges;
|
||||
grant all privileges on test.* to `a@`@localhost;
|
||||
grant execute on * to `a@`@localhost;
|
||||
create table t2 (s1 int);
|
||||
insert into t2 values (1);
|
||||
drop function if exists f2;
|
||||
create function f2 () returns int begin declare v int; select s1 from t2
|
||||
into v; return v; end//
|
||||
select f2();
|
||||
f2()
|
||||
1
|
||||
drop function f2;
|
||||
drop table t2;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
|
||||
|
@ -465,3 +465,28 @@ drop table t1, t2;
|
||||
drop database TESTDB;
|
||||
flush privileges;
|
||||
|
||||
#
|
||||
# BUG#13310 incorrect user parsing by SP
|
||||
#
|
||||
|
||||
grant all privileges on test.* to `a@`@localhost;
|
||||
grant execute on * to `a@`@localhost;
|
||||
connect (bug13310,localhost,'a@',,test);
|
||||
connection bug13310;
|
||||
create table t2 (s1 int);
|
||||
insert into t2 values (1);
|
||||
--disable_warnings
|
||||
drop function if exists f2;
|
||||
--enable_warnings
|
||||
delimiter //;
|
||||
create function f2 () returns int begin declare v int; select s1 from t2
|
||||
into v; return v; end//
|
||||
delimiter ;//
|
||||
select f2();
|
||||
|
||||
drop function f2;
|
||||
drop table t2;
|
||||
disconnect bug13310;
|
||||
|
||||
connection default;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
|
||||
|
Reference in New Issue
Block a user