xmondrian icon indicating copy to clipboard operation
xmondrian copied to clipboard

Problem with MariaDB 10.2

Open Peter2121 opened this issue 6 years ago • 2 comments

Hi, I installed xmondrian under tomcat8 and tested it on our data with MySQL 5.7.22 - all works correctly. Now I'm trying to switch it to the new database where the data will be migrated soon, and it does not work anymore. It seems that something is going wrong in getLevelMemberCount function, in mondrian.sql log I get the following logs:

2018-06-08 19:37:47,988 DEBUG [mondrian.sql] 3: SqlMemberSource.getLevelMemberCount: executing sql [
select
    count(*) as `c0`
from
    (select distinct
    `llx_olap_view_propal`.`date_valid_day` as `c0`,
    `llx_olap_view_propal`.`date_valid_month` as `c1`,
    `llx_olap_view_propal`.`date_valid_quarter` as `c2`,
    `llx_olap_view_propal`.`date_valid_year` as `c3`
from
    `llx_olap_view_propal` as `llx_olap_view_propal`) as `init`]

...for MySQL (working one) and

2018-06-08 19:39:37,126 DEBUG [mondrian.sql] 3: SqlMemberSource.getLevelMemberCount: executing sql [
select
    count(DISTINCT `llx_olap_view_propal`.`date_valid_day``llx_olap_view_propal`.`date_valid_month``llx_olap_view_propal`.`date_valid_quarter``llx_olap_view_propal`.`date_valid_year`) as `c0`
from
    `llx_olap_view_propal` as `llx_olap_view_propal`]
2018-06-08 19:39:37,129 DEBUG [mondrian.sql] 3: , exec+fetch 3 ms, 0 rows
2018-06-08 19:39:37,129 DEBUG [mondrian.sql] 3: , failed (java.sql.SQLSyntaxErrorException: (conn=6863) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.`date_valid_quarter``llx_olap_view_propal`.`date_valid_year`) as `c0`)

...for MariaDB - error. So in two cases, the SQL query is not the same, evidently the second query is incorrect. I would try to fix it myself, but I cannot build mondrian, downloaded from https://github.com/pentaho/mondrian. Can you share the build instructions, please?

Peter2121 avatar Jun 08 '18 18:06 Peter2121

I am investigating mondrian too, and had building experience of mondrian recently. I am not java developer, but i can share my experience. What your current building workflow and which errors you get?

warlock39 avatar Jun 11 '18 15:06 warlock39

I solved the problem, rebuilding mondrian 3.14 jar from sources jar, downloaded from Sourceforge. The bug was in mondrian.rolap.SqlMemberSource.makeLevelMemberCountSql, around line 270

for (String colDef : columnList) {
                    if (i > 0) {
                        sb.append(", ");
                    }
                    sb.append(
                        sqlQuery.getDialect()
                            .generateCountExpression(colDef));
                    i++;    // ****************** this increment was lost
                }

Peter2121 avatar Jun 14 '18 21:06 Peter2121