[MDEV-32922] stored procedure outvars not looked up in execute immediate Created: 2023-12-01 Updated: 2023-12-05 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements, Stored routines |
| Affects Version/s: | 10.4.32, 10.11.6 |
| Fix Version/s: | 10.4, 10.11 |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
|
| Comments |
| Comment by Alexander Barkov [ 2023-12-05 ] | ||||||||||||||||||||||||
|
Variables are not seen inside prepared statements.
The problem is that EXECUTE IMMEDIATE is just a short for:
After the PREPARE step, the prepared statement gets caches in the connection prepared statement list goes out of the context. This explain why variables are not supported. Variables can be passed as parameters and the EXECUTE step:
However, the INTO clause does not support parameters yet:
The workaround is to use the INTO clause directly with the user variable rather than a parameter. |