<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div>Hi Stefan,</div>
<div><br>
</div>
<div>I think I have experienced a similar problem in the past. &nbsp;Are you using MariaDB, which is a fork or MySQL rather than MySQL itself? &nbsp;If so there is this known issue which would lead to the problem you report:</div>
<div><br>
</div>
<div><a href="https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmariadb.com%2Fkb%2Fen%2Flibrary%2Fwhy-is-order-by-in-a-from-subquery-ignored%2F&amp;data=01%7C01%7C%7C6605e59ef0a64bbe5a1e08d685e590e7%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=g3uO4fIcbSe0udu496PquGNhaARYKM1hG69Cor8IeC4%3D&amp;reserved=0" originalsrc="https://mariadb.com/kb/en/library/why-is-order-by-in-a-from-subquery-ignored/" shash="q26FePjcSD2IcLLhl2ZyffeZjp2LBCF&#43;S&#43;F1vpBVnQ8bH9R3M8sN0hV7AZAIIuqxANTRUdv&#43;uOg7nPCLGPk98t6PCkJWJojHqQbsRCBW5OTFBuOPI8bEbwyR1G5nS5BtvACYaApcVWjiSEWCGrSh5YmO8/jdB1dChRvH1hLKFJU=">https://mariadb.com/kb/en/library/why-is-order-by-in-a-from-subquery-ignored/</a></div>
<div><br>
</div>
<div>I have made a change to perl_lib/EPrints/Database/mysql.pm to fix this (around line 399):</div>
<div>
<pre class="diff"> </pre>
<pre class="diff">-        $sql .= &quot; FROM ($select_sql) &quot;.$self-&gt;quote_identifier( &quot;S&quot; );&nbsp;</pre>
<pre class="diff"><span class="rem"><pre class="diff">&#43;        # MariaDB does not order sub-queries unless limited. Using limit of 2^31-1 in case any system is using a signed 32-bit integer.</pre></span><span class="add">&#43;        my $limit = &quot; LIMIT 2147483647&quot;;
</span><span class="add">&#43;&nbsp; &nbsp; &nbsp; &nbsp; $limit = &quot;&quot; if $select_sql =~ /LIMIT/;
</span><span class="add">&#43;&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; FROM ($select_sql$limit) &quot;.$self-&gt;quote_identifier( &quot;S&quot; );</span></pre>
<pre class="diff"><span class="add"><br></span></pre>
<pre class="diff">Reviewing this now, the regex check for if LIMIT is set is a little<br class="-x-evo-wrap-br">hacky, so it may be worth checking for / LIMIT / rather than just<br class="-x-evo-wrap-br">/LIMIT/ to rule out any chance that a search term that includes the<br class="-x-evo-wrap-br">sub-string LIMIT might getting passed through.  However, I think it is likely that<br class="-x-evo-wrap-br">any search terms would have already been lower-cased before this point. &nbsp;</pre>
<pre class="diff">They will certainly be quoted as individual words, so / LIMIT / will definitively&nbsp;</pre>
<pre class="diff">check if the SQL LIMIT subcommand is already used.</pre>
<pre class="diff"><br></pre>
<pre class="diff">Regards</pre>
<pre class="diff"><br></pre>
<pre class="diff">David Newman</pre>
<pre class="diff"><span class="add">
</span> </pre>
</div>
<div>On Tue, 2019-01-29 at 11:58 &#43;0000, Stefan Wellsandt via Eprints-tech wrote:</div>
<blockquote type="cite">
<div>Hello,</div>
<div>&nbsp;</div>
<div>I encountered a problem with the filter function in the “Manage Eprints” administrator interface of our institute’s repository (v3.3). Typically, I would be able to filter by id, name or any of the columns I visualize (works for users, for instance).</div>
<div>However, for some reason it does not work for Eprints. I can filter by ID, but any of the other filters shows no effect. I assume I changed some configuration to make it break. Has anyone an idea, which configuration file could be the cause of this behavior?</div>
<div>&nbsp;</div>
<div>Best regards</div>
<div>Stefan</div>
<div>&nbsp;</div>
<div>*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</div>
<div>*** Archive: <a href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=01%7C01%7C%7C6605e59ef0a64bbe5a1e08d685e590e7%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=IUspdm3BXwHaO0MLkx80RTQ0%2BHzJxUF2gs2c3lbb3%2F8%3D&amp;reserved=0" originalsrc="http://www.eprints.org/tech.php/" shash="QAzzeup7VBdhJwl5PAuM8BZpPu8wO76s4/wVJowtjA8OMTpOsgfZSkvSpVHfwGoai/y43sFi7PYaWS5gvJeAIRO3P2N7l/mx4oT2rI3CkvEFI0JoJn15QyfoXRDryC1A2Vcuo6ZH5mLyyFKvbz5TLFtok5akTDD2FkiPYSQN2JY=">
http://www.eprints.org/tech.php/</a></div>
<div>*** EPrints community wiki: <a href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=01%7C01%7C%7C6605e59ef0a64bbe5a1e08d685e590e7%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=9KlNNc%2FuqnbKDjKWMF55UftXFd8UzyBaK%2FWfOg%2B58dM%3D&amp;reserved=0" originalsrc="http://wiki.eprints.org/" shash="wms8WEJ/sMcFODRysDxaJ/OR03gh44/uc49Us9UHgcVinOFufPKrmLeCNqmml9BQkD9nfmPV1RTltxiUBXoZ9g6nd6v8ODYsIOnaoiJkdIFRoHS6c3pU18Rp5odrqPFEAktSgwlr4Q5W3RK9Y8UNgLuY92Bv9aOcjZMLfbgD6Xw=">
http://wiki.eprints.org/</a></div>
<div>*** EPrints developers Forum: <a href="https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fforum.eprints.org%2F&amp;data=01%7C01%7C%7C6605e59ef0a64bbe5a1e08d685e590e7%7C4a5378f929f44d3ebe89669d03ada9d8%7C1&amp;sdata=RzgoNdohlVFlUYT8c7dDggT6OyIL2SH5cN8YJksFfnU%3D&amp;reserved=0" originalsrc="http://forum.eprints.org/" shash="HOd4HKqWEU6rRLOsP6coT0O4vUOLg7Dto9IfJa&#43;Wckg8R2Dj8Ruev2/KXSZU9/ys&#43;w4duQcM6utQJbOVp7rt3DEeikE0tVBc3MlNAJs7Km3Is&#43;kc4sw3FBm89FIAJzN5Al5g3WF342h/KmwsgUyekYcnHwg4kZ5vbCeFOzjfg7E=">
http://forum.eprints.org/</a></div>
</blockquote>
</body>
</html>