• mithun's avatar
    Bug #17059925: UNIONS COMPUTES ROWS_EXAMINED INCORRECTLY · ee3c555a
    mithun authored
    ISSUE:
    ------
    For UNION of selects, rows examined by the query will be sum
    of rows examined by individual select operations and rows
    examined for union operation. The value of session level
    global counter that is used to count the rows examined by a
    select statement should be accumulated and reset before it
    is used for next select statement. But we have missed to
    reset the same. Because of this examined row count of a
    select query is accounted more than once.
    
    SOLUTION:
    ---------
    In union reset the session level global counter used to
    accumulate count of examined rows after its value is saved.
    
    mysql-test/r/union.result:
      Expected output of testcase added.
    mysql-test/t/union.test:
      Test to verify examined row count of Union operations.
    sql/sql_union.cc:
      Reset the value of thd->examined_row_count after
      accumulating the value.
    ee3c555a
sql_union.cc 25.9 KB