#1 2024-07-18 19:54:46

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

exception in Trestbatch with zeos-mariadb

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

#2 2024-07-19 06:29:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: exception in Trestbatch with zeos-mariadb

Sounds more like a Zeos problem.
Did you ask on the Zeos forum?

Offline

#3 2024-07-19 06:30:39

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

Re: exception in Trestbatch with zeos-mariadb

No. Now I will do.

Offline

#4 2024-07-19 08:22:09

dcoun
Member
From: Crete, Greece
Registered: 2020-02-18
Posts: 416

Re: exception in Trestbatch with zeos-mariadb

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

Board footer

Powered by FluxBB