Menu

#2987 (ok 3.3.1) Querying a table named "data"

fixed
1
2013-06-11
2010-03-01
No

Bug 1783620 "Subquery results without \"as\" are ignored" is marked Fixed Closed, but the bug repeats in phpMyAdmin 3.2.2-rc1, 3.2.5 and 3.3.0-rc:

1. Query "SELECT * FROM data d" displays correct rowset, but upper page title becomes "localhost - db_name - d". There's no table 'd', so link 'd' is invalid,
2. Query "SELECT * FROM data d WHERE TRUE;" is simply ignored as described in Bug 1783620.

Workaround is to remove alias or add AS.

Config: Apache/2.0.49 (Win32), MySQL: 5.1.30-community, PHP/5.2.13.

Discussion

  • Herman van Rink

    Herman van Rink - 2010-03-02

    1) I've tried to replicate this but for me the full table name is shown as it should in the 'serverinfo' div.

    2) I get the full table data as I would expect from such a query.

    Could you please try to clarify or demonstrate your problem on demo.phpmyadmin.net?

     
  • Marc Delisle

    Marc Delisle - 2010-03-03
    • status: open --> pending
     
  • Arcadiy Fedushin

    Look please at DB "arcadius" on http://demo.phpmyadmin.net/STABLE/index.php?db=arcadius .
    The bug repeats; 2nd query from Details gave on its 1st run:

    Notice in ./libraries/sqlparser.lib.php#813
    Undefined index: len

    Backtrace

    ./libraries/common.lib.php#1084: PMA_SQP_analyze(array)
    ./libraries/db_links.inc.php#141: PMA_showMessage(string #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"SELECT * FROM data d WHERE TRUE' at line 1)
    ./libraries/db_info.inc.php#275: require(./libraries/db_links.inc.php)
    ./db_sql.php#29: require(./libraries/db_info.inc.php)
    ./sql.php#325: require(./db_sql.php)
    ./import.php#411: require(./sql.php)

     
  • Marc Delisle

    Marc Delisle - 2010-03-03
    • status: pending --> open
     
  • Arcadiy Fedushin

    DB where error repeats.

     
  • Arcadiy Fedushin

    Аttached dump file of this DB.

     
  • Marc Delisle

    Marc Delisle - 2010-03-05
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2010-03-05

    The bug is related to the table name; indeed, if renamed to data2, both bugs do not happen in 3.3.0. No problem either if the table name is enclosed with backquotes.

     
  • Marc Delisle

    Marc Delisle - 2010-03-05
    • summary: Wrong "alias with no AS" processing --> Table named "data"
     
  • Marc Delisle

    Marc Delisle - 2010-03-05

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2010-03-05
    • priority: 5 --> 1
    • summary: Table named "data" --> (ok 3.3.1) Querying a table named "data"
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2010-03-16
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

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