This bug was reported before 988723 and supposedly
fixed. However it is still present in 2.6.2-rc1
SELECT count(*) , foo
FROM bar
GROUP BY foo
works fine, then if you click to sort on the count(*)
column you get the error
SELECT count( * ) , foo
FROM bar
GROUP BY foo
ORDER BY `count(*)` ASC
#1054 - Unknown column 'count(*)' in 'order clause'
This is caused by phpMyAdmin inserting extraneous
spaces either side of the wildcard, "SELECT count( *
)" should be "SELECT count(*)"
(or conversely if you must introduce extaneous spaces
put them into the ORDER BY subclause as well)
Logged In: YES
user_id=1261516
same problem with some sql statements. sometimes pma inserts
a space where it doesn't fit and then the sql query isn't
valid. does anybody know which file to patch to not add
extraneous spaces ?
Logged In: YES
user_id=210714
fixed in cvs.
nologin: please give examples of such statements
Logged In: YES
user_id=1256038
2005-04-27 19:00 installed latest CVS and bug still present :-
SQL query: Documentation
SELECT foo( * ) , bar
FROM mytable
GROUP BY bar
ORDER BY `foo(*)` ASC
LIMIT 0 , 30
MySQL said: Documentation
#1054 - Unknown column 'count(*)' in 'order clause'
boxrec
Logged In: YES
user_id=210714
Please confirm that you have libraries/sqlparser.lib.php v2.31.
Logged In: YES
user_id=1256038
No, latest cvs gave me :-
/* $Id: sqlparser.lib.php,v 2.30 2005/04/25 19:43:55 lem9
Exp $ */
Logged In: YES
user_id=210714
Ok, there is a 5-hour lag for anonymous cvs.
I attached here the latest version, just unzip and rename
to libraries/sqlparser.lib.php.
sqlparser.lib.php
Logged In: YES
user_id=1256038
You got it, good work.
Many thanks, John boxrec.com
Logged In: YES
user_id=1261516
An example is if you have a statement like
select a.* from atable a;
sometimes will be modified by pma to
select a. * from atable a; (extra space between . and *)