Ticket/10966 Remove code duplication from mysql* and mssql* dbal

http://tracker.phpbb.com/browse/PHPBB3-10966