Files
MaxScale/maxscale-system-test/masking/masking_mysqltest/t/masking_column.test
Markus Mäkelä d7d4ec29bb Add tests from develop
Added tests from develop. The test results need to be modified for 2.0.
2017-05-26 15:40:40 +03:00

76 lines
2.1 KiB
Plaintext

#
# Masking column handling
#
# Whether the column to be masked is first, in the middle or
# last should not matter.
#
# See ../masking_rules.json
--disable_warnings
drop database if exists maskingdb;
--enable_warnings
create database maskingdb;
use maskingdb;
create table masking (a TEXT, x TEXT, y TEXT);
insert into masking values ("hello", "hello", "hello");
insert into masking values (NULL, "hello", "hello");
insert into masking values ("hello", NULL, "hello");
insert into masking values ("hello", "hello", NULL);
insert into masking values (NULL, NULL, "hello");
insert into masking values ("hello", NULL, NULL);
insert into masking values (NULL, NULL, NULL);
select * from masking;
#a x y
#XXXXX hello hello
#NULL hello hello
#XXXXX NULL hello
#XXXXX hello NULL
#NULL NULL hello
#XXXXX NULL NULL
#NULL NULL NULL
drop table masking;
create table masking (x TEXT, a TEXT, y TEXT);
insert into masking values ("hello", "hello", "hello");
insert into masking values (NULL, "hello", "hello");
insert into masking values ("hello", NULL, "hello");
insert into masking values ("hello", "hello", NULL);
insert into masking values (NULL, NULL, "hello");
insert into masking values ("hello", NULL, NULL);
insert into masking values (NULL, NULL, NULL);
select * from masking;
#x a y
#hello XXXXX hello
#hello XXXXX hello
#NULL XXXXX hello
#hello NULL hello
#hello XXXXX NULL
#NULL NULL hello
#hello NULL NULL
#NULL NULL NULL
drop table masking;
create table masking (x TEXT, y TEXT, a TEXT);
insert into masking values ("hello", "hello", "hello");
insert into masking values (NULL, "hello", "hello");
insert into masking values ("hello", NULL, "hello");
insert into masking values ("hello", "hello", NULL);
insert into masking values (NULL, NULL, "hello");
insert into masking values ("hello", NULL, NULL);
insert into masking values (NULL, NULL, NULL);
select * from masking;
#x y a
#hello hello XXXXX
#NULL hello XXXXX
#hello NULL XXXXX
#hello hello NULL
#NULL NULL XXXXX
#hello NULL NULL
#NULL NULL NULL
drop table masking;