TDBQuery.HasFullData: Additional test if column name contains a known LEFT or SUBSTR function. Fixes #1850, at least if the original column names are provided by the library.

This commit is contained in:
Ansgar Becker
2023-09-16 11:55:17 +02:00
parent dbd5ea9fff
commit e064570a8c

View File

@@ -9406,8 +9406,15 @@ begin
FConnection.Log(lcInfo, 'HasFullData: RowNum:'+RecNo.ToString+
' ColumnNames['+i.ToString+']:'+ColumnNames[i]+
' ColumnOrgNames['+i.ToString+']:'+ColumnOrgNames[i]+
' NumChars:'+NumChars.ToString
' NumChars:'+NumChars.ToString+
' ColumnLengths('+i.ToString+'):'+ColumnLengths(i).ToString
);}
if ColumnNames[i].StartsWith('LEFT', True) or ColumnNames[i].StartsWith('SUBSTR', True) then begin
// This works at least in MySQL, and fixes issue #1850 where NumChars is > 256 when text contains emojis.
// MSSQL does not provide the original column names with function calls like LEFT(..)
Result := False;
Break;
end;
if (NumChars <= GRIDMAXDATA) and (NumChars >= GRIDMAXDATA / SizeOf(Char)) then begin
Result := False;
Break;