Skip to content

Commit

Permalink
fixed TSqlDBPostgresStatement.ColumnToJson for BOOLID
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Aug 21, 2023
1 parent 8b7c5cb commit 30b1bdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/db/mormot.db.sql.postgres.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1285,8 +1285,11 @@ procedure TSqlDBPostgresStatement.ColumnToJson(Col: integer; W: TJsonWriter);
ftInt64,
ftDouble,
ftCurrency:
// note: StrLen is slightly faster than PQ.GetLength for small content
W.AddNoJsonEscape(P, StrLen(P));
if ColumnAttr = BOOLOID then // = PQ.ftype(fRes, Col)
W.Add((P <> nil) and (PUtf8Char(P)^ = 't'))
else
// note: StrLen is slightly faster than PQ.GetLength for small content
W.AddNoJsonEscape(P, StrLen(P));
ftUtf8:
if (ColumnAttr = JSONOID) or
(ColumnAttr = JSONBOID) then
Expand Down
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'2.1.5772'
'2.1.5773'

0 comments on commit 30b1bdb

Please sign in to comment.