1089 |
|
var s: RawByteString; |
1090 |
|
begin |
1091 |
|
s := AValue; |
1092 |
< |
if StringCodePage(Value) <> CodePage then |
1092 |
> |
if StringCodePage(s) <> CodePage then |
1093 |
|
SetCodePage(s,CodePage,CodePage<>CP_NONE); |
1094 |
|
inherited SetAsString(s); |
1095 |
|
end; |
1208 |
|
s: RawByteString; |
1209 |
|
begin |
1210 |
|
Buffer := nil; |
1211 |
< |
IBAlloc(Buffer, 0, Size + 1); |
1211 |
> |
IBAlloc(Buffer, 0, DataSize); |
1212 |
|
try |
1213 |
|
s := Value; |
1214 |
|
if StringCodePage(s) <> CodePage then |
1215 |
|
SetCodePage(s,CodePage,CodePage<>CP_NONE); |
1216 |
< |
StrLCopy(Buffer, PChar(s), Size); |
1216 |
> |
StrLCopy(Buffer, PChar(s), DataSize-1); |
1217 |
|
if Transliterate then |
1218 |
|
DataSet.Translate(Buffer, Buffer, True); |
1219 |
|
SetData(Buffer); |
1963 |
|
pbd: PBlobDataArray; |
1964 |
|
pda: PArrayDataArray; |
1965 |
|
i, j: Integer; |
1966 |
< |
LocalData: PChar; |
1966 |
> |
LocalData: PByte; |
1967 |
|
LocalDate, LocalDouble: Double; |
1968 |
|
LocalInt: Integer; |
1969 |
|
LocalBool: wordBool; |
2030 |
|
SQL_TIMESTAMP: |
2031 |
|
begin |
2032 |
|
LocalDate := TimeStampToMSecs(DateTimeToTimeStamp(Qry[i].AsDateTime)); |
2033 |
< |
LocalData := PChar(@LocalDate); |
2033 |
> |
LocalData := PByte(@LocalDate); |
2034 |
|
end; |
2035 |
|
SQL_TYPE_DATE: |
2036 |
|
begin |
2037 |
|
LocalInt := DateTimeToTimeStamp(Qry[i].AsDateTime).Date; |
2038 |
< |
LocalData := PChar(@LocalInt); |
2038 |
> |
LocalData := PByte(@LocalInt); |
2039 |
|
end; |
2040 |
|
SQL_TYPE_TIME: |
2041 |
|
begin |
2042 |
|
LocalInt := DateTimeToTimeStamp(Qry[i].AsDateTime).Time; |
2043 |
< |
LocalData := PChar(@LocalInt); |
2043 |
> |
LocalData := PByte(@LocalInt); |
2044 |
|
end; |
2045 |
|
SQL_SHORT, SQL_LONG: |
2046 |
|
begin |
2047 |
|
if (fdDataScale = 0) then |
2048 |
|
begin |
2049 |
|
LocalInt := Qry[i].AsLong; |
2050 |
< |
LocalData := PChar(@LocalInt); |
2050 |
> |
LocalData := PByte(@LocalInt); |
2051 |
|
end |
2052 |
|
else |
2053 |
|
if (fdDataScale >= (-4)) then |
2054 |
|
begin |
2055 |
|
LocalCurrency := Qry[i].AsCurrency; |
2056 |
< |
LocalData := PChar(@LocalCurrency); |
2056 |
> |
LocalData := PByte(@LocalCurrency); |
2057 |
|
end |
2058 |
|
else |
2059 |
|
begin |
2060 |
|
LocalDouble := Qry[i].AsDouble; |
2061 |
< |
LocalData := PChar(@LocalDouble); |
2061 |
> |
LocalData := PByte(@LocalDouble); |
2062 |
|
end; |
2063 |
|
end; |
2064 |
|
SQL_INT64: |
2066 |
|
if (fdDataScale = 0) then |
2067 |
|
begin |
2068 |
|
LocalInt64 := Qry[i].AsInt64; |
2069 |
< |
LocalData := PChar(@LocalInt64); |
2069 |
> |
LocalData := PByte(@LocalInt64); |
2070 |
|
end |
2071 |
|
else |
2072 |
|
if (fdDataScale >= (-4)) then |
2073 |
|
begin |
2074 |
|
LocalCurrency := Qry[i].AsCurrency; |
2075 |
< |
LocalData := PChar(@LocalCurrency); |
2075 |
> |
LocalData := PByte(@LocalCurrency); |
2076 |
|
end |
2077 |
|
else |
2078 |
|
begin |
2079 |
|
LocalDouble := Qry[i].AsDouble; |
2080 |
< |
LocalData := PChar(@LocalDouble); |
2080 |
> |
LocalData := PByte(@LocalDouble); |
2081 |
|
end |
2082 |
|
end; |
2083 |
|
SQL_DOUBLE, SQL_FLOAT, SQL_D_FLOAT: |
2084 |
|
begin |
2085 |
|
LocalDouble := Qry[i].AsDouble; |
2086 |
< |
LocalData := PChar(@LocalDouble); |
2086 |
> |
LocalData := PByte(@LocalDouble); |
2087 |
|
end; |
2088 |
|
SQL_BOOLEAN: |
2089 |
|
begin |
2090 |
|
LocalBool := Qry[i].AsBoolean; |
2091 |
< |
LocalData := PChar(@LocalBool); |
2091 |
> |
LocalData := PByte(@LocalBool); |
2092 |
|
end; |
2093 |
|
end; |
2094 |
|
|
3819 |
|
their values } |
3820 |
|
SQL_VARYING, SQL_TEXT: |
3821 |
|
begin |
3822 |
< |
FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize); |
3823 |
< |
CharSetName := FirebirdAPI.GetCharsetName(getCharSetID); |
3824 |
< |
FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3822 |
> |
if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then |
3823 |
> |
CharSetSize := 1; |
3824 |
> |
CharSetName := Database.Attachment.GetCharsetName(getCharSetID); |
3825 |
> |
Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3826 |
|
FieldSize := GetSize div CharSetSize; |
3827 |
|
FieldType := ftString; |
3828 |
|
end; |
3884 |
|
FieldSize := sizeof (TISC_QUAD); |
3885 |
|
if (getSubtype = 1) then |
3886 |
|
begin |
3887 |
< |
FirebirdAPI.CharSetWidth(getCharSetID,CharSetSize); |
3888 |
< |
CharSetName := FirebirdAPI.GetCharsetName(getCharSetID); |
3889 |
< |
FirebirdAPI.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3887 |
> |
if not Database.Attachment.CharSetWidth(getCharSetID,CharSetSize) then |
3888 |
> |
CharSetSize := 1; |
3889 |
> |
CharSetName := Database.Attachment.GetCharsetName(getCharSetID); |
3890 |
> |
Database.Attachment.CharSetID2CodePage(getCharSetID,FieldCodePage); |
3891 |
|
FieldType := ftMemo; |
3892 |
|
end |
3893 |
|
else |