Skip to content

assertion failure because internal typename for CHAR(n) is BPCHAR #71

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
tkrajacic opened this issue Dec 19, 2019 · 0 comments · Fixed by #72
Closed

assertion failure because internal typename for CHAR(n) is BPCHAR #71

tkrajacic opened this issue Dec 19, 2019 · 0 comments · Fixed by #72
Labels
bug Something isn't working

Comments

@tkrajacic
Copy link
Contributor

I hit an assertion failure in PostgresData+Int.swift:

switch self.formatCode {
        case .binary:
            switch self.type {
            case .char, .bpchar:
                assert(value.readableBytes == 1) // <- Here

debugger output at that point:

(lldb) po self.type
▿ BPCHAR
  - rawValue : 1042

(lldb) po postgresData.debugDescription
"Optional(0x0020 (BPCHAR))"

(lldb) po self.debugDescription
"0x0020 (BPCHAR)"

and value.readableBytes is 2.

Most likely has to do with CHAR(1) columns I have in my tables although those tables are empty when I hit the assertion.

@tkrajacic tkrajacic changed the title assertionFailure because internal typename for CHAR(n) is BPCHAR assertion failure because internal typename for CHAR(n) is BPCHAR Dec 19, 2019
@tanner0101 tanner0101 added the bug Something isn't working label Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants