KnowageLabs/Knowage-Server

multivalue parameter bug

Closed this issue · 3 comments

Describe the bug
I found a bug with multivalue number parameters
they are not passed correctly to postgresql request in a cockpit (to display a table for example)

To Reproduce
Steps to reproduce the behavior:

  1. I create a parmetrical dataset for postgresql
    let's say my query is :
    select id, name from t_table where id in ($P{my_param})
    my_param is number multivalue parameter
    2.I create a LOV like this:
    value,description
    64001,1
    64002,2
    64003,3
  2. I create analytical driver using this lov (number, functional, with no default) and a use mod
  3. I create a cockpit using this parametered dataset and set with analytical driver (multivalue)
  4. I create a table widget to show rows and a text widget to show parameters
  5. I execute cockpit
    when select ing only one value row is displayed correctly
    when selecting multiple values (2) no rows showed but text widget displays parameters ok
  6. in postgresql logs I can see values are replace by 400

Using String instead of Number for parameter type in the dataset fix the problem.

postgresql log bellow

-- number multivalue parameter

-only one value: OK

<2021-01-22 10:03:09 CET;PID : 2916200;DB : geo_knowage;User: postgres;APP : PostgreSQL JDBC Driver;HOST : 10.10.1.4>LOG:  exécute <unnamed>: 
SELECT DISTINCT "insee", "commune" FROM ( select * from communes where insee::integer in (64003) ) T

-two or more values: BROKEN

<2021-01-22 10:03:14 CET;PID : 2916249;DB : geo_knowage;User: postgres;APP : PostgreSQL JDBC Driver;HOST : 10.10.1.4>LOG:  exécute <unnamed>:
SELECT DISTINCT "insee", "commune" FROM (   select * from communes where insee::integer in (400,400) ) T

-- text multivalue parameter

-two or more values: OK

<2021-01-22 10:17:24 CET;PID : 2923308;DB : geo_knowage;User: postgres;APP : PostgreSQL JDBC Driver;HOST : 10.10.1.4>LOG:  exécute <unnamed>: 
SELECT DISTINCT "insee", "commune" FROM ( select * from communes where insee::integer in ('64001','64002') ) T

Knowage 7.2

n3ils commented

Hi @rlagarde ,

we did several tests in our internal laboratory but we were not able to replicate the problem.

I see you are using Knowage version 7.2. Can you update Knowage to the version 7.4 and try again? If the problem persists, we will proceed with further investigation.

Hoping it was helpful to you,
regards.

Alberto

hi @rlagarde,
did the provided solution solve your problem?

Hi,
I just repeated this scenario on Knowage version 7.4 and it's working fine.
I'm closing this issue.
Thanks