• unknown's avatar
    A fix and test case for Bug#6088 "FOUND_ROWS returns wrong values for · 9b5cf946
    unknown authored
    prepared statements when LIMIT is used" and post-review comments.
    The fix changes the approach we calculate the need for ORDER BY 
    in UNION: the previous was not PS friendly, as it damaged SELECT_LEX 
    options in case of single select.
    
    
    mysql-test/r/ps.result:
      Test results fixed: the test case for Bug#6088
    mysql-test/r/subselect.result:
      Test results fixed: now we don't perform ORDER BY for parts of UNION
      if there is no LIMIT clause.
    mysql-test/t/ps.test:
      A test case for Bug#6088 "FOUND_ROWS returns wrong values for
       prepared statements when LIMIT is used".
    sql/sql_union.cc:
      The actual fix for Bug#6088:
      - don't modify SELECT_LEX'es
      - use boolean variable can_skip_order_by to check if we can skip
        ORDER BY in UNION
    9b5cf946
ps.test 11.3 KB