0. Logged in as admin.
1. Create a Text input custom user profile field that must be unique (not sure if the unique bit is really necessary)
2. Go to browse list of users, and click to edit someone's profile.
3. Type something in the custom field box, and click save.
Comparisons of text column conditions are not allowed. Please use sql_compare_text() in your query.
line 513 of /lib/dml/moodle_database.php: dml_exception thrown
line 1288 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
line 134 of /user/profile/lib.php: call to moodle_database->get_field()
line 399 of /user/profile/lib.php: call to profile_field_base->edit_validate_field()
line 159 of /user/editadvanced_form.php: call to profile_validation()
line 438 of /lib/formslib.php: call to user_editadvanced_form->validation()
line 397 of /lib/formslib.php: call to moodleform->validate_defined_fields()
line 484 of /lib/formslib.php: call to moodleform->is_validated()
line 128 of /user/editadvanced.php: call to moodleform->get_data()