MXS-1278: Change modes when 'set sql_mode=' is encountered.

The initial setting of sql_mode affects how MaxScale initially
behaves with respect to autocommit.

When 'set sql_mode=[default|oracle];" is encountered, the query
classifier and autocommit modes are adjusted accordingly.
This commit is contained in:
Johan Wikman
2017-06-13 15:27:41 +03:00
parent 8128c74341
commit bea551092d
3 changed files with 16 additions and 0 deletions

View File

@ -534,6 +534,9 @@ sql_mode=oracle
The default value is `default`.
**NOTE** If `sql_mode` is set to `oracle`, then MaxScale will also assume
that `autocommit` initially is off.
At runtime, MariaDB MaxScale will recognize statements like
```
set sql_mode=oracle;
@ -544,6 +547,11 @@ set sql_mode=default;
```
and change mode accordingly.
**NOTE** If `set sql_mode=oracle;` is encountered, then MaxScale will also
behave as if `autocommit` had been turned off and conversely, if
`set sql_mode=default;` is encountered, then MaxScale will also behave
as if `autocommit` had been turned on.
Note that MariaDB MaxScale is **not** explicitly aware of the sql mode of
the server, so the value of `sql_mode` should reflect the sql mode used
when the server is started.