You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2011-03-16 10:33:09

skizo
Member
Registered: 2011-03-16
Posts: 6

multiple criteria inventory search is not valid

Hi,

I might have found a bug while searching the inventory in GLPI version is 0.78.2

While putting a couple of local criteria in inventory search and a global criteria, the result is wrong.

By logging the MySQL request I found out that the last condition (which was specified as a global criteria) is inside the parenthesis.
Even Worst, the precedence of the AND operator over the OR makes the request wrong.

Look at the Mysql request :

WHERE 
    `glpi_softwares`.`is_deleted` = '0' 
    AND `glpi_softwares`.`is_template` = '0' 
    AND
    (
        (    `glpi_softwares`.`name`  LIKE '%virus%'    OR  `glpi_entities`.`completename`  LIKE '%virus%'    OR  `glpi_manufacturers`.`name`  LIKE '%virus%'    OR  `glpi_softwareversions`.`name`  LIKE '%virus%'    OR  `glpi_operatingsystems`.`name`  LIKE '%virus%'   ) 
      OR 
        (    `glpi_softwares`.`name`  LIKE '%kasper%'    OR  `glpi_entities`.`completename`  LIKE '%kasper%'    OR  `glpi_manufacturers`.`name`  LIKE '%kasper%'    OR  `glpi_softwareversions`.`name`  LIKE '%kasper%'    OR  `glpi_operatingsystems`.`name`  LIKE '%kasper%'   ) 
      OR 
        (    `glpi_softwares`.`name`  LIKE '%afee%'    OR  `glpi_entities`.`completename`  LIKE '%afee%'    OR  `glpi_manufacturers`.`name`  LIKE '%afee%'    OR  `glpi_softwareversions`.`name`  LIKE '%afee%'    OR  `glpi_operatingsystems`.`name`  LIKE '%afee%'   )   
      AND
        (`glpi_operatingsystems_Computer`.`id` = '45') 
    )

Here is the screenshot of the request setting.

glpi_screenshot0.png

So is this a bug or me not using the feature the right way ?

Offline

#2 2011-03-22 11:26:36

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: multiple criteria inventory search is not valid

The problem is that we cannot make parenthesis choice.
In your case the paenthesis is needed for your purpose but for another search no.

We need to work on these problem.
I create a ticket for it : https://forge.indepnet.net/issues/2681


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

Board footer

Powered by FluxBB