mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed BUG#13510: Setting password local variable changes current password
Disallow conflicting use of variables named "password" and "names". If such a variable is declared, and "SET ... = ..." is used for them, an error is returned; the user must resolve the conflict by either using `var` (indicating that the local variable is set) or by renaming the variable. This is necessary since setting "password" and "names" are treated as special cases by the parser. mysql-test/r/sp-error.result: New test cases for BUG#13510 mysql-test/t/sp-error.test: New test cases for BUG#13510 sql/share/errmsg.txt: New error message for when certain variable names are use which would be parsed the wrong way. (E.g. "password" and "names") sql/sql_yacc.yy: Check if "names" or "password" are used as local variable/parameter, in which case "set names" or "set password" will be parsed the wrong way. Give an error message instead.
This commit is contained in:
@ -834,3 +834,41 @@ ERROR HY000: Not allowed to set autocommit from a stored function or trigger
|
||||
create trigger bug12712
|
||||
before insert on t1 for each row set session autocommit = 0;
|
||||
ERROR HY000: Not allowed to set autocommit from a stored function or trigger
|
||||
drop procedure if exists bug13510_1|
|
||||
drop procedure if exists bug13510_2|
|
||||
drop procedure if exists bug13510_3|
|
||||
drop procedure if exists bug13510_4|
|
||||
create procedure bug13510_1()
|
||||
begin
|
||||
declare password varchar(10);
|
||||
set password = 'foo1';
|
||||
select password;
|
||||
end|
|
||||
ERROR 42000: Variable 'password' must be quoted with `...`, or renamed
|
||||
create procedure bug13510_2()
|
||||
begin
|
||||
declare names varchar(10);
|
||||
set names = 'foo2';
|
||||
select names;
|
||||
end|
|
||||
ERROR 42000: Variable 'names' must be quoted with `...`, or renamed
|
||||
create procedure bug13510_3()
|
||||
begin
|
||||
declare password varchar(10);
|
||||
set `password` = 'foo3';
|
||||
select password;
|
||||
end|
|
||||
create procedure bug13510_4()
|
||||
begin
|
||||
declare names varchar(10);
|
||||
set `names` = 'foo4';
|
||||
select names;
|
||||
end|
|
||||
call bug13510_3()|
|
||||
password
|
||||
foo3
|
||||
call bug13510_4()|
|
||||
names
|
||||
foo4
|
||||
drop procedure bug13510_3|
|
||||
drop procedure bug13510_4|
|
||||
|
Reference in New Issue
Block a user