This code was probably added before sql_result refcounting.
struct cassandra_db *db = (struct cassandra_db *)_result->db;
struct cassandra_result *result = (struct cassandra_result *)_result;
- if (result->api.callback) {
- /* we're coming here from a user's sql_result_free() that's
- being called from a callback. we'll do this later,
- so ignore. */
- return;
- }
-
+ i_assert(!result->api.callback);
i_assert(db->cur_result == result);
i_assert(result->callback == NULL);
struct pgsql_result *result = (struct pgsql_result *)_result;
bool success;
- if (result->api.callback) {
- /* we're coming here from a user's sql_result_free() that's
- being called from a callback. we'll do this later,
- so ignore. */
- return;
- }
-
+ i_assert(!result->api.callback);
i_assert(db->cur_result == result);
i_assert(result->callback == NULL);