MDL-42768 restore: Use sql_compare_text instead for text comparison