[MDEV-17620] Long chain of +'es causes stack overflow Created: 2018-11-05 Updated: 2019-01-27 Resolved: 2019-01-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.1.24, 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | upstream | ||
| Description |
|
A query that consists of a lot of + operations can lead to a stack overflow. |
| Comments |
| Comment by Sergei Golubchik [ 2018-11-05 ] | ||
|
A couple of thousands expr + expr + expr ... will cause nested calls to Item_func_plus::val_decimal (or something) with three frames per plus, and it will overflow the stack. A possible solution could be to make Item_func_plus to take a list of arguments, much like AND and OR do. The same can be done for multiplication. It won't help for a more complex mix of operators, of course. I'm not sure this optimization is worth the troubles. | ||
| Comment by Elena Stepanova [ 2018-11-11 ] | ||
|
Reproducible everywhere, including MySQL 8.0.
Considering the above comment, leaving it to serg to decide what to do with it. | ||
| Comment by Sergei Golubchik [ 2018-11-12 ] | ||
|
We can never fix it for arbitrary complex expressions. Only for some special cases. It's not clear that this specific special case is so important that we should have a special fix for it. |