Fix preg_match comparison in MySQL and SQLite adapters, add tests, fixes #419