Skip to content

assertionFailure happened in iterator #1271

Open
@phuanggh

Description

@phuanggh

version: 0.15.2

a crash happened at AnyIterator { statement.next().map { Row(columnNames, $0) } } in Query.swift

public func prepare(_ query: QueryType) throws -> AnySequence<Row> {
        let expression = query.expression
        let statement = try prepare(expression.template, expression.bindings)

        let columnNames = try columnNamesForQuery(query)

        return AnySequence {
            AnyIterator { statement.next().map { Row(columnNames, $0) } }
        }
    }

I saw #1075 but am unsure how I am supposed to handle errors using failableNext directly.
I used a do-catch block for this func prepare(_: ) but this didn't prevent the crash from happening

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions