[MDEV-14347] CREATE PROCEDURE returns no error when using an unknown variable Created: 2017-11-10 Updated: 2020-06-10 Resolved: 2020-06-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Stored routines |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.5.4 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Description |
|
Now if I call the procedure as follows:
it still returns no errors. It only returns an error if the condition in IF evaluates to true:
This behavior makes it very difficult to design stored procedures. In this context, x can only be a variable. It cannot be a column because no tables are involved. |
| Comments |
| Comment by Alexander Barkov [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||
|
More examples when an error is not returned:
| ||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||
|
More examples with TVC when no error is returned:
| ||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||
|
More examples with DEFAULT and VALUE
| ||||||||||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2020-06-03 ] | ||||||||||||||||||||||||||||||||
|
sanja, can you please review a patch? https://github.com/MariaDB/server/commit/06942363ebc847c5cd16f4b8e610451d3c8eeb3f Thanks. | ||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2020-06-08 ] | ||||||||||||||||||||||||||||||||
|
OK, to push | ||||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2020-06-08 ] | ||||||||||||||||||||||||||||||||
|
igor it looks like Item::walk do not check TVC now even if asked to go inside subqueries (see the patch) |