[MDEV-6176] Request: assign value to server var within LAST_VALUE() Created: 2014-04-25 Updated: 2015-02-18 Resolved: 2015-02-18 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Trivial |
| Reporter: | Federico Razzoli | Assignee: | Sergei Golubchik |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I tried the following:
Not surprising: after all setting @@session.sql_mode requires SET. But this is something one might wish to do. |
| Comments |
| Comment by Sergei Golubchik [ 2014-04-28 ] |
|
What did that statement suppose to do? |
| Comment by Federico Razzoli [ 2014-04-28 ] |
|
If LAST_VALUE() worked with server variables, that statement would assign the same string to both session sql_mode and global sql_mode. |
| Comment by Sergei Golubchik [ 2015-02-18 ] |
|
Server variables can only be assigned in the SET statement. Not in an expression. User variables can be assigned inside of an expression — that's why they work in the LAST_VALUE, and often are used in the SELECT statement. But you cannot use server variables this way (not in the SELECT statement either). I don't think we should make an exception for "LAST_VALUE in the SET statement" use case. So what you're really asking about is to allow server variables to be assigned inside an expression. This looks like a reasonable feature request. But I'll close this |