[MDEV-6980] OUT parameters in PREPARE Created: 2014-10-29 Updated: 2017-08-14 Resolved: 2014-12-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Fix Version/s: | 10.1.2 |
| Type: | Task | Priority: | Blocker |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Current — 10.1.1 — implementation of OUT parameters in PREPARE is as follows:
It is non-standard. And it's not strictly necessary, as there are easy workarounds. Standard syntax is
The workaround is:
We should consider changing the syntax to be standard or removing this feature completely. |
| Comments |
| Comment by Sergei Golubchik [ 2014-12-04 ] | |||||
|
removed completely | |||||
| Comment by Richard Bensley [ 2017-08-11 ] | |||||
|
@serg, are we going to see a return of this? Or something similar? Parameterised stored procedure SQL would be very VERY useful for dynamic table names, infile/outfile names, etc. | |||||
| Comment by Sergei Golubchik [ 2017-08-12 ] | |||||
|
it's not about parameterised stored procedure SQL, it's output parameters in PREPARE, dynamic SQL. | |||||
| Comment by Richard Bensley [ 2017-08-14 ] | |||||
|
Hi @serg, yes I understand.I see there were some great changes made in This is roughly what I mean, instead of create extremely large concat statements for analytics work loads to generate new tables and outfiles. e.g:
Also for outfiles!
Does that make sense? Our analytics sql is hundreds of lines long, I generally wrap SQL with something like python to generate data instead of using stored procedures. | |||||
| Comment by Sergei Golubchik [ 2017-08-14 ] | |||||
|
It makes sense. But the problem is that a parameter — OUT or IN, in PREPARE or in the protocol level prepared statements, even in stored procedures — it's an expression and can be used anywhere where an expression is allowed. In particular, table names cannot be parameters. |