Uploaded image for project: 'MariaDB Connector/ODBC'
  1. MariaDB Connector/ODBC
  2. ODBC-312

PowerBI import data with text filter raises SQL syntax error (Reproducible!)

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 3.1.12
    • None
    • General
    • None
    • Windows10, PowerBI

    Description

      Hi,
      I found a bug of MariaDB Connector for PowerBI.

      I reported about it to PowerBI community, but they couldn't help it since they (MS) don't have the ownership of MariaDB Connector.

      https://community.powerbi.com/t5/Issues/Import-data-from-MariaDB-with-text-filter-raises-SQL-syntax/idc-p/1818877#M66248

      The following is my original post, so please refer to it and fix the problem.

      Best,


      Hi,
      I'm using PowerBI (version 2.92.706.0, 64-bit) and MariaDB as data source. I downloaded ODBC driver versions 3.1.11 from following link:
      https://mariadb.com/downloads/?showall=1&tab=connectors&group=mariadbconnectors&product=ODBC%20conne...

      Connection & Simple import job worked well. But when I add text filtering (equality check) in Power Query Editor, it raises SQL syntax error like this:

      [ma-3.1.11][10.3.25-MariaDB-0ubuntu0.20.04.1-log]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 'LONG VARCHAR) = ? and `PARTNERS` is not null' at line 11

      PARTERS is the column name which I add filter to.

      It's very easy to reproduce the problem. In MariaDB just create a table like this:

      create table test (name varchar(256), score int(11));

      then, insert two rows:

      insert into test values ('john', 90);
      insert into test values ('nick', 80);

      To get data from MariaDB in PowerBI, import 'test' table then click 'transform data'. In resulting Power Query Editor, add text filter for name 'nick'. Then close & load.

      That's all, I hope you could reproduce the problem, and fix it SOON!
      (In my opnion, it's related with length of VARCHAR. VARCHAR(10) column did not raised the problem)

      Best.

      Attachments

        Issue Links

          Activity

            ilya2 ilya added a comment -

            haje01 This issue was fixed MariaDB Connector for PowerBI. See discussion and the fix here:
            https://github.com/mariadb-corporation/mariadb-powerbi/issues/11

            As you have noticed the problem manifests on VARCHAR columns with a size > 255 only.
            The Power BI Connector fixes the misreported COLUMN_SIZE for the VARCHAR data type which MariaDB ODBC Driver reports to be 255.

            Although the Power BI Connector makes a workaround, there are two related issues:
            1. MariaDB ODBC Driver reports VARCHAR data type's max size is reported 255 instead of 65532.
            2. MariaDB Server requires columns size (N) in CAST(expr AS VARCHAR(N)). Without the column size provided the SQL statement fails. This is the error message you saw in Power BI. Server issue link:
            https://jira.mariadb.org/browse/MDEV-11283

            ilya2 ilya added a comment - haje01 This issue was fixed MariaDB Connector for PowerBI . See discussion and the fix here: https://github.com/mariadb-corporation/mariadb-powerbi/issues/11 As you have noticed the problem manifests on VARCHAR columns with a size > 255 only. The Power BI Connector fixes the misreported COLUMN_SIZE for the VARCHAR data type which MariaDB ODBC Driver reports to be 255. Although the Power BI Connector makes a workaround, there are two related issues: 1. MariaDB ODBC Driver reports VARCHAR data type's max size is reported 255 instead of 65532. 2. MariaDB Server requires columns size (N) in CAST(expr AS VARCHAR(N)). Without the column size provided the SQL statement fails. This is the error message you saw in Power BI. Server issue link: https://jira.mariadb.org/browse/MDEV-11283

            People

              Lawrin Lawrin Novitsky
              haje01 JeongJu, Kim
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.