Menu

#2518 (ok 2.11.4) Subquery results without \"as\" are ignored

2.11.0
fixed
1
2013-06-11
2007-08-28
Dan Wilga
No

The following is valid MySQL syntax:

SELECT * FROM (SELECT 1,2) t1

In 2.11.0, this produces no results--not even a row count. Oddly, the lefthand frame containing the list of database tables also refreshes.

The workaround is to change the query to:

SELECT * FROM (SELECT 1,2) AS t1

Note that the first method did work in 2.10.1, but has since been broken.

Discussion

  • pwarnock

    pwarnock - 2007-11-15

    Logged In: YES
    user_id=1615140
    Originator: NO

    I found this bug in 2.11.2.1. Thanks for the workaround.

     
  • pwarnock

    pwarnock - 2007-11-15

    Logged In: YES
    user_id=1615140
    Originator: NO

    This query still fails ->
    SELECT t1.a
    FROM (

    SELECT a
    FROM `tableA`
    WHERE `id` =60
    AND `cstatus` = 'Y'
    ) AS t1
    WHERE a NOT
    IN (

    SELECT a
    FROM tableB s1
    WHERE s1.a = t1.a
    )

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    same problem described here:

    bug #1723297 No result when using cross join of tables
    https://sf.net/support/tracker.php?aid=1723297

     
  • Marc Delisle

    Marc Delisle - 2007-12-21
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2007-12-21
    • priority: 5 --> 1
    • summary: Subquery results without "as" are ignored --> (ok 2.11.4) Subquery results without "as" are ignored
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-12-21

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2008-01-12
    • summary: (ok 2.11.4) Subquery results without "as" are ignored --> (ok 2.11.4) Subquery results without \"as\" are ignored
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed
     
MongoDB Logo MongoDB