diff options
author | unknown <pem@mysql.com> | 2005-10-11 15:01:38 +0200 |
---|---|---|
committer | unknown <pem@mysql.com> | 2005-10-11 15:01:38 +0200 |
commit | 71c8962221035466066003226bfb268e4b8f4e1c (patch) | |
tree | 1a5f79805353fdf20bfe9c8e38af32aecd5871b0 /mysql-test/r/sp-error.result | |
parent | 931771422fc713dea035aff0993c6223b53e7a55 (diff) | |
download | mariadb-git-71c8962221035466066003226bfb268e4b8f4e1c.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.
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.
Diffstat (limited to 'mysql-test/r/sp-error.result')
-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| |