diff options
author | pem@mysql.com <> | 2005-10-11 15:01:38 +0200 |
---|---|---|
committer | pem@mysql.com <> | 2005-10-11 15:01:38 +0200 |
commit | 2456c0c6684668fc0f4675c56e061677b63464b0 (patch) | |
tree | 1a5f79805353fdf20bfe9c8e38af32aecd5871b0 /mysql-test/r | |
parent | 0b8098249726175fb6b84bf457e4720cd504cde6 (diff) | |
download | mariadb-git-2456c0c6684668fc0f4675c56e061677b63464b0.tar.gz |
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.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/sp-error.result | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 05b6a2788ea..43430ca312b 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -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| |