the upgrade from 1.6.3 to 1.7 of italian version doesn't work because a problem with ' (apostrophe).
To correct this behaviour you can patch moodle/lib/accesslib.php, line 1605, function create_role:
- from: $role->description = $description;
- to: $role->description = str_replace("'","\'",$description);
this preserve from crash the SQL command for create some role (function insert_record()).
I do not know if other situations exist that produce bad sql sintax.