Skip to content

Commit bcea889

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 42a061d commit bcea889

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
@@ -10845,8 +10845,9 @@ function TTableColumn.CastAsText: String;
1084510845
Result := 'CAST('+Result+' AS NVARCHAR('+IntToStr(GRIDMAXDATA)+'))';
1084610846
end;
1084710847
ngPgSQL: begin
10848-
// Cast *any* datatype, including VARCHAR and TEXT, which may have an [] array attribute
10849-
Result := Result + '::text';
10848+
// Cast most datatypes, including VARCHAR and TEXT, which may have an [] array attribute
10849+
if not (DataType.Category in [dtcInteger, dtcReal]) then
10850+
Result := Result + '::text';
1085010851
end;
1085110852
end;
1085210853
end;

0 commit comments

Comments
 (0)