From 3a326120968af023bb3b68da57fb3af6bcc7f09e Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 26 Mar 2019 16:08:33 +0200 Subject: [PATCH] MXS-2403 Extend test --- maxscale-system-test/masking_auto_firewall.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/maxscale-system-test/masking_auto_firewall.cpp b/maxscale-system-test/masking_auto_firewall.cpp index 7f81f8577..554d1addb 100644 --- a/maxscale-system-test/masking_auto_firewall.cpp +++ b/maxscale-system-test/masking_auto_firewall.cpp @@ -110,6 +110,24 @@ void run(TestConnections& test) // This should NOT succeed as a masked column is used in a statement // defining a variable. test_one(test, "set @a = (SELECT a, b FROM masking_auto_firewall)", Expect::FAILURE); + + // This SHOULD succeed as a masked column is not used in the statment. + test_one(test, "select 1 UNION select b FROM masking_auto_firewall", Expect::SUCCESS); + + // This should NOT succeed as a masked column is used in the statment. + test_one(test, "select 1 UNION select a FROM masking_auto_firewall", Expect::FAILURE); + + // This should NOT succeed as '*' is used in the statment. + test_one(test, "select 1 UNION select * FROM masking_auto_firewall", Expect::FAILURE); + + // This SHOULD succeed as a masked column is not used in the statment. + test_one(test, "select * FROM (select b from masking_auto_firewall)", Expect::SUCCESS); + + // This SHOULD succeed as a masked column is not used in the statment. + test_one(test, "select * FROM (select a as b from masking_auto_firewall)", Expect::FAILURE); + + // This SHOULD succeed as '*' is used in the statment. + test_one(test, "select * FROM (select * from masking_auto_firewall)", Expect::FAILURE); } }