• rucha174's avatar
    MDEV-22830: SQL_CALC_FOUND_ROWS not working properly for single SELECT for DUAL · 44339123
    rucha174 authored
    In case of SELECT without tables which returns either 0 or 1 rows,
    JOIN::exec_inner() did not check if the flag representing SQL_CALC_FOUND_ROWS
    is set or not and send_records was direclty assigned 0. So SELECT FOUND_ROWS()
    was giving 0 in the output. Now it checks if the flag is set, if it is set
    send_record=1 else 0. 1 is the number of rows that could have been sent
    to the client if the SELECT query had SQL_CALC_FOUND_ROWS.
    It is 0 when no rows were sent because the SELECT query did not have
    SQL_CALC_FOUND_ROWS.
    44339123
select_found.result 8.42 KB