Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
2.2.3
-
None
Description
I'm not sure if it's a bug, but I have a problem with data masking filter when query contains UNION.
CREATE TABLE `users` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(255) NOT NULL , `email` VARCHAR(255) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB; |
INSERT INTO `users` (`name`,`email`) VALUES ('John', 'john@example.com'),('Max', 'max@example.com'),('Peter', 'peter@example.com'); |
 |
mysql> select * from users;
|
+----+-------+-------------------+
|
| id | name | email |
|
+----+-------+-------------------+
|
| 1 | John | **************** | |
| 2 | Max | *************** | |
| 3 | Peter | ***************** | |
+----+-------+-------------------+
|
3 rows in set (0.00 sec) |
The UNION issue:
mysql> select * from users where id = 1 union select * from users where id = 2; |
+----+------+------------------+
|
| id | name | email |
|
+----+------+------------------+
|
| 1 | John | john@example.com | |
| 2 | Max | max@example.com | |
+----+------+------------------+
|
2 rows in set (0.00 sec) |
Config:
[Column-Masking]
|
type=filter
|
module=masking
|
warn_type_mismatch=always
|
large_payload=abort
|
rules=/etc/maxscale.d/masking_rules.json
|
masking_rules.json contains:
{
|
"rules": [ |
{
|
"replace": { |
"table": "users", |
"column": "email" |
},
|
"with": { |
"fill": "*" |
}
|
}
|
]
|
}
|
If remove table definition "table": "users" it works fine