EPrints Technical Mailing List Archive

Message: #07667


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

Re: [EP-tech] Broken Eprints filter function


Hi Stefan,

I think I have experienced a similar problem in the past.  Are you using MariaDB, which is a fork or MySQL rather than MySQL itself?  If so there is this known issue which would lead to the problem you report:


I have made a change to perl_lib/EPrints/Database/mysql.pm to fix this (around line 399):
 
-        $sql .= " FROM ($select_sql) ".$self->quote_identifier( "S" ); 
+        # 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.
+ my $limit = " LIMIT 2147483647"; +        $limit = "" if $select_sql =~ /LIMIT/; +        $sql .= " FROM ($select_sql$limit) ".$self->quote_identifier( "S" );

Reviewing this now, the regex check for if LIMIT is set is a little
hacky, so it may be worth checking for / LIMIT / rather than just
/LIMIT/ to rule out any chance that a search term that includes the
sub-string LIMIT might getting passed through. However, I think it is likely that
any search terms would have already been lower-cased before this point.  
They will certainly be quoted as individual words, so / LIMIT / will definitively 
check if the SQL LIMIT subcommand is already used.

Regards

David Newman

 
On Tue, 2019-01-29 at 11:58 +0000, Stefan Wellsandt via Eprints-tech wrote:
Hello,
 
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).
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?
 
Best regards
Stefan
 
*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/