Issue Details (XML | Word | Printable)

Key: CORE-2416
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

AV preparing a query with aggregate over derived table

Created: 10/Apr/09 07:55 AM   Updated: 31/May/11 03:27 PM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.0.4, 2.5 Alpha 1, 2.1.1, 2.0.5, 2.1.2, 2.5 Beta 1
Fix Version/s: 2.5 Beta 2, 2.1.3

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
WITH
  t0 AS (
    SELECT 1 AS f0, date '01.03.09' AS f1, 'Event1' AS f2
      FROM rdb$database
  ),

  t1 (f1) AS (
    SELECT MIN(t2.f1) AS f1 FROM t0 AS t2 WHERE t2.f0 > t3.f0 AND t2.f1 >= t3.f1 AND t2.f2 = t3.f2
  )
  
SELECT t4.f2, t4.f1_p
  FROM (SELECT t3.f0, t3.f1, t3.f2, CAST((SELECT t1.f1 FROM t1) - t3.f1 AS INTEGER) AS f1_p
          FROM t0 AS t3
       ) AS t4
  WHERE t4.f1_p IS NOT NULL
GROUP BY t4.f2, t4.f1_p


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 04/Jun/09 12:30 PM
Case for FB 2.0.x

SELECT t4.f2, t4.f1_p
  FROM (SELECT t3.f0, t3.f1, t3.f2,
               CAST((SELECT t1.f1 FROM (
                            SELECT MIN(t2.f1) AS f1 FROM (
                                   SELECT 1 AS f0, date '01.03.09' AS f1, 'Event1' AS f2
                                     FROM rdb$database) AS t2
                             WHERE t2.f0 > t3.f0 AND t2.f1 >= t3.f1 AND t2.f2 = t3.f2) as t1)
                    - t3.f1 AS INTEGER) AS f1_p
          FROM (
            SELECT 1 AS f0, date '01.03.09' AS f1, 'Event1' AS f2
              FROM rdb$database) AS t3
       ) AS t4
  WHERE t4.f1_p IS NOT NULL
GROUP BY t4.f2, t4.f1_p

Pavel Cisar added a comment - 31/May/11 01:34 PM
Well, I can't reproduce this problem with neither 2.1.1 or 2.0.5 (both 64-bit SS Linux version). Do I miss something here?

Vlad Khorsun added a comment - 31/May/11 01:44 PM
Just reproduced it with 2.0.0 and 2.0.6, both Win32 SS

Vlad Khorsun added a comment - 31/May/11 01:47 PM
Found very old 2.1.0 RC2 - Win32 SS crashed while Win64 SS don't

Pavel Cisar added a comment - 31/May/11 03:23 PM
I can confirm it too with Win32 version too. So it seems strictly 32-bit related.

Pavel Cisar added a comment - 31/May/11 03:27 PM
QA test added.