[PATCH v2] Verify that returned rows exist before extracting columns