Skip to content

Commit 04a9492

Browse files
committed
fix: prevent grid queries from doing "WHERE intcol::text = 1", due to "1" being incompatible to the text value on the left
Refs #2499
1 parent c94b860 commit 04a9492

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

source/dbconnection.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10968,8 +10968,9 @@ function TTableColumn.CastAsText: String;
1096810968
Result := 'CAST('+Result+' AS NVARCHAR('+IntToStr(GRIDMAXDATA)+'))';
1096910969
end;
1097010970
ngPgSQL: begin
10971-
// Cast *any* datatype, including VARCHAR and TEXT, which may have an [] array attribute
10972-
Result := Result + '::text';
10971+
// Cast most datatypes, including VARCHAR and TEXT, which may have an [] array attribute
10972+
if not (DataType.Category in [dtcInteger, dtcReal]) then
10973+
Result := Result + '::text';
1097310974
end;
1097410975
end;
1097510976
end;

0 commit comments

Comments
 (0)