[MXS-885] Query parsing failing for certain queries when invoked from database firewall filter Created: 2016-10-07 Updated: 2016-10-11 Resolved: 2016-10-10 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | qc_sqlite |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Dipti Joshi (Inactive) | Assignee: | Johan Wikman |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
MaxScale is configured with database firewall filter and readwrite split service. Configuration files are attached Parsing for following query fails when invoked from dbfwfilter
Parsing of following query does not fail.
|
| Comments |
| Comment by Johan Wikman [ 2016-10-10 ] | ||||
|
According to https://mariadb.com/kb/en/sql-99/select-statement HAVING follows GROUP BY. And indeed, MariaDB 10.0.22 rejects that statement:
The following works fine:
| ||||
| Comment by Dipti Joshi (Inactive) [ 2016-10-11 ] | ||||
|
johan.wikman In that case the same error message as that reported by MariaDB should be reported by MaxScale. MaxScale error reported is "ERROR 1141 (HY000): Access denied for user 'appuser'@'172.19.0.1' to database 'tpcc': dbfwfilter: MariaDB error gives more useful information for user to correct their query - while MaxScale's error message is not informative enough for user to correct the query - it leads user to believe that it is an internal error rather than user error. | ||||
| Comment by Johan Wikman [ 2016-10-11 ] | ||||
|
The error cannot be the same, as the parser is not the same; it's not possible to know whether the statement could not be parsed due to it being invalid or due to the parser being deficient. Consequently, it is an access denied error, since unless the statement can be parsed completely we cannot know with certainty whether it matches a rule or not. However, the error message can suggest to verify the syntax of the statement. Further, the actual sqlite error will be logged as a warning. |