[MDEV-18423] Unable to unset a flag from sql_mode set to oracle Created: 2019-01-30 Updated: 2019-04-17 Resolved: 2019-04-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Variables |
| Affects Version/s: | 10.3.11 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Zdravelina Sokolovska (Inactive) | Assignee: | Alexander Barkov |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Unable to unset a flag from sql_mode set to oracle
|
| Comments |
| Comment by Zdravelina Sokolovska (Inactive) [ 2019-01-30 ] |
|
unset ANSI_QUOTES actually , with MariaDB [(none)]> SET session sql_mode=(SELECT REPLACE(@@sql_mode,'ANSI_QUOTES','')); is expected to unset the ANSI_QUOTES flag |
| Comment by Elena Stepanova [ 2019-01-30 ] |
|
As explicitly documented in MariaDB KB (and in MySQL manual too, if you prefer it), ORACLE is in fact an alias for a collection of modes, one of which is ANSI_QUOTES. The fact that starting from 10.3 setting the mode to ORACLE also makes the server understand a subset of PL/SQL syntax doesn't change the fact that it's still a collection of modes. You can't unset one element, but keep it the collection. If you unset ANSI_QUOTES, it's not "ORACLE" mode anymore. If you want to have all other elements of the collection except for ANSI_QUOTES, you need to unset/remove the ORACLE switch as well. |
| Comment by Elena Stepanova [ 2019-01-30 ] |
|
On the second thought, while all the above is true for the current versions, I also don't like it much that ORACLE mode has a double role – an alias for a set of modes and a switch for PL/SQL syntax. I guess it's an unfortunate legacy which isn't easy to overcome, but let's see if bar considers any possibility to change it in future. |
| Comment by Alexander Barkov [ 2019-03-29 ] |
|
winstone, is my understanding correct that in your session you want:
Why this combination might be needed? |