Skip to content

Commit 32539ef

Browse files
committed
[sql_cacher] fix proper update on status/report upon quick exit
Be sure the SR info is properly updated (on the reload result) even when doing a quick return upon no records loaded
1 parent 3bef4af commit 32539ef

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

modules/sql_cacher/sql_cacher.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -942,11 +942,8 @@ static int load_entire_table(cache_entry_t *c_entry, db_handlers_t *db_hdls,
942942
}
943943

944944
/* anything loaded ? if not, we can do a quick exit here */
945-
if (RES_ROW_N(sql_res) == 0) {
946-
lock_stop_write(db_hdls->c_entry->ref_lock);
947-
db_hdls->db_funcs.free_result(db_hdls->db_con, sql_res);
948-
return 0;
949-
}
945+
if (RES_ROW_N(sql_res) == 0)
946+
goto done;
950947

951948
row = RES_ROWS(sql_res);
952949
values = ROW_VALUES(row);
@@ -982,6 +979,7 @@ static int load_entire_table(cache_entry_t *c_entry, db_handlers_t *db_hdls,
982979
}
983980
} while (RES_ROW_N(sql_res) > 0);
984981

982+
done:
985983
lock_stop_write(db_hdls->c_entry->ref_lock);
986984

987985
db_hdls->db_funcs.free_result(db_hdls->db_con, sql_res);

0 commit comments

Comments
 (0)