Skip to content

Commit 9c1131f

Browse files
committed
Backwards Compatibility Test
1 parent 7259064 commit 9c1131f

File tree

5 files changed

+74
-3
lines changed

5 files changed

+74
-3
lines changed

changelog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
FBINTF Change Log version (1.4-5 Build 1238) Mon, 20 Jan 2025 11:45:29 +0000
2+
3+
1. TSQLParam.Clear now resets the SQL Type (if it was changed when setting the param)
4+
and re-initialises the underlying data structure.
5+
6+
2. TSQLParam.InternalSetString now clears the param before setting the value (also see above).
7+
8+
3. When IStatement.Prepare is executed the underlying data structures are freed and then
9+
re-created thus ensuring that there are no "left overs" from a previous use.
10+
111
FBINTF Change Log version (1.4-4 Build 1238) Mon, 20 Jan 2025 11:45:29 +0000
212

313
1. FB30Blob. Removed unnecessary Firebird.IAttachment.release from close and cancel methods

client/2.5/FB25Statement.pas

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,7 @@ procedure TIBXSQLDA.FreeXSQLDA;
907907
TIBXSQLVAR(Column[i]).Free;
908908
SetLength(FColumnList,0);
909909
FSize := 0;
910+
FCount := 0;
910911
end;
911912

912913
function TIBXSQLDA.GetStatement: IStatement;
@@ -1222,6 +1223,11 @@ procedure TFB25Statement.FreeHandle;
12221223
FHandle := nil;
12231224
FCursor := '';
12241225
FPrepared := false;
1226+
FProcessedSQL := '';
1227+
if FSQLParams <> nil then
1228+
FSQLParams.FreeXSQLDA;
1229+
if FSQLRecord <> nil then
1230+
FSQLRecord.FreeXSQLDA;
12251231
end;
12261232
end;
12271233

client/3.0/FB30Statement.pas

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,6 +1664,11 @@ procedure TFB30Statement.FreeHandle;
16641664
FPrepared := false;
16651665
end;
16661666
FCursor := '';
1667+
FProcessedSQL := '';
1668+
if FSQLParams <> nil then
1669+
FSQLParams.FreeXSQLDA;
1670+
if FSQLRecord <> nil then
1671+
FSQLRecord.FreeXSQLDA;
16671672
end;
16681673

16691674
procedure TFB30Statement.InternalClose(Force: boolean);

client/FBSQLData.pas

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2467,6 +2467,7 @@ procedure DoSetString;
24672467
aScale: integer;
24682468
begin
24692469
CheckActive;
2470+
Clear;
24702471
if IsNullable then
24712472
IsNull := False;
24722473
with FFirebirdClientAPI do
@@ -2588,8 +2589,57 @@ procedure TSQLParam.SetSQLType(aValue: cardinal);
25882589
end;
25892590

25902591
procedure TSQLParam.Clear;
2592+
const
2593+
EmptyQuad: TISC_QUAD = (gds_quad_high:0;gds_quad_low:0);
25912594
begin
2592-
IsNull := true;
2595+
{Restores the original SQL Type - if it was changed}
2596+
if CanChangeMetaData then
2597+
FIBXSQLVar.SetSQLType(getColMetadata.GetSQLType);
2598+
if IsNullable then
2599+
IsNull := true
2600+
else
2601+
case SQLTYPE of
2602+
SQL_BOOLEAN:
2603+
AsBoolean := false;
2604+
2605+
SQL_BLOB,
2606+
SQL_ARRAY,
2607+
SQL_QUAD:
2608+
AsQuad := EmptyQuad;
2609+
2610+
SQL_VARYING,
2611+
SQL_TEXT:
2612+
FIBXSQLVar.SetString('');
2613+
2614+
SQL_SHORT,
2615+
SQL_LONG,
2616+
SQL_INT64,
2617+
SQL_DEC_FIXED,
2618+
SQL_DEC16,
2619+
SQL_DEC34,
2620+
SQL_INT128,
2621+
SQL_D_FLOAT,
2622+
SQL_DOUBLE,
2623+
SQL_FLOAT:
2624+
SetAsNumeric(IntToNumeric(0));
2625+
2626+
SQL_TIMESTAMP:
2627+
SetAsDateTime(0);
2628+
2629+
SQL_TYPE_DATE:
2630+
SetAsDate(0);
2631+
2632+
SQL_TYPE_TIME:
2633+
SetAsTime(0);
2634+
2635+
SQL_TIMESTAMP_TZ,
2636+
SQL_TIMESTAMP_TZ_EX:
2637+
SetAsDateTime(0,'');
2638+
2639+
SQL_TIME_TZ,
2640+
SQL_TIME_TZ_EX:
2641+
SetAsTime(0,0,'');
2642+
end;
25932643
end;
25942644

25952645
function TSQLParam.CanChangeMetaData: boolean;

testsuite/testsuite.lpi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</PublishOptions>
2929
<RunParams>
3030
<local>
31-
<CommandLineParams Value="-t 10"/>
31+
<CommandLineParams Value="-t 21"/>
3232
</local>
3333
<environment>
3434
<UserOverrides Count="3">
@@ -41,7 +41,7 @@
4141
<Modes Count="1">
4242
<Mode0 Name="default">
4343
<local>
44-
<CommandLineParams Value="-t 10"/>
44+
<CommandLineParams Value="-t 21"/>
4545
</local>
4646
<environment>
4747
<UserOverrides Count="3">

0 commit comments

Comments
 (0)