[MDEV-21425] When using Dynamic Query, There is some Problem. Created: 2020-01-06 Updated: 2020-01-23 Resolved: 2020-01-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Prepared Statements |
| Affects Version/s: | 10.3.13, 10.3 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Songuyoung | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I want to use several Dynamic Queries in one Variable. IF we set several dynamic queries in one variable, MariaDB can't execute the Dynamic queries. However If we use 'IF (1=1)' Then we can use dynamic queries in one variable. Is this intentional behavior or bug? IF it is not bug, I want to know there is any problem using like this. (ex)
|
| Comments |
| Comment by Elena Stepanova [ 2020-01-13 ] |
|
bar, what do you think, is it a bug or not? |
| Comment by Jacob Williams [ 2020-01-22 ] |
|
Isn't this just a limitation on multiple statements in an execute body? If you use a `BEGIN NOT ATOMIC ... END;` instead of the `IF` clause it should work as well. |
| Comment by Sergei Golubchik [ 2020-01-23 ] |
|
Yes, exactly, you can only PREPARE one statement. IF ... END IF or BEGIN NOT ATOMIC ... END is one compound statement, see https://mariadb.com/kb/en/programmatic-compound-statements/ But three statements separated by semicolons are just that — three statements. |