View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033710 | FPC | FCL | public | 2018-05-08 13:05 | 2018-05-08 14:04 |
Reporter | Ondrej Pokorny | Assigned To | Michael Van Canneyt | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.1.1 | Product Build | |||
Target Version | 3.2.0 | Fixed in Version | 3.1.1 | ||
Summary | 0033710: [fcl-db] Setting TParam.DataType to the same value clears the param value if it cannot be represented as variant | ||||
Description | If you do: Q.Params[0].DataType := Q.Params[0].DataType it deletes the param content if it cannot be represented as variant. | ||||
Steps To Reproduce | program DBLargeInt; uses DB, SQLDB; var Q: TSQLQuery; I: LargeInt; begin Q := TSQLQuery.Create(nil); Q.SQL.Text := 'SELECT :PARAM'; Q.Params[0].AsLargeInt := High(Int64); I := Q.Params[0].AsLargeInt; WriteLn(I); if Q.Params[0].DataType <> ftLargeint then // this is OK -> just check that type is ftLargeint Halt(2); Q.Params[0].DataType := Q.Params[0].DataType; // setting the same datatype clears the value WriteLn(Q.Params[0].AsLargeInt); if I<>Q.Params[0].AsLargeInt then Halt(1); Q.Free; end. | ||||
Additional Information | Patch attached. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 38949 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
dsparams-01.patch (399 bytes)
Index: packages/fcl-db/src/base/dsparams.inc =================================================================== --- packages/fcl-db/src/base/dsparams.inc (revision 38948) +++ packages/fcl-db/src/base/dsparams.inc (working copy) @@ -840,6 +840,7 @@ VT : Integer; begin + if FDataType=AValue then Exit; FDataType:=AValue; VT:=FieldTypetoVariantMap[AValue]; If (VT=varError) then |
|
Applied, thank you very much ! |
|
Thank you for the fast resolve. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-05-08 13:05 | Ondrej Pokorny | New Issue | |
2018-05-08 13:05 | Ondrej Pokorny | File Added: dsparams-01.patch | |
2018-05-08 13:39 | Michael Van Canneyt | Assigned To | => Michael Van Canneyt |
2018-05-08 13:39 | Michael Van Canneyt | Status | new => assigned |
2018-05-08 13:41 | Michael Van Canneyt | Fixed in Revision | => 38949 |
2018-05-08 13:41 | Michael Van Canneyt | Note Added: 0108200 | |
2018-05-08 13:41 | Michael Van Canneyt | Status | assigned => resolved |
2018-05-08 13:41 | Michael Van Canneyt | Fixed in Version | => 3.1.1 |
2018-05-08 13:41 | Michael Van Canneyt | Resolution | open => fixed |
2018-05-08 13:41 | Michael Van Canneyt | Target Version | => 3.2.0 |
2018-05-08 14:04 | Ondrej Pokorny | Note Added: 0108202 | |
2018-05-08 14:04 | Ondrej Pokorny | Status | resolved => closed |