I am in Drupal 7.51 / CiviCRM 4.7.12
I want to check Users emails against their corresponding Contacts emails (which happen to be different in the DB though they should not).
I have developped a small program to identify those cases (querying civicrm_email and drupal_users tables, linked via civicrm_uf_match).
I thought that the civicrm_uf_match table managed the link between the Drupal User id and the corresponding Civicrm Contact id ; but it actually does not : it contains only 31 lines though I have 446 Users and 667 Contacts with a primary email.
For instance, the civicrm_uf_match table does not contain my own ids pair ; moreover, it contains lots of errors (e.g. old emails which were deleted).
Question : how and where is managed this link between the Drupal User and the CiviCRM Contact (which appears when you consult/modify the Contact) ?