search only shows >= and <= in editor

2011-02-04
2013-06-06
  • First than all thank you for your contribution to the world wide FOSS community and greetings from the Caribbean, Puerto Rico.

    I do have some questions.

    When logged in the mysql editor version I can only select , <= and >= operators in the pull down search (query editor) menu. Is this the default setting? and How can I customized to include the = as default? I have look in the forums and bugs but have not being able to find any reference to this.

    The situation is that I am working with a 4M records Database and a Select …. LIKE %% vs  a SELECT ….. =  makes a big difference.

    Thanks in advance for your answer 

     
  • Jakub Vrána
    Jakub Vrána
    2011-02-04

    You can create a customization for this. It would be very simple:

    function adminer_object() {
        
        class AdminerEquals extends Adminer {
            var $operators = array("=", "<=", ">=");
        }
    
        return new AdminerEquals;
    }
    include "./editor.php";
    
     
  • Hi.

    I did the change, but the query still adds the wild percent symbol (%) on both sides of the FECHANAC field as shown:

    SELECT *
    FROM `MASTER`
    WHERE (`FECHANAC` = '%1964-10-11%') AND (`PATERNO` LIKE '%berr%')
    ORDER BY `PATERNO`
    LIMIT 30

    What I want to do is make an exact match without the % symbol.

    Is this possible?

     
  • An extremely QUICK and DIRTY hack:

    function selectSearchProcess($fields, $indexes) {

    …….

    if ($op == "=") {
    $value = $this->processInput($field, ($text_type && ereg('^+$', $val) ? "$val" : $val));
    } else {
    $value = $this->processInput($field, ($text_type && ereg('^+$', $val) ? "%$val%" : $val));
    }

    ……

     
  • Jakub Vrána
    Jakub Vrána
    2011-02-06

    You are right, I've fixed it in Git. If you don't want to use the Git version, you can also bypass

    %%
    

    by searching for

    1964-10-11%
    

    (and no customization would be required).