Menu

#2421 (ok 2.11.4) space after COUNT breaks Export but not Query

2.11.3
fixed
1
2014-08-30
2007-04-30
Ian Davis
No

This was discovered by a friend of mine in the lab who's new to SQL. He wrote "SELECT COUNT (*) FROM some_table ..." -- notice the space between COUNT and the parens. phpMyAdmin deals with this just fine, even though e.g. the command line MySQL interface complains. I suspect that the pretty-printer corrects this SQL before it's sent to the database. If, however, you try to export the results to a file, you get an error message -- apparently the original, un-sanitized SQL is sent directly to the database in this case.

This is a problem in general because it means that the in-browser results of a query may not match the results downloaded to a file. I believe that the same SQL should always be used for display results vs. export results. I don't care much whether this particular statement succeeds or fails, just that phpMyAdmin handles it consistently.

This bug has been verified with several recent (2.8.x, 2.10.x) versions, including the public demo server (2.11.0-dev, I believe). It occurs on the most recent versions of Safari and Firefox on OS X, and has been verified for both CSV and SQL export (presumably affects all types, however).

Discussion

  • Marc Delisle

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

    Marc Delisle - 2007-12-20
    • milestone: --> 2.11.3
    • priority: 5 --> 1
    • summary: space after COUNT breaks Export but not Query --> (ok 2.11.4) space after COUNT breaks Export but not Query
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2007-12-20

    Logged In: YES
    user_id=210714
    Originator: NO

    Fixed in subversion, thanks for reporting.

     
  • Marc Delisle

    Marc Delisle - 2008-01-12
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

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