| Bug #19584 | CREATE USER in STORED PROCEDURE doesn't work with Variables | ||
|---|---|---|---|
| Submitted: | 6 May 2006 18:42 | Modified: | 11 Aug 2013 17:05 |
| Reporter: | Christian Benner | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Stored Routines | Severity: | S4 (Feature request) |
| Version: | 5.0.20-nt-max | OS: | Windows (W2K SRV) |
| Assigned to: | CPU Architecture: | Any | |
[11 May 2006 16:52]
Valeriy Kravchuk
Thank you for a problem report. Using locally declared varaibles in such a way may be useful. So, I think, it is a valid feature request. Some day a combination of prepared statement (http://dev.mysql.com/doc/refman/5.0/en/sqlps.html) and user varaibles http://dev.mysql.com/doc/refman/5.0/en/user-variables.html will do the job. But not yet.
[25 Jan 2007 11:38]
Dariusz Wlodarczyk
Is any progress with this bug/feature request ?
[8 Feb 2009 17:31]
Demkó Gábor
Just tried to do the same, but it didnt worked for me, yet
[7 Jul 2009 16:14]
Andy Royer
Still not implemented yet. I'd definitely like to see this feature added.
[11 Aug 2013 17:05]
Christian Benner
Now, around 2700 (!!!) days later ... it's not implemented and does'nt works for me...

Description: I tried to create a new user on a testmachine with a stored procedure but only with "select UNA" I get the correct value from the given variable back. Behind the "CREATE USER" statement the variable isn't used as variable but as a statement. (the Declare and Select I've used here are only for demonstration of the problem) Maybe this isn't a bug but a feature ? :-) mysql> call mysql.createUser('testname','testpw'); +----------+ | UNA | +----------+ | testname | +----------+ 1 row in set (0.00 sec) Query OK, 0 rows affected (0.00 sec) How to repeat: CREATE DEFINER=`sala`@`localhost` PROCEDURE `createUser`(IN uname varchar(255),IN pwort varchar(255)) BEGIN Declare UNA varchar(255); set UNA=uname; SELECT UNA; CREATE USER UNA; END