[ticket/12890] Don't compare empty values for tests

Postgres and MySQL have different behaviour for sorting
NULL values, would cause the test to fail

PHPBB3-12890