Skip to content

Commit c24ed7d

Browse files
authored
Merge pull request PerfectlySoft#50 from Bo98/binary-fix
Fixed incorrect binary field check
2 parents f9af3a9 + 8eb1cad commit c24ed7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PerfectMySQL/MySQLStmt.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public final class MySQLStmt {
100100
MYSQL_TYPE_MEDIUM_BLOB,
101101
MYSQL_TYPE_LONG_BLOB,
102102
MYSQL_TYPE_BLOB:
103-
if (field.pointee.flags & UInt32(BINARY_FLAG)) != 0 {
103+
if field.pointee.charsetnr == 63 /* binary */ {
104104
return .bytes
105105
}
106106
fallthrough
@@ -577,7 +577,7 @@ public final class MySQLStmt {
577577
MYSQL_TYPE_MEDIUM_BLOB,
578578
MYSQL_TYPE_LONG_BLOB,
579579
MYSQL_TYPE_BLOB:
580-
if ( (field.pointee.flags & UInt32(BINARY_FLAG)) != 0) {
580+
if field.pointee.charsetnr == 63 /* binary */ {
581581
return .bytes(type)
582582
}
583583
fallthrough

0 commit comments

Comments
 (0)