3.5.8.1deb1
Apache/2.2.22 (Ubuntu)
Database client version: libmysql - 5.5.31
PHP extension: mysqli
Table (can be reproduced on any table)
CREATE TABLE LabelValues
(
labelvalue_id
int(10) NOT NULL AUTO_INCREMENT,
label_id
int(10) unsigned NOT NULL,
object_id
int(10) unsigned NOT NULL,
object_type
enum('RC','PT','ST','EX','CC','FI','SH') NOT NULL,
PRIMARY KEY (labelvalue_id
),
UNIQUE KEY NewIndex
(object_id
,object_type
,label_id
),
KEY LabelValues_FKIndex1
(label_id
),
KEY NewIndex3
(object_type
,object_id
)
) ENGINE=InnoDB AUTO_INCREMENT=4938 DEFAULT CHARSET=utf8;
INSERT INTO LabelValues
(labelvalue_id
, label_id
, object_id
, object_type
) VALUES(7, 5, 1, 'CC');
INSERT INTO LabelValues
(labelvalue_id
, label_id
, object_id
, object_type
) VALUES(143, 2, 2, 'CC');
INSERT INTO LabelValues
(labelvalue_id
, label_id
, object_id
, object_type
) VALUES(144, 2, 3, 'CC');
INSERT INTO LabelValues
(labelvalue_id
, label_id
, object_id
, object_type
) VALUES(3, 4, 4, 'CC');
Reproduction:
First go to "Browse" and order results by object_id.
then write your own query with alias
SELECT * FROM LabelValues
AS alias
;
causes error: #1054 - Unknown column 'LabelValues.object_id' in 'order clause'
phpmyadmin really runs query like this:
SELECT *
FROM LabelValues
AS alias
ORDER BY LabelValues
.object_id
ASC
LIMIT 0 , 30
Diff:
Can't reproduce.
Are you able to reproduce this on demo.phpmyadmin.net for QA_3_5 and/or demo.phpmyadmin.net for QA_4_0?
I can reproduce it on both.
Steps to do it.
LabelValues
ASalias
WHERE 1" to textboxClick Go
Error is reproduced.
Tried with Firefox and Cromium, but I dont believe that it is browser related bug.
attached screenshot for error
screencast for reproducing bug
I can reproduce the problem in 4.0, 4.1.1-dev and current master (b8f54080ab91d15954b448a7a3beb2c1bfc01022).
Hello sir, I have tried to fix this bug. here is the pull request i have submitted, https://github.com/phpmyadmin/phpmyadmin/pull/784 . Please review and let me know if i'm doing it wrong or if I need to make any changes in the same.
Thanks
Fixed with https://github.com/phpmyadmin/phpmyadmin/commit/72f422b157e70d3495b010450b739d0e5234bba6