Skip to content

Crash when unique constraint fails using C-API wrapper #491

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

Closed
ghost opened this issue Sep 8, 2016 · 1 comment
Closed

Crash when unique constraint fails using C-API wrapper #491

ghost opened this issue Sep 8, 2016 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 8, 2016

I get a crash when doing the following:

try Array(databaseConnection.prepare("CREATE TABLE \"users\" (\"id\" INTEGER PRIMARY KEY NOT NULL, \"name\" TEXT, \"email\" TEXT NOT NULL UNIQUE)"))

try Array(databaseConnection.prepare("INSERT INTO users (email) VALUES (\"betty@icloud.com\"), (\"cathy@icloud.com\")"))

try Array(databaseConnection.prepare("INSERT INTO users (email) VALUES (\"betty@icloud.com\"), (\"cathy@icloud.com\")"))

crashes with

fatal error: 'try!' expression unexpectedly raised an error: UNIQUE constraint failed: users.email: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-703.0.18.8/src/swift/stdlib/public/core/ErrorType.swift, line 54

Related to #430, but I made a new issue because it might be specific to the C API.

@jberkel
Copy link
Collaborator

jberkel commented Dec 7, 2016

Dup of #430

@jberkel jberkel closed this as completed Dec 7, 2016
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