Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertionFailure happened in iterator #1271

Open
phuanggh opened this issue Jul 4, 2024 · 0 comments
Open

assertionFailure happened in iterator #1271

phuanggh opened this issue Jul 4, 2024 · 0 comments

Comments

@phuanggh
Copy link

phuanggh commented Jul 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant