# HG changeset patch # User Timo Sirainen # Date 1500303276 -10800 # Node ID d950ffd7cbe0940d868953130d07ed237c6f057a # Parent b9a2a6135419515cd16512fc67afe326ca414a41 dict-sql: Add support for sql_result_more() diff -r b9a2a6135419 -r d950ffd7cbe0 src/lib-dict/dict-sql.c --- a/src/lib-dict/dict-sql.c Mon Jul 17 14:22:35 2017 +0300 +++ b/src/lib-dict/dict-sql.c Mon Jul 17 17:54:36 2017 +0300 @@ -731,6 +731,21 @@ } ret = sql_result_next_row(ctx->result); + while (ret == SQL_RESULT_NEXT_MORE) { + if ((ctx->flags & DICT_ITERATE_FLAG_ASYNC) == 0) + sql_result_more_s(&ctx->result); + else { + /* get more results asynchronously */ + ctx->synchronous_result = TRUE; + sql_result_more(&ctx->result, sql_dict_iterate_callback, ctx); + ctx->synchronous_result = FALSE; + if (ctx->result == NULL) { + _ctx->has_more = TRUE; + return FALSE; + } + } + ret = sql_result_next_row(ctx->result); + } if (ret == 0) { /* see if there are more results in the next map. don't do it if we're looking for an exact match, since we