This is related to [#4030].
"SELECT LENGTH(field
) FROM table
" properly shows the list. But I am not able to sort the list. Clicking on the column "LENGTH(field
)" shows the "Loading..." message and after a few seconds … nothing changed.
I am not able to sort by that column.
I cannot reproduce this problem with version 4.2.13. Please attach a small export of your table.
-- phpMyAdmin SQL Dump
-- version 4.2.13
-- http://www.phpmyadmin.net
--
-- Generation Time: Dec 05, 2014 at 04:18 PM
-- Server version: 5.5.40-36.1-log
-- PHP Version: 5.3.10-1ubuntu3.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database:
test
--
--
-- Table structure for table
test
--
CREATE TABLE IF NOT EXISTS
test
(i
int(11) NOT NULL,t
mediumtext COLLATE utf8_unicode_ci NOT NULL) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table
test
--
INSERT INTO
test
(i
,t
) VALUES(1, 'abc'),
(2, 'bcd'),
(3, 'cdef');
--
-- Indexes for dumped tables
--
--
-- Indexes for table
test
--
ALTER TABLE
test
ADD PRIMARY KEY (
i
);--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table
test
--
ALTER TABLE
test
MODIFY
i
int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=4;The editor here seems to destroy backticks.
"SELECT LENGTH(t) FROM [bt]test[/bt]" works, "SELECT LENGTH([bt]t[/bt]) FROM [bt]test[/bt]" doesn't.
Thanks. With backticks around the column name, I can reproduce the problem in 4.2.13 and 4.3.0.
More details, if needed:
SELECT LENGTH(field), LENGTH([bt]field[/bt]) FROM table
will throw an error even if you try to sort on the length without backticks. So it's not specific to the sorted column, but to the fact that you try to sort a result of a query with a function call on a field with backticks.
Last edit: Hugues Peccatte 2014-12-06
I sent a PR for this ticket: https://github.com/phpmyadmin/phpmyadmin/pull/1415
The new PR had been sent: https://github.com/phpmyadmin/phpmyadmin/pull/1417
field
) FROMtable
does not sort --> (ok 4.3.1) SELECT LENGTH(field
) FROMtable
does not sort