[imp][32131] Refactored method to use server variables. Fixes #3886

Setting test database collation