# File lib/rubyrep/direct_table_scan.rb, line 33
    def run(&blck)
      left_cursor = right_cursor = nil
      left_cursor = session.left.select_cursor(
        :table => left_table,
        :row_buffer_size => scan_options[:row_buffer_size],
        :type_cast => true
      )
      right_cursor = session.right.select_cursor(
        :table => right_table,
        :row_buffer_size => scan_options[:row_buffer_size],
        :type_cast => true
      )
      left_row = right_row = nil
      update_progress 0 # ensures progress bar is printed even if there are no records
      while left_row or right_row or left_cursor.next? or right_cursor.next?
        # if there is no current left row, _try_ to load the next one
        left_row ||= left_cursor.next_row if left_cursor.next?
        # if there is no current right row, _try_ to load the next one
        right_row ||= right_cursor.next_row if right_cursor.next?
        rank = rank_rows left_row, right_row
        case rank
        when -1
          yield :left, left_row
          left_row = nil
          update_progress 1
        when 1
          yield :right, right_row
          right_row = nil
          update_progress 1
        when 0
          update_progress 2
          if not left_row == right_row
            yield :conflict, [left_row, right_row]
          end
          left_row = right_row = nil
        end
        # check for corresponding right rows
      end
    ensure
      [left_cursor, right_cursor].each {|cursor| cursor.clear if cursor}
    end