There is a TSQLConnection and a TSQLQuery using it to select some data from a MS SQL Server database. If the connection is closed, and after that we perform cleanup of the query (query.SQL.Clear()), an AccessViolation exception is produced in the DBXCommand_GetRowsAffected() method, because the Handle parameter is not checked before usage. This is reproduced regardless of whether the query is closed before the Clear() or not.
The sample code in Delphi (XE8 in our case) is:
Code: Select all
Q.Close();
Q.Prepared := False;
Q.SQL.Clear();
Version 7.2.4 of the driver is used and the exception is raised in unit dbexp4.pas, method DBXCommand_GetRowsAffected(Handle: TCRSQLObject; out Rows: Int64): TDBXErrorCode;
The same code works fine if the Interbase/Firebird driver (dbxida v.4.8.12) is used - no exception is produced.