Assertion failure (MyClasses.pas, line 5864)

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
alphaflight83
Posts: 2
Joined: Thu 08 Oct 2009 10:57

Assertion failure (MyClasses.pas, line 5864)

Post by alphaflight83 » Thu 08 Oct 2009 11:24

Hi there, i am currently testing the UniDAC (3.0.0.2) components for Delphi 2009 and was really satisfied with it. But today i tried a MySQL query including UNION and ORDER BY.
The query runs perfectly in the MySQL query browser, so i think the problem comes with UniDAC.
The filepath displayed in the message makes no sense to me.

Assertion failure
(D:\Projects\Delphi\Dac\MySQL\Source\MyClasses.pas, line 5864)

The Query simplified looks like:

Code: Select all

(SELECT
  T1.ID AS Name,
  T1.Partial DIV 3600 AS Partial,
  T1.Total DIV 3600 AS Total,
  T2.Unit AS Unit
FROM Table1 AS T1, Table2 AS T2
WHERE T1.ID = T2.ID
  AND T2.Unit = 'hours')
UNION
(SELECT
  T1.ID AS Name,
  T1.Partial AS Partial,
  T1.Total AS Total,
  T2.Unit AS Unit
FROM Table1 AS T1, Table2 AS T2
WHERE T1.ID = T2.ID
  AND T2.Unit = '')
ORDER BY
  Name ASC
LIMIT 10000
It really seems, that the UNION causes the problem,
cause all other queries in the program work without problems,
including the two parts of the UNION for themselves.[/code]

alphaflight83
Posts: 2
Joined: Thu 08 Oct 2009 10:57

Post by alphaflight83 » Fri 09 Oct 2009 07:14

I posted the problem in the (german) Delphi-Praxis forum and got the following SQL, which works fine:

Code: Select all

SELECT 
  t1.id AS name, 
  CASE WHEN t2.unit = 'hours' 
    THEN t1.partial DIV 3600
    ELSE t1.partial
  END AS partial,
  CASE WHEN t2.unit = 'hours'
    THEN t1.total DIV 3600
    ELSE t1.total
  END AS total,
  t2.unit AS unit
FROM tabelle1 t1
  INNER JOIN tabelle2 t2 
  ON t1.id = t2.id
ORDER BY name 
LIMIT 10000
All other proposals with an UNION included led to the 'assertion failure'

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 09 Oct 2009 07:54

I can not reproduce the problem.
Please send me a complete small sample to dmitryg*devart*com to demonstrate it, including a script to create and fill table.
Also specify the exact version of MySQL server. You can see it in the Info sheet of TMyConnection Editor.

Post Reply