Prepared TMyQuery triggers Assertion Failure in MyClasses line 6287

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sdaberle
Posts: 6
Joined: Tue 12 Sep 2017 16:34

Prepared TMyQuery triggers Assertion Failure in MyClasses line 6287

Post by sdaberle » Sat 10 Mar 2018 21:24

I'm working with DevArt's MyDAC for RAD Studio 10.2, version 9.1.4, using Delphi XE10.2 VCL. I have a TMyQuery component that, when Prepared before execution, triggers an Assertion Failure in MyClasses.pas at line 6287 on activation. Tracing further, I find the error is triggered during processing of line 12659 of the Data.DB unit -- the OpenCursor statement in the TDataSet.SetActive method. Code for the TMyQuery SQL follows below. The Integer parameters :Rows and :Columns have been set to 2 and 1000 respectively when I've been testing it.

Workaround: simply removing the Prepare call for this query eliminates the problem. I'd love to get an understand of why it's happening, however. (I notice from the documentation that Prepare can be "unstable".... Perhaps the specifics of the problem I'm encountering will help make it stabler -- or perhaps not.) An apparently identical TMyQuery component functions without difficulty on another form in my application, including when it is Prepared before activation.

Code: Select all

SELECT CellNbr, CAST(:Rows AS Integer) AS `Rows`, 
CAST(:Columns AS Integer) AS `Columns`,
((CellNbr - 1) / :Columns) + 1 AS RowNbr,
CAST(MOD((CellNbr - 1), :Columns) + 1 AS Integer) AS ColumnNbr,
MOD((CellNbr - 1), :Columns) * :Rows + ((CellNbr - 1) / :Columns) + 1 AS CellNbrByCol 
FROM CellNbr
WHERE CellNbr <= (:Rows * :Columns)

ViktorV
Devart Team
Posts: 2299
Joined: Wed 30 Jul 2014 07:16

Re: Prepared TMyQuery triggers Assertion Failure in MyClasses line 6287

Post by ViktorV » Tue 13 Mar 2018 12:33

Thank you for the information. We have reproduced the problem and it will be fixed in the next build.

Post Reply