Jump to content
  • Jaspersoft 5.5 and 6.3 outputs different results depending on MySql server version


    cristian.muntianu
    Assigned User chicuslavic
    CategoryBug report
    PriorityUrgent
    ReproducibilityAlways
    ResolutionUnable to Reproduce
    SeverityMajor
    StatusResolved
    Versionv6.3

    *Problem*

    When using Jaspersoft 5.5 and 6.3 with MySql server 5.7, the data retrieved from the following query is different when running it from Jaspersoft MySQL.

     

    *Steps to Reproduce*

     

    1. Create the following tables on a schema of your choise:

    drop table if exists table1;

    drop table if exists table2;

     

    create table table1 (

    pkey varchar(256),

    customvalue varchar(256)

    );

    create table table2 (

    pkey varchar(256),

    value varchar(256)

    );

     

    insert into table1 values('abc','2');

    insert into table2 values('abc','example');

    insert into table2 values('foo','bar');

     

    2. Run the following select on your MySql server (Server version must be 5.7 in order to reproduce the error):

    select

    table3.val, customvalue, value

    from

    table1

    inner join

    table2 ON table2.pkey = table1.pkey

    right join

    (select

    pkey, value as val

    from

    table2

    where

    table2.pkey = 'foo') table3 ON table3.pkey = 'foo'

    where

    table1.pkey = 'abc'

    group by table1.pkey;

     

    3. Create a jasper report using the same exact above query and output the results.

     

    *Expected Results*

    MySQL Result set:

    val = bar

    customvalue = 2

    value = example

     

    Jasper Report Result Set:

    var = bar

    customvalue = 2

    value = example

     

    *Acctual Results*

    MySQL Result set:

    val = bar

    customvalue = 2

    value = example

     

    Jasper Report Result Set:

    var = bar

    customvalue = 2

    value = bar

     

     

    This problem only occurs with mysql server 5.7.

    On mysql server 5.6 both the jasper report AND mysql query return the same exact results.



    User Feedback

    Recommended Comments

    I am aware of the fact that the query is not efficient and badly written, but this is the only way I reproduced the issue.

     

    Also, in order to fix the issue, a workaround i've found is to run the query in jaspersoft as follows:

     

    select

    table3.val, customvalue, value AS RANDOMNAME

    from

    table1

    inner join

    table2 ON table2.pkey = table1.pkey

    right join

    (select

    pkey, value as val

    from

    table2

    where

    table2.pkey = 'foo') table3 ON table3.pkey = 'foo'

    where

    table1.pkey = 'abc'

    group by table1.pkey;

     

    Link to comment
    Share on other sites

    On a similar note I have an issue with Jasper Studio 6.3.1 against mysql server 5.7.11 I have a query with a count that when testing against mysql returns 1 row but when testing in the Jasper Studio it returns 29 rows against a set that has 36 rows. I am using mysql-connector-java-5.1.40-bin.jar to provide the mysql connection.
    Link to comment
    Share on other sites

    Changed Resolution from Open to Unable to Reproduce

    Changed Status from New to Resolved

    Changed Assigned User from - to @chicuslavic


    You have to test if running this queries using corresponding jdbc drivers outside jasper reports, jaspersoft studio, you get the same resultset. If not, you have to provide us a sample, report, data, tables, so we can reproduce it. Basically, jaspersoft studio use jasperreports to run a query. JasperReports use jdbc to run the query. I could support problem is in mysql drivers or mysql server.
    Link to comment
    Share on other sites


×
×
  • Create New...