[MDEV-6942] SET SESSION statement combined with SET STATEMENT has no effect if it's executed for the same variable Created: 2014-10-24 Updated: 2016-01-22 Resolved: 2016-01-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Documentation |
| Affects Version/s: | N/A |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||
| Sprint: | 10.1.11 | ||||||||||||
| Description |
|
If it's not expected to work, there should be an error or a warning. Percona has a more generic flavor of the problem, where it doesn't work for any combination of variables (https://bugs.launchpad.net/percona-server/+bug/1341438), while in our case it happens when the same variable appears in SET STATEMENT and SET SESSION. |
| Comments |
| Comment by Oleksandr Byelkin [ 2014-10-26 ] |
|
Why it does not work? SET SETSTATEMENT store old value, SET sets new one and SET STATEMENT restore old one. i.e. SET STATEMENT equal to: SET @save=@@variable; |
| Comment by Elena Stepanova [ 2014-10-26 ] |
|
It's an edge case when it comes to the definition of SET STATEMENT, but the common sense suggests that in this situation it isn't supposed to restore the saved value, since it was changed explicitly in <STATEMENT>. It doesn't look meaningful in this simplest form, but imagine that <STATEMENT> is in fact a complicated code, e.g. a stored procedure, and the value changes somewhere deep inside. It would be very unexpected that the whole procedure works smoothly, but the value does not get changed at the end. Re-opening so you could re-consider. Please think about it from the user's perspective, not from the implementation side. |
| Comment by Oleksandr Byelkin [ 2015-03-11 ] |
|
IMHO it should be just documented. |
| Comment by Oleksandr Byelkin [ 2016-01-22 ] |
|
Documentation fixed: https://mariadb.com/kb/en/mariadb/set-statement/ |