Views filter on field being either empty or equal to uid
I found the way to fix this. The answer is twofold:

First create two filters: one for the field being empty and one for the field being equal to the string "uid". Then as a Filter Criteria option, choose And/Or, Rearrange and add the Or condition:



This is the result:



Second implement hook_views_query_alter() to replace the "uid" string we added earlier with the actual user uid:

/**
 * Implements hook_views_query_alter().
 *
 * Search for 'personal' field to be empty or equal to uid.
 */
function example_views_query_alter(&amp;$view, &amp;$query) {
  if ($view-&gt;name == 'myview') {
    foreach ($query-&gt;where as &amp;$condition_group) {
      foreach ($condition_group['conditions'] as &amp;$condition) {
        if ($condition['field'] == 'table.field_quality_personal' &amp;&amp; $condition['value'] == 'uid') {
          global $user;
          $condition['value'] = $user-&gt;uid;
        }
      }
    }
  }
}


That's it!