[MXS-2850] MaxScale masking does not work with UNION ALL Created: 2020-01-27  Updated: 2020-08-25  Resolved: 2020-01-28

Status: Closed
Project: MariaDB MaxScale
Component/s: qc_sqlite
Affects Version/s: 2.4.5
Fix Version/s: 2.3.17, 2.4.7

Type: Bug Priority: Major
Reporter: Muhammad Irfan Assignee: Johan Wikman
Resolution: Fixed Votes: 1
Labels: None


 Description   

MaxScale masking handles UNION correctly, but does not handle UNION ALL

mysql> SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT COL FROM TABLE LIMIT 2;
+------+
| 1 |
+------+
| 1 |
| 2 |
+------+
2 rows in set (0.00 sec)
 
mysql> SELECT 1 UNION SELECT 2 UNION SELECT COL FROM TABLE;
ERROR 1141 (HY000): The field COL that should be masked for 'user'@'host' is used in the second or subsequent SELECT of a UNION, access is denied.

config file setting:

[Mask-Strings]
type=filter
module=masking
large_payload=abort
rules=/etc/mask-rules.json
 
[Mask-Service]
type=service
filters=Mask-Strings
router=readwritesplit
servers=server1,server2
user=MAX_SCALE_USER
password=MAX_SCALE_PASSWORD
enable_root_user=false
 
{
      "replace": {
        "column": "COL"
      },
      "with": {
        "value": ".",
        "fill": "."
      }


Generated at Thu Feb 08 04:17:08 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.