Added support for SQL_CALC_FOUND_ROWS to handle pagination of raw queries