I run into this and was able to workaround it, see MariaDB: SQLSyntaxErrorException in escape like queries