You are not logged in.
Pages: 1
I am getting exception in the following zeos code in a connection to a mariadb database:
File ZDbcMySqlStatement, line 3201
procedure TZMariaDBBatchDMLPreparedStatement.SetNullArray(
ParameterIndex: Integer; const SQLType: TZSQLType; const Value;
const VariantType: TZVariantType);
var
Bind: PMYSQL_aligned_BIND;
aArray: PZArray;
I: Integer;
begin
inherited SetNullArray(ParameterIndex, SQLType, Value, VariantType);
{$IFNDEF GENERIC_INDEX}
ParameterIndex := ParameterIndex - 1;
{$ENDIF}
{$R-}
Bind := @FMYSQL_aligned_BINDs[ParameterIndex];
{$IFDEF RangeCheckEnabled}{$R+}{$ENDIF}
if (FMYSQL_STMT = nil) then
InternalRealPrepare;
if (FMYSQL_STMT = nil) then
raise EZSQLException.Create(SFailedtoPrepareStmt);
aArray := BindList[ParameterIndex].Value;
if Pointer(Value) = nil
then FillChar(Bind^.indicators^, BatchDMLArrayCount, Char(MySQLNullIndicatorMatrix[False, FUseDefaults]))
else for i := 0 to BatchDMLArrayCount -1 do
{$R-}
Bind^.indicators[I] := MySQLNullIndicatorMatrix[(Bind^.indicators[i] = Ord(STMT_INDICATOR_NULL)) or IsNullFromArray(aArray, I), FUseDefaults];
{$IFDEF RangeCheckEnabled}{$R+}{$ENDIF}
end;
The above is called by mormot.db.sql.zeos line 1085 TZeosArrayBinding.Create(aStatement: TSqlDBZeosStatement) called by TSqlDBZeosStatement.ExecutePrepared for a Trestbatch
The problem above seems to be that Bind^.indicators is null when having an exception with ParameterIndex=0
Is there a way to overcome it?
Thank you in advance
Offline
No. Now I will do.
Offline
I updated the libmariadb.dll to latest version from here (https://dlm.mariadb.com/browse/c_connector/) and I can not reproduce it for the moment.
So, probably this was the problem. I will inform if something new.
Thank you @ab
Offline
Pages: 1