<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_results(cube, q):
 """ Generate the resulting records for this query, applying pagination. Values will be returned by their reference. """

    if q._limit is not None and q._limit < 1:
        return
    rp = cube.engine.execute(q)
    while True:
        row = rp.fetchone()
        if row is None:
            return
        yield dict(row.items())