267 |
|
|
268 |
|
implementation |
269 |
|
|
270 |
< |
uses IBUtils, FBMessages, FB30Blob, variants, FBArray, FB30Array; |
270 |
> |
uses IBUtils, FBMessages, FBBLob, FB30Blob, variants, FBArray, FB30Array; |
271 |
> |
|
272 |
> |
const |
273 |
> |
ISQL_COUNTERS = 'CurrentMemory, MaxMemory, RealTime, UserTime, Buffers, Reads, Writes, Fetches'; |
274 |
|
|
275 |
|
{ TIBXSQLVAR } |
276 |
|
|
391 |
|
FStatement.GetTransaction as TFB30Transaction, |
392 |
|
GetRelationName,GetFieldName, |
393 |
|
GetSubType); |
394 |
+ |
(FBlobMetaData as TFBBlobMetaData).SetCharSetID(GetCharSetID); |
395 |
|
Result := FBlobMetaData; |
396 |
|
end; |
397 |
|
|
405 |
|
else |
406 |
|
if IsNullable then |
407 |
|
FNullIndicator := 0; |
408 |
+ |
Changed; |
409 |
|
end; |
410 |
|
|
411 |
|
procedure TIBXSQLVAR.SetIsNullable(Value: Boolean); |
652 |
|
for i := 0 to Count - 1 do |
653 |
|
with TIBXSQLVar(Column[i]) do |
654 |
|
begin |
655 |
< |
Move(FSQLData^,(FMessageBuffer + FCurMetaData.getOffset(StatusIntf,i))^,FDataLength); |
655 |
> |
if IsNull then |
656 |
> |
FillChar((FMessageBuffer + FCurMetaData.getOffset(StatusIntf,i))^,FDataLength,0) |
657 |
> |
else |
658 |
> |
Move(FSQLData^,(FMessageBuffer + FCurMetaData.getOffset(StatusIntf,i))^,FDataLength); |
659 |
|
Check4DataBaseError; |
660 |
|
if IsNullable then |
661 |
|
begin |
720 |
|
else |
721 |
|
IBAlloc(FSQLData, 0, FDataLength) |
722 |
|
end; |
723 |
< |
SQL_VARYING: begin |
723 |
> |
SQL_VARYING: |
724 |
|
IBAlloc(FSQLData, 0, FDataLength + 2); |
717 |
– |
end; |
725 |
|
else |
726 |
|
IBError(ibxeUnknownSQLDataType, [sqltype and (not 1)]) |
727 |
|
end; |
1073 |
|
|
1074 |
|
try |
1075 |
|
with Firebird30ClientAPI do |
1069 |
– |
case FSQLStatementType of |
1070 |
– |
SQLSelect: |
1071 |
– |
IBError(ibxeIsAExecuteProcedure,[]); |
1072 |
– |
|
1073 |
– |
SQLExecProcedure: |
1076 |
|
begin |
1077 |
< |
FStatementIntf.execute(StatusIntf, |
1078 |
< |
(aTransaction as TFB30Transaction).TransactionIntf, |
1079 |
< |
FSQLParams.MetaData, |
1080 |
< |
FSQLParams.MessageBuffer, |
1081 |
< |
FSQLRecord.MetaData, |
1082 |
< |
FSQLRecord.MessageBuffer); |
1083 |
< |
Check4DataBaseError; |
1077 |
> |
if FCollectStatistics then |
1078 |
> |
begin |
1079 |
> |
UtilIntf.getPerfCounters(StatusIntf, |
1080 |
> |
(GetAttachment as TFB30Attachment).AttachmentIntf, |
1081 |
> |
ISQL_COUNTERS,@FBeforeStats); |
1082 |
> |
Check4DataBaseError; |
1083 |
> |
end; |
1084 |
|
|
1085 |
< |
Result := TResults.Create(FSQLRecord); |
1086 |
< |
FSingleResults := true; |
1087 |
< |
end |
1088 |
< |
else |
1089 |
< |
FStatementIntf.execute(StatusIntf, |
1090 |
< |
(aTransaction as TFB30Transaction).TransactionIntf, |
1091 |
< |
FSQLParams.MetaData, |
1092 |
< |
FSQLParams.MessageBuffer, |
1093 |
< |
nil, |
1094 |
< |
nil); |
1095 |
< |
Check4DataBaseError; |
1085 |
> |
case FSQLStatementType of |
1086 |
> |
SQLSelect: |
1087 |
> |
IBError(ibxeIsAExecuteProcedure,[]); |
1088 |
> |
|
1089 |
> |
SQLExecProcedure: |
1090 |
> |
begin |
1091 |
> |
FStatementIntf.execute(StatusIntf, |
1092 |
> |
(aTransaction as TFB30Transaction).TransactionIntf, |
1093 |
> |
FSQLParams.MetaData, |
1094 |
> |
FSQLParams.MessageBuffer, |
1095 |
> |
FSQLRecord.MetaData, |
1096 |
> |
FSQLRecord.MessageBuffer); |
1097 |
> |
Check4DataBaseError; |
1098 |
> |
|
1099 |
> |
Result := TResults.Create(FSQLRecord); |
1100 |
> |
FSingleResults := true; |
1101 |
> |
end |
1102 |
> |
else |
1103 |
> |
FStatementIntf.execute(StatusIntf, |
1104 |
> |
(aTransaction as TFB30Transaction).TransactionIntf, |
1105 |
> |
FSQLParams.MetaData, |
1106 |
> |
FSQLParams.MessageBuffer, |
1107 |
> |
nil, |
1108 |
> |
nil); |
1109 |
> |
Check4DataBaseError; |
1110 |
> |
end; |
1111 |
> |
if FCollectStatistics then |
1112 |
> |
begin |
1113 |
> |
UtilIntf.getPerfCounters(StatusIntf, |
1114 |
> |
(GetAttachment as TFB30Attachment).AttachmentIntf, |
1115 |
> |
ISQL_COUNTERS, @FAfterStats); |
1116 |
> |
Check4DataBaseError; |
1117 |
> |
FStatisticsAvailable := true; |
1118 |
> |
end; |
1119 |
|
end; |
1120 |
|
finally |
1121 |
|
if aTransaction <> FTransactionIntf then |
1143 |
|
|
1144 |
|
with Firebird30ClientAPI do |
1145 |
|
begin |
1146 |
+ |
if FCollectStatistics then |
1147 |
+ |
begin |
1148 |
+ |
UtilIntf.getPerfCounters(StatusIntf, |
1149 |
+ |
(GetAttachment as TFB30Attachment).AttachmentIntf, |
1150 |
+ |
ISQL_COUNTERS, @FBeforeStats); |
1151 |
+ |
Check4DataBaseError; |
1152 |
+ |
end; |
1153 |
+ |
|
1154 |
|
FResultSet := FStatementIntf.openCursor(StatusIntf, |
1155 |
|
(aTransaction as TFB30Transaction).TransactionIntf, |
1156 |
|
FSQLParams.MetaData, |
1158 |
|
FSQLRecord.MetaData, |
1159 |
|
0); |
1160 |
|
Check4DataBaseError; |
1161 |
+ |
|
1162 |
+ |
if FCollectStatistics then |
1163 |
+ |
begin |
1164 |
+ |
UtilIntf.getPerfCounters(StatusIntf, |
1165 |
+ |
(GetAttachment as TFB30Attachment).AttachmentIntf, |
1166 |
+ |
ISQL_COUNTERS,@FAfterStats); |
1167 |
+ |
Check4DataBaseError; |
1168 |
+ |
FStatisticsAvailable := true; |
1169 |
+ |
end; |
1170 |
|
end; |
1171 |
|
Inc(FCursorSeqNo); |
1172 |
|
FSingleResults := false; |