Background
Currently, the tables mapping actors to behaviors/proxies/tunnels are allowed to have null values:
MariaDB [ipoid]> DESCRIBE actor_data_behaviors; +---------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------------+------+-----+---------+-------+ | actor_data_id | bigint(20) unsigned | YES | | NULL | | | behavior_id | bigint(20) unsigned | YES | | NULL | | +---------------+---------------------+------+-----+---------+-------+ 2 rows in set (0.002 sec) MariaDB [ipoid]> DESCRIBE actor_data_proxies; +---------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------------+------+-----+---------+-------+ | actor_data_id | bigint(20) unsigned | YES | | NULL | | | proxy_id | bigint(20) unsigned | YES | | NULL | | +---------------+---------------------+------+-----+---------+-------+ 2 rows in set (0.002 sec) MariaDB [ipoid]> DESCRIBE actor_data_tunnels; +---------------+---------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------+---------------------+------+-----+---------+-------+ | actor_data_id | bigint(20) unsigned | YES | | NULL | | | tunnel_id | bigint(20) unsigned | YES | | NULL | | +---------------+---------------------+------+-----+---------+-------+ 2 rows in set (0.002 sec)
Any row containing null is not a useful map, so null should not be allowed.
Example
Statement that should fail, but currently doesn't fail:
INSERT INTO actor_data_behaviors (actor_data_id, behavior_id) VALUES( (SELECT pkid FROM actor_data WHERE ip = '${actorObj.actor_data.ip}'), (SELECT pkid FROM behaviors WHERE behavior = 'not-in-behavior-table') );