Skip to content

Commit 3fcc626

Browse files
authored
Merge pull request vapor#95 from ViliamKopecky/master
Fix OID decoding as UInt32
2 parents a4c205a + c2bb1b5 commit 3fcc626

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/PostgreSQL/Data/PostgreSQLData+FixedWidthInteger.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ extension FixedWidthInteger {
1010
throw PostgreSQLError.decode(self, from: data)
1111
}
1212
i = value.as(Int16.self, default: 0).bigEndian.cast(to: Self.self)
13-
case .int4, .oid, .regproc:
13+
case .int4, .regproc:
1414
guard value.count == 4 else {
1515
throw PostgreSQLError.decode(self, from: data)
1616
}
1717
i = value.as(Int32.self, default: 0).bigEndian.cast(to: Self.self)
18+
case .oid:
19+
guard value.count == 4 else {
20+
throw PostgreSQLError.decode(self, from: data)
21+
}
22+
i = value.as(UInt32.self, default: 0).bigEndian.cast(to: Self.self)
1823
case .int8:
1924
guard value.count == 8 else {
2025
throw PostgreSQLError.decode(self, from: data)

0 commit comments

Comments
 (0)